Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/helm-release-config.yml
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
59 changes: 59 additions & 0 deletions .github/workflows/release-helm-chart.yml
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
23 changes: 23 additions & 0 deletions helm/charts/cryostat-operator/.helmignore
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/
6 changes: 6 additions & 0 deletions helm/charts/cryostat-operator/Chart.yaml
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"
39 changes: 39 additions & 0 deletions helm/charts/cryostat-operator/README.md
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

Copy link
Copy Markdown
Member

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:

$ helm install cryostat-operator . --create-namespace -n cryostat-operator
Error: INSTALLATION FAILED: template: cryostat-operator/templates/secret.yaml:21:20: executing "cryostat-operator/templates/secret.yaml" at <.Values.certManager.issuer.kind>: nil pointer evaluating interface {}.kind

values.yaml doesn't seem to have certManager.issuer for any default values, so either this should be included in the values.yaml or the installation instructions should describe the prerequisite setup steps.

```

## 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/)
62 changes: 62 additions & 0 deletions helm/charts/cryostat-operator/templates/_helpers.tpl
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 }}
Loading