Ocelot-Social/deployments/db-migration-worker.yml
Robert Schäfer 6fed4797ed Add commits to configuration to deploy :latest tag
The recommended way to update a kubernetes deployment to a new image is
to change the image tag. However, our build server is configured to push
every commit of the `master` branch to docker hub to the respective
repository and tag `:latest`. So adding some configuration that can be
changed seems to be a trick to re-deploy the `:latest` image.

See here:
https://stackoverflow.com/a/51835397
2019-02-01 19:23:00 +01:00

104 lines
2.8 KiB
YAML

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nitro-db-migration-worker
namespace: staging
spec:
replicas: 1
minReadySeconds: 15
progressDeadlineSeconds: 60
selector:
matchLabels:
workload.user.cattle.io/workloadselector: deployment-staging-db-migration-worker
template:
metadata:
labels:
workload.user.cattle.io/workloadselector: deployment-staging-db-migration-worker
name: nitro-db-migration-worker
spec:
containers:
- env:
- name: COMMIT
value: <BACKEND_COMMIT>
- name: SSH_USERNAME
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: SSH_USERNAME
- name: SSH_HOST
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: SSH_HOST
- name: MONGODB_USERNAME
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: MONGODB_USERNAME
- name: MONGODB_AUTH_DB
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: MONGODB_AUTH_DB
- name: MONGODB_DATABASE
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: MONGODB_DATABASE
- name: UPLOADS_DIRECTORY
valueFrom:
configMapKeyRef:
name: staging-db-migration-worker
key: UPLOADS_DIRECTORY
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: staging
key: MONGODB_PASSWORD
optional: false
image: humanconnection/db-migration-worker:latest
name: nitro-db-migration-worker
resources: {}
imagePullPolicy: Always
volumeMounts:
- mountPath: /root/
name: ssh-keys-directory
- mountPath: /mongo-export/
name: mongo-export
volumes:
- name: ssh-keys-directory
persistentVolumeClaim:
claimName: ssh-keys-claim
- name: mongo-export
persistentVolumeClaim:
claimName: mongo-export-claim
restartPolicy: Always
terminationGracePeriodSeconds: 30
status: {}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: ssh-keys-volume
namespace: staging
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Mi
hostPath:
path: /data/pv0001/
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ssh-keys-claim
namespace: staging
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Mi