Skip to content

Commit d7e4043

Browse files
committed
Added schema and docs template for operator chart.
1 parent b9b274c commit d7e4043

6 files changed

Lines changed: 204 additions & 49 deletions

File tree

‎charts/zookeeper-operator/README.md‎

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,29 @@ The command removes all the Kubernetes components associated with the chart and
4343

4444
The following table lists the configurable parameters of the zookeeper-operator chart and their default values.
4545

46-
| Parameter | Description | Default |
47-
| ----- | ----------- | ------ |
48-
| `additionalEnv` | Additional Environment Variables | `[]` |
49-
| `additionalSidecars` | Additional Sidecars Configuration | `[]` |
50-
| `additionalVolumes` | Additional volumes required for sidecars | `[]` |
51-
| `affinity` | Specifies scheduling constraints on pods | `{}` |
52-
| `annotations` | Operator pod annotations | `{}` |
53-
| `crd.create` | Create zookeeper CRD | `true` |
54-
| `disableFinalizer` | Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped.| `false` |
55-
| `global.imagePullSecrets` | Lists of secrets to use to pull zookeeper-operator image from a private registry | `[]` |
56-
| `hooks.backoffLimit` | backoffLimit for batch jobs | `10` |
57-
| `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` |
58-
| `hooks.image.repository` | Image repository for batch jobs | `"lachlanevenson/k8s-kubectl"` |
59-
| `hooks.image.tag` | Image tag for batch jobs | `"v1.16.10"` |
60-
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
61-
| `image.repository` | Image repository | `pravega/zookeeper-operator` |
62-
| `image.tag` | Image tag | `0.2.15` |
63-
| `labels` | Operator pod labels | `{}` |
64-
| `nodeSelector` | Map of key-value pairs to be present as labels in the node in which the pod should run | `{}` |
65-
| `rbac.create` | Create RBAC resources | `true` |
66-
| `resources` | Specifies resource requirements for the container | `{}` |
67-
| `serviceAccount.create` | Create service account | `true` |
68-
| `serviceAccount.name` | Name for the service account | `zookeeper-operator` |
69-
| `tolerations` | Specifies the pod's tolerations | `[]` |
70-
| `watchNamespace` | Namespaces to be watched | `""` |
46+
## Values
47+
48+
| Key | Type | Default | Description |
49+
|-----|------|---------|-------------|
50+
| additionalEnv | list | `[]` | Additional Environment Variables |
51+
| additionalSidecars | list | `[]` | Additional Sidecars Configuration |
52+
| additionalVolumes | list | `[]` | Additional volumes required for sidecars |
53+
| affinity | object | `{}` | Operator pod affinity can be set |
54+
| annotations | object | `{}` | Pod annotations |
55+
| crd.create | bool | `true` | Create zookeeper CRD |
56+
| disableFinalizer | bool | `false` | Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped |
57+
| global.imagePullSecrets | list | `[]` | Lists the secrets you need to use to pull zookeeper-operator image from a private registry. |
58+
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
59+
| image.repository | string | `"ghcr.io/adobe/zookeeper-operator"` | Image repository |
60+
| image.tag | string | `"0.2.15"` | Image tag |
61+
| labels | object | `{}` | Additional labels to be added to resources |
62+
| metricsBindAddress | string | `"127.0.0.1"` | |
63+
| metricsPort | string | `"6000"` | |
64+
| nodeSelector | object | `{}` | Operator pod node selector can be set |
65+
| rbac.create | bool | `true` | Install RBAC roles and bindings. |
66+
| resources | object | `{}` | Specifies resource requirements for the container |
67+
| securityContext | object | `{}` | |
68+
| serviceAccount.create | bool | `true` | Create service account |
69+
| serviceAccount.name | string | `"zookeeper-operator"` | Name for the service account |
70+
| tolerations | list | `[]` | Operator pod tolerations can be set |
71+
| watchNamespace | string | `""` | List of namespaces where Operator watches for custom resources. |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Zookeeper Operator Helm Chart
2+
3+
Installs [Zookeeper Operator](https://github.com/pravega/zookeeper-operator) to create/configure/manage Zookeeper clusters atop Kubernetes.
4+
5+
## Introduction
6+
7+
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.
8+
9+
## Prerequisites
10+
- Kubernetes 1.15+ with Beta APIs
11+
- Helm 3.2.1+
12+
13+
## Installing the Chart
14+
15+
To install the zookeeper-operator chart, use the following command:
16+
17+
```bash
18+
# Install latest version
19+
$ helm install [RELEASE_NAME] oci://ghcr.io/adobe/helm-charts/zookeeper-operator
20+
21+
# Or install a specific version
22+
$ helm install [RELEASE_NAME] oci://ghcr.io/adobe/helm-charts/zookeeper-operator --version=[VERSION]
23+
```
24+
25+
> **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)
26+
- **[RELEASE_NAME]** is the release name for the zookeeper-operator chart.
27+
- **[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)
28+
- **[VERSION]** can be any stable release version for zookeeper-operator from 0.2.8 onwards.
29+
30+
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.
31+
32+
## Uninstalling the Chart
33+
34+
To uninstall/delete the zookeeper-operator chart, use the following command:
35+
36+
```
37+
$ helm uninstall [RELEASE_NAME]
38+
```
39+
40+
The command removes all the Kubernetes components associated with the chart and deletes the release.
41+
42+
## Configuration
43+
44+
The following table lists the configurable parameters of the zookeeper-operator chart and their default values.
45+
46+
{{ template "chart.valuesSection" . }}

