diff --git a/Chart.yaml b/Chart.yaml index 3456e25d..2a163901 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -12,7 +12,7 @@ description: > # 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. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.3 +version: 0.5.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -43,4 +43,4 @@ annotations: - name: Helm Chart url: https://github.com/pecanproject/bety-helm artifacthub.io/changes: | - - need to check for table before start bety application + - back to hooks since job completion requires RBAC role diff --git a/README.md b/README.md index c03bb8f2..32488c9e 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,9 @@ The command removes all the Kubernetes components associated with the chart and ## ChangeLog +### 0.5.4 +- back to hooks since job completion requires RBAC role + ### 0.5.3 - need to check for table before start bety application diff --git a/templates/jobs/add-user.yaml b/templates/hooks/add-user.yaml similarity index 72% rename from templates/jobs/add-user.yaml rename to templates/hooks/add-user.yaml index 5daa249f..df160cbe 100644 --- a/templates/jobs/add-user.yaml +++ b/templates/hooks/add-user.yaml @@ -9,6 +9,13 @@ metadata: name: {{ include "betydb.fullname" . }}-add-user labels: {{- include "betydb.labels" . | nindent 4 }} + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + # TODO once we have RBAC we can use initContainers to wait for a job + "helm.sh/hook": "post-install" + "helm.sh/hook-delete-policy": "pre-delete" + "helm.sh/hook-weight": "10" spec: template: metadata: @@ -26,6 +33,14 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} initContainers: + #{{- if or .Values.dburl .Values.dbtag }} + # - name: check-job + # image: ghcr.io/groundnuty/k8s-wait-for:v1.6 + # imagePullPolicy: {{ .Values.image.pullPolicy }} + # args: + # - "job" + # - "{{ include "betydb.fullname" . }}-load-db" + #{{- end }} - name: check-postgresql image: "{{ $.Values.image.checks }}" imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -34,7 +49,7 @@ spec: - name: PGDATABASE value: {{ .Values.betyDatabase | quote }} - name: PG_TABLE - value: "sessions" + value: "yields" containers: {{- range $index, $element := .Values.users }} - name: bety-add-user-{{ $index }} diff --git a/templates/jobs/load-db.yaml b/templates/hooks/load-db.yaml similarity index 87% rename from templates/jobs/load-db.yaml rename to templates/hooks/load-db.yaml index f3c09e45..e6e244db 100644 --- a/templates/jobs/load-db.yaml +++ b/templates/hooks/load-db.yaml @@ -5,6 +5,12 @@ metadata: name: {{ include "betydb.fullname" . }}-load-db labels: {{- include "betydb.labels" . | nindent 4 }} + 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" + "helm.sh/hook-delete-policy": "pre-delete" + "helm.sh/hook-weight": "5" spec: template: metadata: