1. Deploy Kubernetes Cluster to AWS EC2 Instance
2. Set up Istio for traffic management
2. Generate Jenkins CI/CD pipeline
- Set up webhook to this github repo
- Set up test suite
3. Set up Ansible deployment
4. Feature Creep:
- Comment thread for each suggested title
The following are a few commands to use if running on a MacOS, like myself
Install the latest LTS version: brew install jenkins-lts
Install a specific LTS version: brew install jenkins-lts@YOUR_VERSION
Start the Jenkins service: brew services start jenkins-lts
Restart the Jenkins service: brew services restart jenkins-lts
Update the Jenkins version: brew upgrade jenkins-lts
Note: Use yamllint to lint check any yaml files. It's very helpful
pip install yamllint
kubectl create namespace jenkins
kubectl create -f jenkins_pipeline/jenkins-deployment.yml
kubectl create -f jenkins_pipeline/jenkins-service.yml
Also, if you ever run into an issue with the kubectl API, there is a very handy tool for converting the yml files to the desired updated API:
kubectl convert -f <file> --output-version <group>/<version>
like:
kubectl convert -f jenkins_pipeline/jenkins-deployment.yml --output-version apps/v1
Install Istio and export it into your PATH
cd ~/istio-1.6.7
export PATH=$PWD/bin:$PATH
generate a namespace for Istio to automatically inject its Envoy sidecar into the cluster
Build the images and spin up the containers:
$ docker-compose up -d --buildRun the migrations and seed the database:
$ docker-compose exec server python manage.py recreate_db
$ docker-compose exec server python manage.py seed_dbTesting:
Install and Run Minikube for local cluster deployment
Start the cluster:
$ minikube config set vm-driver hyperkit
$ minikube start --vm-driver=virtualbox
$ minikube dashboardCreate the volume:
$ kubectl apply -f ./kubernetes/persistent-volume.ymlCreate the volume claim:
$ kubectl apply -f ./kubernetes/persistent-volume-claim.ymlCreate the secret object:
$ kubectl apply -f ./kubernetes/secret.ymlCreate deployment:
$ kubectl create -f ./kubernetes/postgres-deployment.ymlCreate the service:
$ kubectl create -f ./kubernetes/postgres-service.ymlCreate the database:
$ kubectl get pods
$ kubectl exec postgres-<POD_IDENTIFIER> --stdin --tty -- createdb -U postgres booksBuild and push the image to Docker Hub:
$ docker build -t chalmiller1/flask-kubernetes ./services/server
$ docker push chalmiller1/flask-kubernetesCreate the deployment:
$ kubectl create -f ./kubernetes/flask-deployment.ymlCreate the service:
$ kubectl create -f ./kubernetes/flask-service.ymlApply the migrations and seed the database:
$ kubectl get pods
$ kubectl exec flask-<POD_IDENTIFIER> --stdin --tty -- python manage.py recreate_db
$ kubectl exec flask-<POD_IDENTIFIER> --stdin --tty -- python manage.py seed_dbEnable and apply:
$ minikube addons enable ingress
$ kubectl apply -f ./kubernetes/minikube-ingress.ymlAdd entry to /etc/hosts file:
<MINIKUBE_IP> hello.world
^ A Helpful Command to do so is to run
echo "$(minikube ip) hello.world" | sudo tee -a /etc/hosts
Note: You need sudo privileges to run this command. Also, if for any reason you've run the command more than once, you'll need to remove the prvious entries in /etc/hosts
Try it out:
Build and push the image to Docker Hub:
$ docker build -t chalmiller1/vue-kubernetes ./services/client \
-f ./services/client/Dockerfile-minikube
$ docker push chalmiller1/vue-kubernetesCreate the deployment:
$ kubectl create -f ./kubernetes/vue-deployment.ymlCreate the service:
$ kubectl create -f ./kubernetes/vue-service.ymlTry it out at http://hello.world/.