‎charts/zookeeper-operator/templates/_helpers.tpl‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
4343
Default sidecar template
4444
*/}}
4545
{{- define "chart.additionalSidecars"}}
46-
{{ toYaml .Values.additionalSidecars }}
47-
{{- end}}
46+
{{ with .Values.additionalSidecars }}
47+
{{- toYaml . -}}
48+
{{- end }}
49+
{{- end }}
4850

4951
{{/*
5052
Default volume template
5153
*/}}
5254
{{- define "chart.additionalVolumes"}}
53-
{{ toYaml .Values.additionalVolumes }}
55+
{{ with .Values.additionalVolumes }}
56+
{{- toYaml . -}}
57+
{{- end }}
5458
{{- end}}

‎charts/zookeeper-operator/templates/operator.yaml‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ spec:
2424
{{- end }}
2525
spec:
2626
serviceAccountName: {{ .Values.serviceAccount.name }}
27-
{{- if .Values.additionalVolumes }}
2827
volumes:
29-
{{- include "chart.additionalVolumes" . | indent 6 }}
30-
{{- end }}
28+
{{- include "chart.additionalVolumes" . | indent 6 }}
3129
containers:
3230
- name: {{ template "zookeeper-operator.fullname" . }}
3331
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
@@ -58,9 +56,7 @@ spec:
5856
resources:
5957
{{ toYaml .Values.resources | indent 10 }}
6058
{{- end }}
61-
{{- if .Values.additionalSidecars }}
62-
{{- include "chart.additionalSidecars" . | indent 6 }}
63-
{{- end }}
59+
{{- include "chart.additionalSidecars" . | indent 6 }}
6460
{{- if .Values.nodeSelector }}
6561
nodeSelector:
6662
{{ toYaml .Values.nodeSelector | indent 8 }}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"additionalEnv": {
6+
"type": "array"
7+
},
8+
"additionalSidecars": {
9+
"type": "array"
10+
},
11+
"additionalVolumes": {
12+
"type": "array"
13+
},
14+
"affinity": {
15+
"type": "object"
16+
},
17+
"annotations": {
18+
"type": "object"
19+
},
20+
"crd": {
21+
"type": "object",
22+
"properties": {
23+
"create": {
24+
"type": "boolean"
25+
}
26+
}
27+
},
28+
"disableFinalizer": {
29+
"type": "boolean"
30+
},
31+
"global": {
32+
"type": "object",
33+
"properties": {
34+
"imagePullSecrets": {
35+
"type": "array"
36+
}
37+
}
38+
},
39+
"image": {
40+
"type": "object",
41+
"properties": {
42+
"pullPolicy": {
43+
"type": "string"
44+
},
45+
"repository": {
46+
"type": "string"
47+
},
48+
"tag": {
49+
"type": "string"
50+
}
51+
}
52+
},
53+
"labels": {
54+
"type": "object"
55+
},
56+
"metricsBindAddress": {
57+
"type": "string"
58+
},
59+
"metricsPort": {
60+
"type": "string"
61+
},
62+
"nodeSelector": {
63+
"type": "object"
64+
},
65+
"rbac": {
66+
"type": "object",
67+
"properties": {
68+
"create": {
69+
"type": "boolean"
70+
}
71+
}
72+
},
73+
"resources": {
74+
"type": "object"
75+
},
76+
"securityContext": {
77+
"type": "object"
78+
},
79+
"serviceAccount": {
80+
"type": "object",
81+
"properties": {
82+
"create": {
83+
"type": "boolean"
84+
},
85+
"name": {
86+
"type": "string"
87+
}
88+
}
89+
},
90+
"tolerations": {
91+
"type": "array"
92+
},
93+
"watchNamespace": {
94+
"type": "string"
95+
}
96+
}
97+
}

