Skip to content

Commit 630bbd6

Browse files
committed
chore(migrate): use helm hook replace cluster lock
1 parent 41f157c commit 630bbd6

3 files changed

Lines changed: 3 additions & 63 deletions

File tree

charts/passport/templates/passport-deployment.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ spec:
3737
- -u
3838
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL)
3939
{{- include "passport.envs" . | indent 8 }}
40-
- name: drycc-passport-waitting
41-
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/passport:{{.Values.imageTag}}
42-
imagePullPolicy: {{.Values.imagePullPolicy}}
43-
args:
44-
- /usr/bin/env
45-
- bash
46-
- -ec
47-
- |
48-
python -u /workspace/manage.py cluster_lock waitting
49-
{{- include "passport.limits" . | indent 8 }}
50-
{{- include "passport.envs" . | indent 8 }}
51-
{{- include "passport.volumeMounts" . | indent 8 }}
5240
containers:
5341
- name: drycc-passport
5442
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/passport:{{.Values.imageTag}}

charts/passport/templates/passport-job-upgrade.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
apiVersion: batch/v1
33
kind: Job
44
metadata:
5-
name: drycc-passport-job-upgrade-{{ now | date "20060102150405" }}
6-
labels:
7-
heritage: drycc
5+
name: drycc-passport-job-upgrade
86
annotations:
97
component.drycc.cc/version: {{ .Values.imageTag }}
8+
helm.sh/hook: post-install,pre-upgrade,pre-rollback
9+
helm.sh/hook-delete-policy: before-hook-creation
1010
spec:
1111
template:
12-
metadata:
13-
labels: {{- include "common.labels.standard" . | nindent 8 }}
14-
app: drycc-passport-job-upgrade
1512
spec:
1613
initContainers:
1714
- name: drycc-passport-init
@@ -36,20 +33,16 @@ spec:
3633
- bash
3734
- -ec
3835
- |
39-
python -u /workspace/manage.py cluster_lock lock
4036
python -u /workspace/manage.py migrate --noinput
4137
if [ "${ADMIN_USERNAME}" ] && [ "${ADMIN_PASSWORD}" ] && [ "${ADMIN_EMAIL}" ]; then
4238
echo "Create administrator"
4339
python /workspace/manage.py createadminuser --username "${ADMIN_USERNAME}" --password "${ADMIN_PASSWORD}" --noinput --email "${ADMIN_EMAIL}"
4440
fi
4541
python /workspace/manage.py create_oauth2_application --path /etc/drycc/passport/init-applications.json
46-
python -u /workspace/manage.py cluster_lock unlock
4742
{{- end }}
4843
{{- include "passport.limits" . | indent 8 }}
4944
{{- include "passport.envs" . | indent 8 }}
5045
{{- include "passport.volumeMounts" . | indent 8 }}
5146
{{- include "passport.volumes" . | indent 6 }}
5247
restartPolicy: Never
53-
backoffLimit: 0
54-
ttlSecondsAfterFinished: 3600
5548
{{- end }}

rootfs/api/management/commands/cluster_lock.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)