From d7e40433c0bf1adba43236604c6ae1b379f4ebd9 Mon Sep 17 00:00:00 2001 From: Adrian Coman <1664229+azun@users.noreply.github.com> Date: Tue, 18 Aug 2026 02:16:50 +0300 Subject: [PATCH 1/2] Added schema and docs template for operator chart. --- charts/zookeeper-operator/README.md | 51 +++++----- charts/zookeeper-operator/README.md.gotmpl | 46 +++++++++ .../zookeeper-operator/templates/_helpers.tpl | 10 +- .../templates/operator.yaml | 8 +- charts/zookeeper-operator/values.schema.json | 97 +++++++++++++++++++ charts/zookeeper-operator/values.yaml | 41 +++++--- 6 files changed, 204 insertions(+), 49 deletions(-) create mode 100644 charts/zookeeper-operator/README.md.gotmpl create mode 100644 charts/zookeeper-operator/values.schema.json diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index 668aa8e65..5dbc1fea7 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -43,28 +43,29 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the zookeeper-operator chart and their default values. -| Parameter | Description | Default | -| ----- | ----------- | ------ | -| `additionalEnv` | Additional Environment Variables | `[]` | -| `additionalSidecars` | Additional Sidecars Configuration | `[]` | -| `additionalVolumes` | Additional volumes required for sidecars | `[]` | -| `affinity` | Specifies scheduling constraints on pods | `{}` | -| `annotations` | Operator pod annotations | `{}` | -| `crd.create` | Create zookeeper CRD | `true` | -| `disableFinalizer` | Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped.| `false` | -| `global.imagePullSecrets` | Lists of secrets to use to pull zookeeper-operator image from a private registry | `[]` | -| `hooks.backoffLimit` | backoffLimit for batch jobs | `10` | -| `hooks.delete` | Create pre-delete hook which ensures that the operator cannot be deleted until the zookeeper cluster custom resources have been cleaned up | `true` | -| `hooks.image.repository` | Image repository for batch jobs | `"lachlanevenson/k8s-kubectl"` | -| `hooks.image.tag` | Image tag for batch jobs | `"v1.16.10"` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.repository` | Image repository | `pravega/zookeeper-operator` | -| `image.tag` | Image tag | `0.2.15` | -| `labels` | Operator pod labels | `{}` | -| `nodeSelector` | Map of key-value pairs to be present as labels in the node in which the pod should run | `{}` | -| `rbac.create` | Create RBAC resources | `true` | -| `resources` | Specifies resource requirements for the container | `{}` | -| `serviceAccount.create` | Create service account | `true` | -| `serviceAccount.name` | Name for the service account | `zookeeper-operator` | -| `tolerations` | Specifies the pod's tolerations | `[]` | -| `watchNamespace` | Namespaces to be watched | `""` | +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| additionalEnv | list | `[]` | Additional Environment Variables | +| additionalSidecars | list | `[]` | Additional Sidecars Configuration | +| additionalVolumes | list | `[]` | Additional volumes required for sidecars | +| affinity | object | `{}` | Operator pod affinity can be set | +| annotations | object | `{}` | Pod annotations | +| crd.create | bool | `true` | Create zookeeper CRD | +| disableFinalizer | bool | `false` | Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped | +| global.imagePullSecrets | list | `[]` | Lists the secrets you need to use to pull zookeeper-operator image from a private registry. | +| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| image.repository | string | `"ghcr.io/adobe/zookeeper-operator"` | Image repository | +| image.tag | string | `"0.2.15"` | Image tag | +| labels | object | `{}` | Additional labels to be added to resources | +| metricsBindAddress | string | `"127.0.0.1"` | | +| metricsPort | string | `"6000"` | | +| nodeSelector | object | `{}` | Operator pod node selector can be set | +| rbac.create | bool | `true` | Install RBAC roles and bindings. | +| resources | object | `{}` | Specifies resource requirements for the container | +| securityContext | object | `{}` | | +| serviceAccount.create | bool | `true` | Create service account | +| serviceAccount.name | string | `"zookeeper-operator"` | Name for the service account | +| tolerations | list | `[]` | Operator pod tolerations can be set | +| watchNamespace | string | `""` | List of namespaces where Operator watches for custom resources. | diff --git a/charts/zookeeper-operator/README.md.gotmpl b/charts/zookeeper-operator/README.md.gotmpl new file mode 100644 index 000000000..f1646d30a --- /dev/null +++ b/charts/zookeeper-operator/README.md.gotmpl @@ -0,0 +1,46 @@ +# Zookeeper Operator Helm Chart + +Installs [Zookeeper Operator](https://github.com/pravega/zookeeper-operator) to create/configure/manage Zookeeper clusters atop Kubernetes. + +## Introduction + +This chart bootstraps a [Zookeeper Operator](https://github.com/pravega/zookeeper-operator) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + - Kubernetes 1.15+ with Beta APIs + - Helm 3.2.1+ + +## Installing the Chart + +To install the zookeeper-operator chart, use the following command: + +```bash +# Install latest version +$ helm install [RELEASE_NAME] oci://ghcr.io/adobe/helm-charts/zookeeper-operator + +# Or install a specific version +$ helm install [RELEASE_NAME] oci://ghcr.io/adobe/helm-charts/zookeeper-operator --version=[VERSION] +``` + +> **Note:** You can view all available versions at [adobe/helm-charts/zookeeper-operator](https://github.com/adobe/zookeeper-operator/pkgs/container/helm-charts%2Fzookeeper-operator/versions?filters%5Bversion_type%5D=tagged) +- **[RELEASE_NAME]** is the release name for the zookeeper-operator chart. +- **[DEPLOYMENT_NAME]** is the name of the zookeeper-operator deployment so created. (If [RELEASE_NAME] contains the string `zookeeper-operator`, `[DEPLOYMENT_NAME] = [RELEASE_NAME]`, else `[DEPLOYMENT_NAME] = [RELEASE_NAME]-zookeeper-operator`. The [DEPLOYMENT_NAME] can however be overridden by providing `--set fullnameOverride=[DEPLOYMENT_NAME]` along with the helm install command) +- **[VERSION]** can be any stable release version for zookeeper-operator from 0.2.8 onwards. + +This command deploys a zookeeper-operator on the Kubernetes cluster in its default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +## Uninstalling the Chart + +To uninstall/delete the zookeeper-operator chart, use the following command: + +``` +$ helm uninstall [RELEASE_NAME] +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the zookeeper-operator chart and their default values. + +{{ template "chart.valuesSection" . }} diff --git a/charts/zookeeper-operator/templates/_helpers.tpl b/charts/zookeeper-operator/templates/_helpers.tpl index 43aa2e3c9..4df8a6b65 100644 --- a/charts/zookeeper-operator/templates/_helpers.tpl +++ b/charts/zookeeper-operator/templates/_helpers.tpl @@ -43,12 +43,16 @@ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" Default sidecar template */}} {{- define "chart.additionalSidecars"}} -{{ toYaml .Values.additionalSidecars }} -{{- end}} +{{ with .Values.additionalSidecars }} + {{- toYaml . -}} +{{- end }} +{{- end }} {{/* Default volume template */}} {{- define "chart.additionalVolumes"}} -{{ toYaml .Values.additionalVolumes }} +{{ with .Values.additionalVolumes }} + {{- toYaml . -}} +{{- end }} {{- end}} diff --git a/charts/zookeeper-operator/templates/operator.yaml b/charts/zookeeper-operator/templates/operator.yaml index eeeaeb536..b312ae3ae 100644 --- a/charts/zookeeper-operator/templates/operator.yaml +++ b/charts/zookeeper-operator/templates/operator.yaml @@ -24,10 +24,8 @@ spec: {{- end }} spec: serviceAccountName: {{ .Values.serviceAccount.name }} - {{- if .Values.additionalVolumes }} volumes: -{{- include "chart.additionalVolumes" . | indent 6 }} - {{- end }} + {{- include "chart.additionalVolumes" . | indent 6 }} containers: - name: {{ template "zookeeper-operator.fullname" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -58,9 +56,7 @@ spec: resources: {{ toYaml .Values.resources | indent 10 }} {{- end }} - {{- if .Values.additionalSidecars }} -{{- include "chart.additionalSidecars" . | indent 6 }} - {{- end }} + {{- include "chart.additionalSidecars" . | indent 6 }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/charts/zookeeper-operator/values.schema.json b/charts/zookeeper-operator/values.schema.json new file mode 100644 index 000000000..6990cf456 --- /dev/null +++ b/charts/zookeeper-operator/values.schema.json @@ -0,0 +1,97 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "additionalEnv": { + "type": "array" + }, + "additionalSidecars": { + "type": "array" + }, + "additionalVolumes": { + "type": "array" + }, + "affinity": { + "type": "object" + }, + "annotations": { + "type": "object" + }, + "crd": { + "type": "object", + "properties": { + "create": { + "type": "boolean" + } + } + }, + "disableFinalizer": { + "type": "boolean" + }, + "global": { + "type": "object", + "properties": { + "imagePullSecrets": { + "type": "array" + } + } + }, + "image": { + "type": "object", + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "labels": { + "type": "object" + }, + "metricsBindAddress": { + "type": "string" + }, + "metricsPort": { + "type": "string" + }, + "nodeSelector": { + "type": "object" + }, + "rbac": { + "type": "object", + "properties": { + "create": { + "type": "boolean" + } + } + }, + "resources": { + "type": "object" + }, + "securityContext": { + "type": "object" + }, + "serviceAccount": { + "type": "object", + "properties": { + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + } + } + }, + "tolerations": { + "type": "array" + }, + "watchNamespace": { + "type": "string" + } + } +} diff --git a/charts/zookeeper-operator/values.yaml b/charts/zookeeper-operator/values.yaml index 8c4564d81..ad675186a 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -3,43 +3,49 @@ ## Declare variables to be passed into your templates. global: - # Lists the secrets you need to use to pull zookeeper-operator image from a private registry. + # -- Lists the secrets you need to use to pull zookeeper-operator image from a private registry. imagePullSecrets: [] # - private-registry-key image: + # -- Image tag tag: 0.2.15 + # -- Image repository repository: ghcr.io/adobe/zookeeper-operator + # -- Image pull policy pullPolicy: IfNotPresent securityContext: {} # runAsUser: 1001 # runAsGroup: 1001 -## Additional labels to be added to resources +# -- Additional labels to be added to resources labels: {} -## Install RBAC roles and bindings. rbac: + # -- Install RBAC roles and bindings. create: true -## Service account name and whether to create it. + serviceAccount: + # -- Create service account create: true + # -- Name for the service account name: zookeeper-operator ## Optionally specify an array of imagePullSecrets. Will override the global parameter if set # imagePullSecrets: -## Whether to create the CRD. crd: + # -- Create zookeeper CRD create: true ## Specifies which namespace(s) the Operator should watch over. ## Default: An empty string means all namespaces. ## Multiple namespaces can be configured using a comma separated list of namespaces +# -- List of namespaces where Operator watches for custom resources. watchNamespace: "" -## Operator pod resources +# -- Specifies resource requirements for the container resources: {} # limits: # cpu: 2 @@ -48,29 +54,34 @@ resources: {} # cpu: 1 # memory: 128Mi -# Scheduling constraints +# -- Operator pod node selector can be set nodeSelector: {} -affinity: {} + +# -- Operator pod tolerations can be set tolerations: [] -# Pod annotations +# -- Operator pod affinity can be set +affinity: {} + +# -- Pod annotations annotations: {} -## Additional Sidecars Configuration. -additionalSidecars: {} +# -- Additional Sidecars Configuration +additionalSidecars: [] # - name: nginx # image: nginx:latest -## Additional Environment Variables. -additionalEnv: {} +# -- Additional Environment Variables +additionalEnv: [] -## Additional volumes required for sidecars. -additionalVolumes: {} +# -- Additional volumes required for sidecars +additionalVolumes: [] # - name: volume1 # emptyDir: {} # - name: volume2 # emptyDir: {} +# -- Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped disableFinalizer: false ## In order to enable gathering metrics by Prometheus etc... bind to 0.0.0.0 From c2974419f7eda99396011683846c71fd1734a009 Mon Sep 17 00:00:00 2001 From: Adrian Coman <1664229+azun@users.noreply.github.com> Date: Wed, 26 Aug 2026 16:04:57 +0300 Subject: [PATCH 2/2] Added helm chart schema check --- .github/workflows/ci.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b044b073..92ff1e95c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,14 @@ jobs: run: | sudo ln -sf `which go` `sudo which go` || true sudo go version - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + + - name: Check values schema json + uses: losisin/helm-values-schema-json-action@v3 + with: + values: values.yaml + working-directory: charts/zookeeper-operator + fail-on-diff: true - name: get go version run: go version - name: Gofmt and License checks