diff --git a/charts/fission-all/templates/post-install-job.yaml b/charts/fission-all/templates/post-install-job.yaml index 68b51a98..da849622 100644 --- a/charts/fission-all/templates/post-install-job.yaml +++ b/charts/fission-all/templates/post-install-job.yaml @@ -13,7 +13,7 @@ metadata: annotations: # This is what defines this resource as a hook. Without this line, the # job is considered part of the release. - "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook": post-install "helm.sh/hook-delete-policy": hook-succeeded spec: template: diff --git a/charts/fission-all/templates/post-upgrade-job.yaml b/charts/fission-all/templates/post-upgrade-job.yaml new file mode 100644 index 00000000..a5f47c33 --- /dev/null +++ b/charts/fission-all/templates/post-upgrade-job.yaml @@ -0,0 +1,35 @@ +{{ if .Values.analytics }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "fullname" . }}-{{ .Chart.Version }} + labels: + # The "release" convention makes it easy to tie a release to all of the + # Kubernetes resources that were created as part of that release. + release: {{ .Release.Name }} + # This makes it easy to audit chart usage. + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: {{ template "name" . }} + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-upgrade + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: {{ template "fullname" . }} + labels: + release: {{ .Release.Name }} + app: {{ template "name" . }} + annotations: + {{- if .Values.enableIstio }} + "sidecar.istio.io/inject": "false" + {{- end }} + spec: + restartPolicy: Never + containers: + - name: post-upgrade-job + image: "fission/alpinecurl" + command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] +{{ end }} diff --git a/charts/fission-core/templates/post-install-job.yaml b/charts/fission-core/templates/post-install-job.yaml index 68b51a98..da849622 100644 --- a/charts/fission-core/templates/post-install-job.yaml +++ b/charts/fission-core/templates/post-install-job.yaml @@ -13,7 +13,7 @@ metadata: annotations: # This is what defines this resource as a hook. Without this line, the # job is considered part of the release. - "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook": post-install "helm.sh/hook-delete-policy": hook-succeeded spec: template: diff --git a/charts/fission-core/templates/post-upgrade-job.yaml b/charts/fission-core/templates/post-upgrade-job.yaml new file mode 100644 index 00000000..a5f47c33 --- /dev/null +++ b/charts/fission-core/templates/post-upgrade-job.yaml @@ -0,0 +1,35 @@ +{{ if .Values.analytics }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "fullname" . }}-{{ .Chart.Version }} + labels: + # The "release" convention makes it easy to tie a release to all of the + # Kubernetes resources that were created as part of that release. + release: {{ .Release.Name }} + # This makes it easy to audit chart usage. + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app: {{ template "name" . }} + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-upgrade + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: {{ template "fullname" . }} + labels: + release: {{ .Release.Name }} + app: {{ template "name" . }} + annotations: + {{- if .Values.enableIstio }} + "sidecar.istio.io/inject": "false" + {{- end }} + spec: + restartPolicy: Never + containers: + - name: post-upgrade-job + image: "fission/alpinecurl" + command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-upgrade\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] +{{ end }}