Add deployment for db-migation-worker

This commit is contained in:
Robert Schäfer 2019-01-28 18:33:21 +01:00
parent 4d973ede81
commit 7d7e34b132
4 changed files with 85 additions and 2 deletions

View File

@ -22,10 +22,17 @@ There are many Kubernetes distributions, but if you're just getting started, Min
kubectl create -f namespace-staging.json
```
## Change config maps according to your needs
```shell
cd ./staging
cp db-migration-worker-configmap.template.yaml db-migration-worker-configmap.yaml
# edit all variables according to the setup of the remote legacy server
```
## Apply the config map to staging namespace
```shell
cd ./staging
kubectl apply -f neo4j-configmap.yaml -f backend-configmap.yaml -f web-configmap.yaml
kubectl apply -f neo4j-configmap.yaml -f backend-configmap.yaml -f web-configmap.yaml -f db-migration-worker-configmap.yaml
```
## Setup secrets and deploy themn
@ -39,7 +46,7 @@ kubectl apply -f secrets.yaml
## Deploy the app
```shell
cd ./staging
kubectl apply -f neo4j-deployment.yaml -f backend-deployment.yaml -f web-deployment.yaml
kubectl apply -f neo4j-deployment.yaml -f backend-deployment.yaml -f web-deployment.yaml -f db-migration-worker-deployment.yaml
```
This can take a while.
Sit back and relax and have a look into your minikube dashboard:

1
staging/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
db-migration-worker-configmap.yaml

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
data:
SSH_USERNAME: "<REPLACE>"
SSH_HOST: "<REPLACE>"
MONGODB_USERNAME: "hc-api"
MONGODB_AUTH_DB: "hc_api"
MONGODB_DATABASE: "hc_api"
UPLOADS_DIRECTORY: "/var/www/api/uploads"
metadata:
name: staging-db-migration-worker
namespace: staging

View File

@ -0,0 +1,63 @@
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: 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
restartPolicy: Always
terminationGracePeriodSeconds: 30
status: {}