Skip to content

Commit

Permalink
fix(helm): replace deprecated hyperkube image in pre-delete hook (#282)
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
  • Loading branch information
shubham14bajpai authored Apr 27, 2021
1 parent c5573fe commit 7ea2c08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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.8.0
version: 2.8.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.8.0
Expand Down
11 changes: 9 additions & 2 deletions deploy/helm/charts/templates/cleanup-webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# HELM first deletes RBAC, then it tries to delete other resources like CSPC and PVC.
# We've got validating webhook on CSPC and PVC.
# But even that the policy of this webhook is Ignore, it fails because the ServiceAccount
# does not have permission to access resources like BDC anymore which are used for validation.
# Therefore we first need to delete webhook so we can delete the rest of the deployments.
{{- $kubeMinor := .Capabilities.KubeVersion.Minor | replace "+" "" }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -18,8 +24,9 @@ spec:
serviceAccountName: {{ .Values.serviceAccount.cstorOperator.name }}
containers:
- name: kubectl
image: "{{ .Values.hyperkubeImage.repository }}:{{ .Values.hyperkubeImage.tag }}"
imagePullPolicy: "{{ .Values.hyperkubeImage.pullPolicy }}"
{{- /* 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 }}
command:
- /bin/sh
- -c
Expand Down
7 changes: 0 additions & 7 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,3 @@ analytics:
enabled: true
# Specify in hours the duration after which a ping event needs to be sent.
pingInterval: "24h"

# this is to cleanup the validatingwebhook after deletion of the charts
# via a pre-delete webhook job
hyperkubeImage:
repository: "k8s.gcr.io/hyperkube"
tag: "v1.12.1"
pullPolicy: "IfNotPresent"

0 comments on commit 7ea2c08

Please sign in to comment.