Skip to content

Commit 83cd44a

Browse files
committed
- use new check image to use PG environment variables
- add-user and load-db are now jobs, not hooks (prevent timeout issues)
1 parent fb95ed5 commit 83cd44a

File tree

11 files changed

+31
-39
lines changed

11 files changed

+31
-39
lines changed

Chart.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: >
1212
# This is the chart version. This version number should be incremented each time you make changes
1313
# to the chart and its templates, including the app version.
1414
# Versions are expected to follow Semantic Versioning (https://semver.org/)
15-
version: 0.5.1
15+
version: 0.5.2
1616

1717
# This is the version number of the application being deployed. This version number should be
1818
# incremented each time you make changes to the application. Versions are not expected to
@@ -43,6 +43,5 @@ annotations:
4343
- name: Helm Chart
4444
url: https://github.com/pecanproject/bety-helm
4545
artifacthub.io/changes: |
46-
- update README to describe values
47-
- fix left over when initializing from URL
48-
- fix binami url change
46+
- use new check image to use PG environment variables
47+
- add-user and load-db are now jobs, not hooks (prevent timeout issues)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ The command removes all the Kubernetes components associated with the chart and
124124

125125
## ChangeLog
126126

127+
### 0.5.2
128+
- use new check image to use PG environment variables
129+
- add-user and load-db are now jobs, not hooks (prevent timeout issues)
130+
127131
### 0.5.1
128132
- update README to describe values
129133
- fix left over when initializing from URL

templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: ConfigMap
44
metadata:
55
name: {{ include "betydb.fullname" . }}-application
66
labels:
7-
{{ include "betydb.labels" . | nindent 4 }}
7+
{{- include "betydb.labels" . | nindent 4 }}
88
data:
99
{{- if .Values.customization.application }}
1010
application.yml: |

templates/deployment.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Deployment
33
metadata:
44
name: {{ include "betydb.fullname" . }}
55
labels:
6-
{{ include "betydb.labels" . | nindent 4 }}
6+
{{- include "betydb.labels" . | nindent 4 }}
77
spec:
88
replicas: {{ .Values.replicaCount }}
99
selector:
@@ -41,8 +41,9 @@ spec:
4141
image: "{{ $.Values.image.checks }}"
4242
imagePullPolicy: {{ .Values.image.pullPolicy }}
4343
env:
44-
{{ include "betydb.postgresqlEnv" . | nindent 12 }}
45-
{{ include "betydb.betydbEnv" . | nindent 12 }}
44+
{{- include "betydb.postgresqlEnv" . | nindent 12 }}
45+
- name: PG_TABLE
46+
value: {{ .Values.betyDatabase | quote }}
4647
containers:
4748
- name: {{ .Chart.Name }}
4849
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -63,8 +64,8 @@ spec:
6364
value: {{ .Values.ingress.path | default "" | trimSuffix "/" | quote }}
6465
- name: RAILS_LOG_TO_STDOUT
6566
value: "true"
66-
{{ include "betydb.postgresqlEnv" . | nindent 12 }}
67-
{{ include "betydb.betydbEnv" . | nindent 12 }}
67+
{{- include "betydb.postgresqlEnv" . | nindent 12 }}
68+
{{- include "betydb.betydbEnv" . | nindent 12 }}
6869
{{- if .Values.customization }}
6970
volumeMounts:
7071
{{- if .Values.customization.application }}

templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: Ingress
55
metadata:
66
name: {{ $fullName }}
77
labels:
8-
{{ include "betydb.labels" . | indent 4 }}
8+
{{- include "betydb.labels" . | nindent 4 }}
99
annotations:
1010
{{- if .Values.ingress.tls }}
1111
kubernetes.io/tls-acme: "true"

