diff --git a/charts/kubefed/charts/controllermanager/templates/deployments.yaml b/charts/kubefed/charts/controllermanager/templates/deployments.yaml index 8d92584b22..5e91db9b42 100644 --- a/charts/kubefed/charts/controllermanager/templates/deployments.yaml +++ b/charts/kubefed/charts/controllermanager/templates/deployments.yaml @@ -7,6 +7,9 @@ metadata: kubefed-control-plane: controller-manager {{- if .Values.controller.annotations }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{ toYaml .Values.controller.annotations | indent 4 }} {{- end }} spec: @@ -74,6 +77,9 @@ metadata: kubefed-admission-webhook: "true" {{- if .Values.webhook.annotations }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{ toYaml .Values.webhook.annotations | indent 4 }} {{- end }} spec: diff --git a/charts/kubefed/charts/controllermanager/templates/webhook.yaml b/charts/kubefed/charts/controllermanager/templates/webhook.yaml index 00c3a7555d..6b49745998 100644 --- a/charts/kubefed/charts/controllermanager/templates/webhook.yaml +++ b/charts/kubefed/charts/controllermanager/templates/webhook.yaml @@ -14,6 +14,9 @@ metadata: name: validations.core.kubefed.io {{- end }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{- if .Values.certManager.enabled }} cert-manager.io/inject-ca-from: {{ printf "%s/%s%s" .Release.Namespace .Release.Name "-root-certificate" | quote }} {{- end }} @@ -114,6 +117,10 @@ metadata: {{- else }} name: mutation.core.kubefed.io {{- end }} + annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation webhooks: - name: kubefedconfigs.core.kubefed.io clientConfig: