This repo is used for devops interview.
- There are many bad practices in this repo, try to make it better.
- Any further improvement in this repo, like infra, HA, etc.
./auto/start-local-env
After the initialization process is successful done, you can access your local environment via 127.0.0.1 in your browser.
./auto/stop-local-env
Github action will be triggered to build and release the images to dockerhub once code is pushed into main branch or any branch start with joi-
. Please use following URLs to access the images.
Dockerhub
App: joidevops/app:{TAG}
Migration: joidevops/migratino:{TAG}
If you want to push images to your own docker registry, update the docker registry credential in the config/cr-credential
and set the right repo path for each image, then run the following script, it will push docker images to your docker hub.
./auto/release-docker-images-to-dockerhub
Put the interviewee name in the file interviewee_name
under the repo root, it will use date +%s
output if the file is not found. This name will be used part of the domain, so please make it following a valid domain name pattern. The final domain will look like {INTERVIEWEE_NAME}.devops.joi.toc-platform.com
.
Set AWS environment variables and run following script to provision infrastructure on AWS.
./auto/provison-infra-on-aws
After the infrastructure provision is done, we should have a workable k8s cluster.
Use ./auto/get-kubeconfig-for-interview
to retrive the kubectl config to config/kube-config.txt
from remote. Kubectl in scripts has been already set with this config file to work. Use following command for your local kubectl.
export KUBECONFIG=${PWD}/config/kube-config.txt
Check the above files if there are something wrong.
./auto/deploy-app-to-k8s
This script will generate the k8s relevant files and deploy it. We use kustomize to manage the configs.
After deployment process is finished, you can access the application via https://{INTERVIEWEE_NAME}.devops.joi.toc-platform.com:32100
./auto/destroy-infra-on-aws
Destroy the resources which created by the provision scripts.