This project aims to demonstrate (in an easily digestable manner) how to structure a simple flask project with all the boilerplate and testing frameworks set up (with some examples!)
The example also contains container definitions for a flask application.
- Run using: python3 -m unittest discover
- docker-compose up -d --build_
Instructions here: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
- Create security access token - https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
- export CR_PAT=YOUR_TOKEN
- echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
docker images
docker tag <TAG_ID> ghcr.io/<USER_NAME>/<IMAGE_NAME>:latest docker push ghcr.io/<USER_NAME>/<IMAGE_NAME>:latest
kubectl apply -f ./kubernetes/persistent-volume.yml
kubectl get pv
kubectl apply -f ./kubernetes/persistent-volume-claim.yml
Add Secrets object - secrets are based 64 obfuscated - echo -n "pleasechangeme" | base64 AND echo -n "sample" | base64
kubectl apply -f ./kubernetes/secret.yml
kubectl create -f ./kubernetes/postgres-deployment.yml
kubectl get deployments
kubectl create -f ./kubernetes/postgres-service.yml
kubectl get pods
kubectl exec postgres-775dcb5b64-q58rq --stdin --tty -- createdb -U sample books
kubectl exec postgres-775dcb5b64-q58rq --stdin --tty -- psql -U sample
kubectl create -f ./kubernetes/flask-deployment.yml
kubectl create -f ./kubernetes/flask-service.yml
kubectl apply -f ./kubernetes/minikube-ingress.yml
sudo echo "$(minikube ip) hello.structure" | sudo tee -a /etc/hosts
'docker port minikube | grep 22' to get the API_SERVER_SSH_PORT
- Add prometheus
- Add grafana
- Create full deploy script (To kubernetes control plane) - (Compatible with EKS )