Skip to content
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

refact(charts): make cleanup pre hook image configurable #336

Merged
merged 2 commits into from
May 31, 2021
Merged
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: 1 addition & 1 deletion deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: CStor-Operator helm chart for Kubernetes
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.9.0
version: 2.9.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 2.9.0
Expand Down
6 changes: 4 additions & 2 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| admissionServer.resources | object | `{}` | Admission webhook pod resources |
| admissionServer.securityContext | object | `{}` | Admission webhook security context |
| admissionServer.tolerations | list | `[]` | Admission webhook tolerations |
| cleanup.image.registry | string | `nil` | cleanup pre hook image registry |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question(n_p) :
nil vs ""
( I see that existing code uses nil )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing values.yaml uses empty fields so I continued with that

| cleanup.image.repository | string | `"bitnami/kubectl"` | cleanup pre hook image repository |
| csiController.annotations | object | `{}` | CSI controller annotations |
| csiController.attacher.image.pullPolicy | string | `"IfNotPresent"` | CSI attacher image pull policy |
| csiController.attacher.image.registry | string | `"k8s.gcr.io/"` | CSI attacher image registry |
Expand Down Expand Up @@ -143,7 +145,7 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| csiController.snapshotController.name | string | `"snapshot-controller"` | CSI snapshot controller container name |
| csiController.snapshotter.image.pullPolicy | string | `"IfNotPresent"` | CSI snapshotter image pull policy |
| csiController.snapshotter.image.registry | string | `"k8s.gcr.io/"` | CSI snapshotter image pull registry |
| csiController.snapshotter.image.repository | string | `"sig-storage/csi-snapshotter"` | CSI snapshotter image repositroy |
| csiController.snapshotter.image.repository | string | `"sig-storage/csi-snapshotter"` | CSI snapshotter image repository |
| csiController.snapshotter.image.tag | string | `"v3.0.3"` | CSI snapshotter image tag |
| csiController.snapshotter.name | string | `"csi-snapshotter"` | CSI snapshotter container name |
| csiController.tolerations | list | `[]` | CSI controller pod tolerations |
Expand All @@ -168,7 +170,7 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| cspcOperator.cstorPool.image.repository | string | `"openebs/cstor-pool"` | CStor pool image repository|
| cspcOperator.cstorPool.image.tag | string | `"2.9.0"` | CStor pool image tag |
| cspcOperator.cstorPoolExporter.image.registry | string | `nil` | CStor pool exporter image registry |
| cspcOperator.cstorPoolExporter.image.repository | string | `"openebs/m-exporter"` | CStor pool exporter image repositry |
| cspcOperator.cstorPoolExporter.image.repository | string | `"openebs/m-exporter"` | CStor pool exporter image repository |
| cspcOperator.cstorPoolExporter.image.tag | string | `"2.9.0"` | CStor pool exporter image tag |
| cspcOperator.image.pullPolicy | string | `"IfNotPresent"` | CSPC operator image pull policy |
| cspcOperator.image.registry | string | `nil` | CSPC operator image registry |
Expand Down
8 changes: 6 additions & 2 deletions deploy/helm/charts/templates/cleanup-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ spec:
- name: kubectl
{{- /* bitnami maintains an image for all k8s versions */}}
{{- /* see: https://hub.docker.com/r/bitnami/kubectl */}}
image: {{ printf "%s/%s:%s.%s" "bitnami" "kubectl" .Capabilities.KubeVersion.Major $kubeMinor }}
{{- if .Values.cleanup.image.tag }}
image: "{{ .Values.cleanup.image.registry }}{{ .Values.cleanup.image.repository }}:{{ .Values.cleanup.image.tag }}"
{{- else }}
image: "{{ .Values.cleanup.image.registry }}{{ .Values.cleanup.image.repository }}:{{ .Capabilities.KubeVersion.Major }}.{{ $kubeMinor }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as openebs/charts PR , tag can be different as well.

{{- end }}
command:
- /bin/sh
- -c
- >
kubectl delete validatingWebhookConfiguration openebs-cstor-validation-webhook;
restartPolicy: OnFailure
restartPolicy: OnFailure
8 changes: 8 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ analytics:
enabled: true
# Specify in hours the duration after which a ping event needs to be sent.
pingInterval: "24h"

cleanup:
image:
# Make sure that registry name end with a '/'.
# For example : quay.io/ is a correct value here and quay.io is incorrect
registry:
repository: bitnami/kubectl
tag:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the tag is empty? Are we going to use latest always?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tag is determined in the job template itself using the helm Capabilities to determine the k8s version, which will be same as the tag