Skip to content

Commit

Permalink
back to hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Jul 25, 2022
1 parent cf267b2 commit 9cc5541
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion templates/jobs/add-user.yaml → templates/hooks/add-user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions templates/jobs/load-db.yaml → templates/hooks/load-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9cc5541

Please sign in to comment.