From f29da68baa19c6d26d2bc7d3f84a500f04801906 Mon Sep 17 00:00:00 2001 From: SrishT Date: Tue, 22 Sep 2020 20:49:30 +0530 Subject: [PATCH 1/6] Adding checks to helm charts Signed-off-by: SrishT --- .../templates/operator.yaml | 8 ++--- charts/zookeeper/README.md | 4 +-- charts/zookeeper/templates/zookeeper.yaml | 34 +++++++++++++++++++ charts/zookeeper/values.yaml | 6 ++-- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/charts/zookeeper-operator/templates/operator.yaml b/charts/zookeeper-operator/templates/operator.yaml index 53e82e9ee..cb2218eb9 100644 --- a/charts/zookeeper-operator/templates/operator.yaml +++ b/charts/zookeeper-operator/templates/operator.yaml @@ -37,17 +37,17 @@ spec: value: {{ template "zookeeper-operator.fullname" . }} {{- if .Values.resources }} resources: - {{ toYaml .Values.resources | nindent 10 }} +{{ toYaml .Values.resources | indent 10 }} {{- end }} {{- if .Values.nodeSelector }} nodeSelector: - {{ toYaml .Values.nodeSelector | nindent 8 }} +{{ toYaml .Values.nodeSelector | indent 8 }} {{- end }} {{- if .Values.affinity }} affinity: - {{ toYaml .Values.affinity | nindent 8 }} +{{ toYaml .Values.affinity | indent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: - {{ toYaml .Values.tolerations | nindent 8 }} +{{ toYaml .Values.tolerations | indent 8 }} {{- end }} diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index 02280fd18..d00ee886e 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -66,7 +66,7 @@ The following table lists the configurable parameters of the Zookeeper chart and | `pod.tolerations` | Specifies the pod's tolerations | `[]` | | `pod.env` | List of environment variables to set in the container | `[]` | | `pod.annotations` | Specifies the annotations to attach to pods | `{}` | -| `pod.securityContext` | Specifies the security context for the entire pod | | +| `pod.securityContext` | Specifies the security context for the entire pod | `{}` | | `pod.terminationGracePeriodSeconds` | Amount of time given to the pod to shutdown normally | `180` | | `config.initLimit` | Amount of time (in ticks) to allow followers to connect and sync to a leader | `10` | | `config.tickTime` | Length of a single tick which is the basic time unit used by Zookeeper (measured in milliseconds) | `2000` | @@ -77,6 +77,6 @@ The following table lists the configurable parameters of the Zookeeper chart and | `persistence.storageClassName` | Storage class for persistent volumes | `standard` | | `persistence.volumeSize` | Size of the volume requested for persistent volumes | `20Gi` | | `ephemeral.emptydirvolumesource.medium` | What type of storage medium should back the directory. | `""` | -| `ephemeral.emptydirvolumesource.sizeLimit` | Total amount of local storage required for the EmptyDir volume. | | +| `ephemeral.emptydirvolumesource.sizeLimit` | Total amount of local storage required for the EmptyDir volume. | `20Gi` | | `containers` | Application containers run with the zookeeper pod | `[]` | | `volumes` | Named volumes that may be accessed by any container in the pod | `[]` | diff --git a/charts/zookeeper/templates/zookeeper.yaml b/charts/zookeeper/templates/zookeeper.yaml index b4ba67766..fd359fbb9 100644 --- a/charts/zookeeper/templates/zookeeper.yaml +++ b/charts/zookeeper/templates/zookeeper.yaml @@ -15,36 +15,70 @@ spec: domainName: {{ .Values.domainName }} {{- end }} kubernetesClusterDomain: {{ default "cluster.local" .Values.kubernetesClusterDomain }} + {{- if .Values.containers }} + containers: +{{ toYaml .Values.containers | indent 4 }} + {{- end }} + {{- if .Values.volumes }} + volumes: +{{ toYaml .Values.volumes | indent 4 }} + {{- end }} labels: {{ toYaml .Values.labels | indent 4 }} ports: {{ toYaml .Values.ports | indent 4 }} {{- if .Values.pod }} pod: + {{- if .Values.pod.labels }} labels: {{ toYaml .Values.pod.labels | indent 6 }} + {{- end }} + {{- if .Values.pod.nodeSelector }} nodeSelector: {{ toYaml .Values.pod.nodeSelector | indent 6 }} + {{- end }} + {{- if .Values.pod.affinity }} affinity: {{ toYaml .Values.pod.affinity | indent 6 }} + {{- end }} + {{- if .Values.pod.resources }} resources: {{ toYaml .Values.pod.resources | indent 6 }} + {{- end }} + {{- if .Values.pod.tolerations }} tolerations: {{ toYaml .Values.pod.tolerations | indent 6 }} + {{- end }} + {{- if .Values.pod.env }} env: {{ toYaml .Values.pod.env | indent 6 }} + {{- end }} + {{- if .Values.pod.annotations }} annotations: {{ toYaml .Values.pod.annotations | indent 6 }} + {{- end }} + {{- if .Values.pod.securityContext }} securityContext: {{ toYaml .Values.pod.securityContext | indent 6 }} + {{- end }} + {{- if .Values.pod.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.pod.terminationGracePeriodSeconds }} + {{- end }} {{- end }} {{- if .Values.config }} config: + {{- if .Values.config.initLimit }} initLimit: {{ .Values.config.initLimit }} + {{- end }} + {{- if .Values.config.tickTime }} tickTime: {{ .Values.config.tickTime }} + {{- end }} + {{- if .Values.config.syncLimit }} syncLimit: {{ .Values.config.syncLimit }} + {{- end }} + {{- if .Values.config.quorumListenOnAllIPs }} quorumListenOnAllIPs: {{ .Values.config.quorumListenOnAllIPs }} + {{- end }} {{- end }} storageType: {{ default "persistence" .Values.storageType }} {{- if eq (default .Values.storageType "persistence") "ephemeral" }} diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index 96def289a..278237599 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -18,7 +18,7 @@ pod: {} # tolerations: [] # env: [] # annotations: {} - # securityContext: + # securityContext: {} # terminationGracePeriodSeconds: 180 config: {} @@ -43,8 +43,8 @@ ephemeral: emptydirvolumesource: ## specifying Medium for emptydirvolumesource ## accepted values - ""/Memory - #medium: "" - #sizeLimit: 20Gi + medium: "" + sizeLimit: 20Gi hooks: image: From 49a223934a26e1c9222b4569e4d309310d197207 Mon Sep 17 00:00:00 2001 From: SrishT Date: Wed, 23 Sep 2020 03:45:05 +0530 Subject: [PATCH 2/6] Documentation update Signed-off-by: SrishT --- charts/zookeeper-operator/README.md | 16 +++++++++------- charts/zookeeper/README.md | 26 ++++++++++++++------------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index 8500d9c81..f067c3e99 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -12,30 +12,32 @@ This chart bootstraps a [Zookeeper Operator](https://github.com/pravega/zookeepe ## Installing the Chart -To install the chart with the release name `my-release`: +To install the zookeeper-operator chart, use the following commands: ``` $ helm repo add pravega https://charts.pravega.io $ helm repo update -$ helm install my-release pravega/zookeeper-operator --version=`version` +$ helm install [RELEASE_NAME] pravega/zookeeper-operator --version=[VERSION] ``` -Note: `version` can be any stable release version for zookeeper operator from 0.2.8 onwards. +where: +- **[RELEASE_NAME]** is the release name for the zookeeper-operator chart. (**[RESOURCE_NAME]** is the name of the zookeeper-operator resource so created. If [RELEASE_NAME] contains the string `zookeeper-operator`, `[RESOURCE_NAME] = [RELEASE_NAME]`, else `[RESOURCE_NAME] = [RELEASE_NAME]-zookeeper-operator`. The [RESOURCE_NAME] can however be overridden by providing `--set fullnameOverride=[RESOURCE_NAME]` along with the helm install command) +- **[VERSION]** can be any stable release version for zookeeper-operator from 0.2.8 onwards. -The above command deploys zookeeper-operator on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. +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 deployment `my-release`: +To uninstall/delete the zookeeper-operator chart, use the following command: ``` -$ helm uninstall my-release +$ 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. +The following table lists the configurable parameters of the zookeeper-operator chart and their default values. | Parameter | Description | Default | | ----- | ----------- | ------ | diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index d00ee886e..b9b5a6a3c 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -14,39 +14,41 @@ This chart creates a Zookeeper cluster in [Kubernetes](http://kubernetes.io) usi ## Installing the Chart -To install the chart with the release name `my-release`: +To install the zookeeper chart, use the following commands: ``` $ helm repo add pravega https://charts.pravega.io $ helm repo update -$ helm install my-release pravega/zookeeper --version=`version` +$ helm install [RELEASE_NAME] pravega/zookeeper --version=[VERSION] ``` -Note: `version` can be any stable release version for zookeeper from 0.2.8 onwards. +where: +- **[RELEASE_NAME]** is the release name for the zookeeper chart. (**[CLUSTER_NAME]** is the name of the zookeeper cluster so created. If [RELEASE_NAME] contains the string `zookeeper`, `[CLUSTER_NAME] = [RELEASE_NAME]`, else `[CLUSTER_NAME] = [RELEASE_NAME]-zookeeper`. The [CLUSTER_NAME] can however be overridden by providing `--set fullnameOverride=[CLUSTER_NAME]` along with the helm install command) +- **[VERSION]** can be any stable release version for zookeeper from 0.2.8 onwards. -The above command deploys zookeeper on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. +This command deploys zookeeper on the Kubernetes cluster in its default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. ## Upgrading the Chart -To upgrade the zookeeper cluster `my-release` from a version `x` to `y`: +To upgrade the zookeeper chart from version **[OLD_VERSION]** to version **[NEW_VERSION]**, use the following command: ``` -$ helm upgrade my-release pravega/zookeeper --version=y --set image.tag=y --reuse-values --timeout 600s +$ helm upgrade [RELEASE_NAME] pravega/zookeeper --version=[NEW_VERSION] --set image.tag=[NEW_VERSION] --reuse-values --timeout 600s ``` -Note: By specifying the `--reuse-values` option, the values of all parameters are retained across upgrades. However if some values need to be modified during the upgrade, the `--set` flag can be used to specify the new values of these parameters. Also, by skipping the `reuse-values` flag, the values of all parameters are reset to their default values specified in the charts published for version `y`. +Note: By specifying the `--reuse-values` option, the configuration of all parameters are retained across upgrades. However if some values need to be modified during the upgrade, the `--set` flag can be used to specify the new configuration for these parameters. Also, by skipping the `reuse-values` flag, the values of all parameters are reset to the default configuration that has been specified in the published charts for version [NEW_VERSION]. ## Uninstalling the Chart -To uninstall/delete the zookeeper cluster `my-release`: +To uninstall/delete the zookeeper chart, use the following command: ``` -$ helm uninstall my-release +$ helm uninstall [RELEASE_NAME] ``` -The command removes all the Kubernetes components associated with the chart and deletes the release. +This 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 chart and their default values. +The following table lists the configurable parameters of the zookeeper chart and their default values. | Parameter | Description | Default | | ----- | ----------- | ------ | @@ -67,7 +69,7 @@ The following table lists the configurable parameters of the Zookeeper chart and | `pod.env` | List of environment variables to set in the container | `[]` | | `pod.annotations` | Specifies the annotations to attach to pods | `{}` | | `pod.securityContext` | Specifies the security context for the entire pod | `{}` | -| `pod.terminationGracePeriodSeconds` | Amount of time given to the pod to shutdown normally | `180` | +| `pod.terminationGracePeriodSeconds` | Amount of time given to the pod to shutdown normally | `30` | | `config.initLimit` | Amount of time (in ticks) to allow followers to connect and sync to a leader | `10` | | `config.tickTime` | Length of a single tick which is the basic time unit used by Zookeeper (measured in milliseconds) | `2000` | | `config.syncLimit` | Amount of time (in ticks) to allow followers to sync with Zookeeper | `2` | From 472b800607c63f165d1143d7053b508573531a06 Mon Sep 17 00:00:00 2001 From: SrishT Date: Wed, 23 Sep 2020 03:51:29 +0530 Subject: [PATCH 3/6] Updating charts Signed-off-by: SrishT --- charts/zookeeper/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index 278237599..2254850d9 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -19,7 +19,7 @@ pod: {} # env: [] # annotations: {} # securityContext: {} - # terminationGracePeriodSeconds: 180 + # terminationGracePeriodSeconds: 30 config: {} # initLimit: 10 From 8131a1dd6b6b5f4ceb90ae7a4860736fbbb8f2a0 Mon Sep 17 00:00:00 2001 From: SrishT Date: Wed, 23 Sep 2020 05:17:30 +0530 Subject: [PATCH 4/6] Documentation update Signed-off-by: SrishT --- charts/zookeeper-operator/README.md | 3 ++- charts/zookeeper/README.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index f067c3e99..bdf91d68d 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -20,7 +20,8 @@ $ helm repo update $ helm install [RELEASE_NAME] pravega/zookeeper-operator --version=[VERSION] ``` where: -- **[RELEASE_NAME]** is the release name for the zookeeper-operator chart. (**[RESOURCE_NAME]** is the name of the zookeeper-operator resource so created. If [RELEASE_NAME] contains the string `zookeeper-operator`, `[RESOURCE_NAME] = [RELEASE_NAME]`, else `[RESOURCE_NAME] = [RELEASE_NAME]-zookeeper-operator`. The [RESOURCE_NAME] can however be overridden by providing `--set fullnameOverride=[RESOURCE_NAME]` along with the helm install command) +- **[RELEASE_NAME]** is the release name for the zookeeper-operator chart. +- **[RESOURCE_NAME]** is the name of the zookeeper-operator resource so created. (If [RELEASE_NAME] contains the string `zookeeper-operator`, `[RESOURCE_NAME] = [RELEASE_NAME]`, else `[RESOURCE_NAME] = [RELEASE_NAME]-zookeeper-operator`. The [RESOURCE_NAME] can however be overridden by providing `--set fullnameOverride=[RESOURCE_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. diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index b9b5a6a3c..9f362f847 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -22,7 +22,8 @@ $ helm repo update $ helm install [RELEASE_NAME] pravega/zookeeper --version=[VERSION] ``` where: -- **[RELEASE_NAME]** is the release name for the zookeeper chart. (**[CLUSTER_NAME]** is the name of the zookeeper cluster so created. If [RELEASE_NAME] contains the string `zookeeper`, `[CLUSTER_NAME] = [RELEASE_NAME]`, else `[CLUSTER_NAME] = [RELEASE_NAME]-zookeeper`. The [CLUSTER_NAME] can however be overridden by providing `--set fullnameOverride=[CLUSTER_NAME]` along with the helm install command) +- **[RELEASE_NAME]** is the release name for the zookeeper chart. +- **[CLUSTER_NAME]** is the name of the zookeeper cluster so created. (If [RELEASE_NAME] contains the string `zookeeper`, `[CLUSTER_NAME] = [RELEASE_NAME]`, else `[CLUSTER_NAME] = [RELEASE_NAME]-zookeeper`. The [CLUSTER_NAME] can however be overridden by providing `--set fullnameOverride=[CLUSTER_NAME]` along with the helm install command) - **[VERSION]** can be any stable release version for zookeeper from 0.2.8 onwards. This command deploys zookeeper on the Kubernetes cluster in its default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. From 22aec9bc6ecf4d5dc354c1afaf53cf0dc52138b7 Mon Sep 17 00:00:00 2001 From: SrishT Date: Wed, 23 Sep 2020 05:25:46 +0530 Subject: [PATCH 5/6] Documentation update Signed-off-by: SrishT --- README.md | 2 +- charts/zookeeper/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8556002d3..486f2781a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The operator itself is built with the [Operator framework](https://github.com/op ## Usage -We recommend using our [helm charts](charts) for all installation and upgrades. Since version 0.2.8 onwards, the helm charts for zookeeper operator and zookeeper cluster are published in [https://charts.pravega.io/](https://charts.pravega.io/). To add this repository to your Helm repos, use the following command +We recommend using our [helm charts](charts) for all installation and upgrades. Since version 0.2.8 onwards, the helm charts for zookeeper operator and zookeeper cluster are published in [https://charts.pravega.io](https://charts.pravega.io/). To add this repository to your Helm repos, use the following command ``` helm repo add pravega https://charts.pravega.io ``` diff --git a/charts/zookeeper/README.md b/charts/zookeeper/README.md index 9f362f847..31cb3b0cb 100644 --- a/charts/zookeeper/README.md +++ b/charts/zookeeper/README.md @@ -35,7 +35,7 @@ To upgrade the zookeeper chart from version **[OLD_VERSION]** to version **[NEW_ ``` $ helm upgrade [RELEASE_NAME] pravega/zookeeper --version=[NEW_VERSION] --set image.tag=[NEW_VERSION] --reuse-values --timeout 600s ``` -Note: By specifying the `--reuse-values` option, the configuration of all parameters are retained across upgrades. However if some values need to be modified during the upgrade, the `--set` flag can be used to specify the new configuration for these parameters. Also, by skipping the `reuse-values` flag, the values of all parameters are reset to the default configuration that has been specified in the published charts for version [NEW_VERSION]. +**Note:** By specifying the `--reuse-values` option, the configuration of all parameters are retained across upgrades. However if some values need to be modified during the upgrade, the `--set` flag can be used to specify the new configuration for these parameters. Also, by skipping the `reuse-values` flag, the values of all parameters are reset to the default configuration that has been specified in the published charts for version [NEW_VERSION]. ## Uninstalling the Chart From 6cc6ffbe15e9d7dec747bd97ef645b2072f9dc11 Mon Sep 17 00:00:00 2001 From: SrishT Date: Wed, 23 Sep 2020 06:15:44 +0530 Subject: [PATCH 6/6] Documentation update Signed-off-by: SrishT --- charts/zookeeper-operator/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/zookeeper-operator/README.md b/charts/zookeeper-operator/README.md index bdf91d68d..503efcaa0 100644 --- a/charts/zookeeper-operator/README.md +++ b/charts/zookeeper-operator/README.md @@ -19,9 +19,8 @@ $ helm repo add pravega https://charts.pravega.io $ helm repo update $ helm install [RELEASE_NAME] pravega/zookeeper-operator --version=[VERSION] ``` -where: - **[RELEASE_NAME]** is the release name for the zookeeper-operator chart. -- **[RESOURCE_NAME]** is the name of the zookeeper-operator resource so created. (If [RELEASE_NAME] contains the string `zookeeper-operator`, `[RESOURCE_NAME] = [RELEASE_NAME]`, else `[RESOURCE_NAME] = [RELEASE_NAME]-zookeeper-operator`. The [RESOURCE_NAME] can however be overridden by providing `--set fullnameOverride=[RESOURCE_NAME]` along with the helm install command) +- **[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.