‎charts/zookeeper-operator/values.yaml‎

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,49 @@
33
## Declare variables to be passed into your templates.
44

55
global:
6-
# Lists the secrets you need to use to pull zookeeper-operator image from a private registry.
6+
# -- Lists the secrets you need to use to pull zookeeper-operator image from a private registry.
77
imagePullSecrets: []
88
# - private-registry-key
99

1010
image:
11+
# -- Image tag
1112
tag: 0.2.15
13+
# -- Image repository
1214
repository: ghcr.io/adobe/zookeeper-operator
15+
# -- Image pull policy
1316
pullPolicy: IfNotPresent
1417

1518
securityContext: {}
1619
# runAsUser: 1001
1720
# runAsGroup: 1001
1821

19-
## Additional labels to be added to resources
22+
# -- Additional labels to be added to resources
2023
labels: {}
2124

22-
## Install RBAC roles and bindings.
2325
rbac:
26+
# -- Install RBAC roles and bindings.
2427
create: true
2528

26-
## Service account name and whether to create it.
29+
2730
serviceAccount:
31+
# -- Create service account
2832
create: true
33+
# -- Name for the service account
2934
name: zookeeper-operator
3035
## Optionally specify an array of imagePullSecrets. Will override the global parameter if set
3136
# imagePullSecrets:
3237

33-
## Whether to create the CRD.
3438
crd:
39+
# -- Create zookeeper CRD
3540
create: true
3641

3742
## Specifies which namespace(s) the Operator should watch over.
3843
## Default: An empty string means all namespaces.
3944
## Multiple namespaces can be configured using a comma separated list of namespaces
45+
# -- List of namespaces where Operator watches for custom resources.
4046
watchNamespace: ""
4147

42-
## Operator pod resources
48+
# -- Specifies resource requirements for the container
4349
resources: {}
4450
# limits:
4551
# cpu: 2
@@ -48,29 +54,34 @@ resources: {}
4854
# cpu: 1
4955
# memory: 128Mi
5056

51-
# Scheduling constraints
57+
# -- Operator pod node selector can be set
5258
nodeSelector: {}
53-
affinity: {}
59+
60+
# -- Operator pod tolerations can be set
5461
tolerations: []
5562

56-
# Pod annotations
63+
# -- Operator pod affinity can be set
64+
affinity: {}
65+
66+
# -- Pod annotations
5767
annotations: {}
5868

59-
## Additional Sidecars Configuration.
60-
additionalSidecars: {}
69+
# -- Additional Sidecars Configuration
70+
additionalSidecars: []
6171
# - name: nginx
6272
# image: nginx:latest
6373

64-
## Additional Environment Variables.
65-
additionalEnv: {}
74+
# -- Additional Environment Variables
75+
additionalEnv: []
6676

67-
## Additional volumes required for sidecars.
68-
additionalVolumes: {}
77+
# -- Additional volumes required for sidecars
78+
additionalVolumes: []
6979
# - name: volume1
7080
# emptyDir: {}
7181
# - name: volume2
7282
# emptyDir: {}
7383

84+
# -- Disable finalizer for zookeeper clusters, PVCs clean-up will be skipped
7485
disableFinalizer: false
7586

7687
## In order to enable gathering metrics by Prometheus etc... bind to 0.0.0.0

0 commit comments

Comments
 (0)