-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helm pre-upgrade hook for auto CRD upgrade
Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
- Loading branch information
1 parent
cd0725f
commit 43ace75
Showing
4 changed files
with
61 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{- if .Values.upgradeCRDs }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: network-operator-upgrade-crd | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-upgrade | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||
labels: | ||
{{- include "network-operator.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: "network-operator" | ||
spec: | ||
template: | ||
metadata: | ||
name: network-operator-upgrade-crd | ||
labels: | ||
{{- include "network-operator.labels" . | nindent 8 }} | ||
app.kubernetes.io/component: "network-operator" | ||
spec: | ||
serviceAccountName: {{ include "network-operator.fullname" . }} | ||
imagePullSecrets: {{ include "network-operator.operator.imagePullSecrets" . | nindent 6 }} | ||
containers: | ||
- name: upgrade-crd | ||
image: "{{ .Values.operator.repository }}/{{ .Values.operator.image }}:{{ .Values.operator.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
- > | ||
kubectl apply -f /crds/network-operator; | ||
{{- if .Values.sriovNetworkOperator.enabled }} | ||
kubectl apply -f /crds/sriov-network-operator; | ||
{{- end }} | ||
restartPolicy: OnFailure | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters