Skip to content

Commit

Permalink
Use Helm chart hooks for Jobs to initialize cluster resources (#2828)
Browse files Browse the repository at this point in the history
* Rename cron job that updates the fonts

* Fix pull policy for create-admin-user

* Make ECR login job and update cert job chart hooks
  • Loading branch information
jmgrady authored Dec 8, 2023
1 parent bdef32d commit 316b37a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: Job
metadata:
name: "{{ .Values.awsEcr.jobName }}"
namespace: {{ .Release.Namespace }}
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-delete-policy": before-hook-creation
spec:
# keep completed jobs for 24 hrs so that logs are
# available in case of issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: Job
metadata:
name: update-cert-oneshot
namespace: {{ .Release.Namespace }}
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-delete-policy": before-hook-creation
spec:
ttlSecondsAfterFinished: 300
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: Job
metadata:
name: create-admin-user
namespace: {{ .Release.Namespace }}
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-delete-policy": before-hook-creation
spec:
ttlSecondsAfterFinished: 300
template:
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/create-admin-user/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ global:
combineSmtpPassword: "Override"
pullSecretName: aws-login-credentials
imageTag: "latest"
imagePullPolicy: IfNotPresent
# Define the type of image registry to use, awsEcr or local
imageRegistry: awsEcr

Expand Down

0 comments on commit 316b37a

Please sign in to comment.