-
Notifications
You must be signed in to change notification settings - Fork 22
feat(install): add Helm chart for Operator installation #1175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Prasunamadasu
wants to merge
2
commits into
cryostatio:main
Choose a base branch
from
Prasunamadasu:feature/add-helm-chart
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| release-name-template: "cryostat-operator-v{{ .Version }}" | ||
| release-notes-file: release-notes.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Release Helm Chart | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'helm/charts/**' | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| helm-release: | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "$GITHUB_ACTOR" | ||
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
|
|
||
| - name: Get release version | ||
| id: release-version | ||
| run: | | ||
| version=$(yq .version helm/charts/cryostat-operator/Chart.yaml) | ||
| echo "tag=cryostat-operator-v${version}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Get previous version | ||
| id: previous-version | ||
| run: | | ||
| chart_version="${{ steps.release-version.outputs.tag }}" | ||
| previous_version="$({ echo ${chart_version}; git tag -l | grep -E '^cryostat-operator-v[0-9]+\.[0-9]+\.[0-9]+$'; } | sort -V | grep -B1 "${chart_version}" | head -n1)" | ||
| echo "tag=${previous_version}" >> $GITHUB_OUTPUT | ||
|
|
||
|
|
||
| - name: Generate release notes | ||
| env: | ||
| GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
| run: | | ||
| gh api --method POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| /repos/${GITHUB_REPOSITORY}/releases/generate-notes \ | ||
| -f tag_name="${{ steps.release-version.outputs.tag }}" \ | ||
| -f target_commitish="${GITHUB_REF_NAME}" \ | ||
| -f previous_tag_name="${{ steps.previous-version.outputs.tag }}" | jq -r .body > helm/charts/cryostat-operator/release-notes.md | ||
|
|
||
| - name: Run chart-releaser | ||
| uses: helm/chart-releaser-action@v1.7.0 | ||
| env: | ||
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
| with: | ||
| charts_dir: helm/charts | ||
| config: .github/helm-release-config.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v2 | ||
| name: cryostat-operator | ||
| description: A Helm chart to deploy cryostat-operator | ||
| type: application | ||
| version: 1.0.0 | ||
| appVersion: "3.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Cryostat Operator Helm Chart | ||
|
|
||
| A Helm chart to deploy the Cryostat Operator on Kubernetes to automate the deployment of [Cryostat](https://cryostat.io/). Cryostat is a tool for monitoring and profiling Java applications using Java Flight Recorder (JFR). | ||
|
|
||
| This chart deploys Cryostat Operator version 3.0.0 | ||
|
|
||
| ## Features | ||
|
|
||
| - Includes CustomResourceDefinitions (CRDs) for Cryostat resources | ||
| - Manages TLS certificates for webhook server via cert-manager | ||
| - Provides Mutating and Validating Admission Webhook configurations for Cryostat CRD operations | ||
| - Defines appropriate RBAC roles and bindings for namespace and cluster-level permissions | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Deploy with Helm | ||
| ```bash | ||
| helm repo add cryostat-operator https://cryostatio.io/cryostat-operator | ||
| helm repo update | ||
| helm upgrade --install cryostat-operator cryostat-operator \ | ||
| --create-namespace -n cryostat-operator | ||
| ``` | ||
| ### Install from local Helm chart folder | ||
|
|
||
| Clone the project repository and install the chart locally: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/cryostatio/cryostat-operator.git | ||
| cd cryostat-operator/helm/charts/cryostat-operator | ||
| helm install cryostat-operator . --create-namespace -n cryostat-operator | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| After installation, manage Cryostat instances with the `Cryostat` Custom Resource. Refer to Cryostat Operator upstream documentation for CR usage. | ||
|
|
||
| ## References | ||
|
|
||
| - [Cert Manager Certificate](https://cert-manager.io/docs/usage/certificate/) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "cryostat-operator.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "cryostat-operator.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "cryostat-operator.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "cryostat-operator.labels" -}} | ||
| helm.sh/chart: {{ include "cryostat-operator.chart" . }} | ||
| {{ include "cryostat-operator.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "cryostat-operator.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "cryostat-operator.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "cryostat-operator.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "cryostat-operator.name" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This produces a certmanager-related complaint:
values.yaml doesn't seem to have
certManager.issuerfor any default values, so either this should be included in the values.yaml or the installation instructions should describe the prerequisite setup steps.