templates/hooks/add-user.yaml renamed to templates/jobs/add-user.yaml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.users }}
2-
{{- $imagetag := printf "%s:%s" .Values.image.repository .Values.image.tag }}
2+
{{- $imagetag := printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) }}
33
{{- $pgenv := include "betydb.postgresqlEnv" . }}
44
{{- $betyenv := include "betydb.betydbEnv" . }}
55
{{- $pullPolicy := .Values.image.pullPolicy }}
@@ -8,19 +8,13 @@ kind: Job
88
metadata:
99
name: {{ include "betydb.fullname" . }}-add-user
1010
labels:
11-
{{ include "betydb.labels" . | nindent 4 }}
12-
annotations:
13-
# This is what defines this resource as a hook. Without this line, the
14-
# job is considered part of the release.
15-
"helm.sh/hook": "post-install"
16-
"helm.sh/hook-delete-policy": "hook-succeeded,before-hook-creation"
17-
"helm.sh/hook-weight": "10"
11+
{{- include "betydb.labels" . | nindent 4 }}
1812
spec:
1913
template:
2014
metadata:
2115
name: {{ include "betydb.name" . }}-add-user
2216
labels:
23-
{{ include "betydb.labels" . | nindent 8 }}
17+
{{- include "betydb.labels" . | nindent 8 }}
2418
spec:
2519
{{- with .Values.hooks.affinity }}
2620
affinity:
@@ -36,8 +30,9 @@ spec:
3630
image: "{{ $.Values.image.checks }}"
3731
imagePullPolicy: {{ .Values.image.pullPolicy }}
3832
env:
39-
{{ include "betydb.postgresqlEnv" . | nindent 12 }}
40-
{{ include "betydb.betydbEnv" . | nindent 12 }}
33+
{{- include "betydb.postgresqlEnv" . | nindent 12 }}
34+
- name: PG_TABLE
35+
value: {{ .Values.betyDatabase | quote }}
4136
containers:
4237
{{- range $index, $element := .Values.users }}
4338
- name: bety-add-user-{{ $index }}
@@ -52,7 +47,7 @@ spec:
5247
- {{ .data | quote }}
5348
- {{ .page | quote }}
5449
env:
55-
{{ $pgenv | nindent 12 }}
56-
{{ $betyenv | nindent 12 }}
50+
{{- $pgenv | nindent 12 }}
51+
{{- $betyenv | nindent 12 }}
5752
{{- end }}
5853
{{- end }}

templates/jobs/foo

Whitespace-only changes.

templates/hooks/load-db.yaml renamed to templates/jobs/load-db.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@ kind: Job
44
metadata:
55
name: {{ include "betydb.fullname" . }}-load-db
66
labels:
7-
{{ include "betydb.labels" . | indent 4 }}
8-
annotations:
9-
# This is what defines this resource as a hook. Without this line, the
10-
# job is considered part of the release.
11-
"helm.sh/hook": "post-install"
12-
"helm.sh/hook-delete-policy": "hook-succeeded,before-hook-creation"
13-
"helm.sh/hook-weight": "5"
7+
{{- include "betydb.labels" . | nindent 4 }}
148
spec:
159
template:
1610
metadata:
1711
name: {{ include "betydb.name" . }}-load-db
1812
labels:
19-
{{ include "betydb.labels" . | nindent 8 }}
13+
{{- include "betydb.labels" . | nindent 8 }}
2014
spec:
2115
{{- with .Values.hooks.affinity }}
2216
affinity:
@@ -32,8 +26,7 @@ spec:
3226
image: "{{ $.Values.image.checks }}"
3327
imagePullPolicy: {{ .Values.image.pullPolicy }}
3428
env:
35-
{{ include "betydb.postgresqlEnv" . | nindent 12 }}
36-
{{ include "betydb.betydbEnv" . | nindent 12 }}
29+
{{- include "betydb.postgresqlEnv" . | nindent 12 }}
3730
containers:
3831
- name: bety-init
3932
{{- if .Values.dburl }}
@@ -58,6 +51,6 @@ spec:
5851
imagePullPolicy: Always
5952
{{- end }}
6053
env:
61-
{{ include "betydb.postgresqlEnv" . | nindent 12 }}
62-
{{ include "betydb.betydbEnv" . | nindent 12 }}
54+
{{- include "betydb.postgresqlEnv" . | nindent 12 }}
55+
{{- include "betydb.betydbEnv" . | nindent 12 }}
6356
{{- end }}

templates/secrets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Secret
33
metadata:
44
name: {{ include "betydb.fullname" . }}
55
labels:
6-
{{ include "betydb.labels" . | indent 4 }}
6+
{{- include "betydb.labels" . | nindent 4 }}
77
type: Opaque
88
data:
99
{{- if and (not .Values.postgresql.enabled) .Values.postgresql.postgresqlPassword }}

templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Service
33
metadata:
44
name: {{ include "betydb.fullname" . }}
55
labels:
6-
{{ include "betydb.labels" . | indent 4 }}
6+
{{- include "betydb.labels" . | nindent 4 }}
77
spec:
88
type: {{ .Values.service.type }}
99
ports:

values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image:
22
repository: pecan/bety
33
tag: null
4-
checks: "ncsa/checks:1.0.0"
4+
checks: "ncsa/checks:1.0.1"
55
pullPolicy: IfNotPresent
66

77
imagePullSecrets: []

0 commit comments

Comments
 (0)