Goals:
→ Solve for concurrency issues in deploy actions like deploy app, uninstall app, etc
→ Run these actions async outside of the API calls
→ Solve for separate filesystems creating issues during concurrency
Notes:
#To create k8 secret for storing our DockerHub creds: kubectl create secret -n job-test docker-registry my-registry-secret --docker-server=[docker.io](<http://docker.io/>) --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
#To create the Job kubectl apply -f job-test.yaml -n job-test
#To delete the secret once the job is complete kubectl delete secret my-registry-secret -n job-test
apiVersion: batch/v1
kind: Job
metadata:
name: scoutflo-deploy-test
spec:
backoffLimit: 5
activeDeadlineSeconds: 3600 #1 hour for cluster creation
template:
spec:
containers:
- name: scoutflo-deploy
image: akhilvaryani006/sf-deploy-scripts:prod-0.1.28 #image tag to be deployed
command: ["node", "sample-scripts.js"] #script to run
imagePullSecrets:
- name: my-registry-secret
restartPolicy: Never
Pipeline to build docker image and push to DockerHub: https://bitbucket.org/adalinlabs/sf-deploy-scripts/src/master/bitbucket-pipelines.yml
Main repo for maintaining all deploy-scripts code: https://bitbucket.org/adalinlabs/sf-deploy-scripts/src/master/