stackage-server/etc/helm/templates/cron_deployment.yaml
Deni Bertovic d2ee4f0f13
Temporary switch to new k8s secrets name
This is needed to we can easily migrate to the new db with the
recent pantry changes. If something goes wrong we can simply revert to
the old secret (and hence the old db).

Once the upgrade is done (and verified) we can update the old secret and
update the name in this commit (back to it's original name)
2019-06-17 15:21:59 +02:00

67 lines
1.7 KiB
YAML

{{- if .Values.cron.enabled -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Values.cronName }}
spec:
replicas: 1
minReadySeconds: 5
strategy:
type: Recreate
template:
metadata:
labels:
app: {{ .Values.cronApp }}
release: {{ .Release.Name }}
spec:
imagePullSecrets:
- name: {{ .Values.registrySecretName }}
volumes:
- name: stackage-server-cron-volume
secret:
secretName: {{ .Values.cronName }}-secret
containers:
- name: stackage-server-cron
image: {{ .Values.image.image }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: PGSTRING
valueFrom:
secretKeyRef:
name: {{ .Values.name }}-upgrade
key: PGCONN
command:
- bash
- "-c"
- |
set -eux
source /secret/aws.sh
mkdir -p /work
cd /work
while true
do
date
stack update
/usr/local/bin/stackage-server-cron
sleep 5m
done
volumeMounts:
- name: stackage-server-cron-volume
readOnly: true
mountPath: /secret
resources:
{{ toYaml .Values.cronResources.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}