Given the attached app.py, please do the following:
- Write a Dockerfile to package this flask Application as a container.
- Write the necessary Kubernetes manifests to deploy this container as a web application.
- Incorporate a dummy URL this application would respond on.
- Created Dockerfile for the Python applicaiton
- Tested to make sure app is working properly
- Created Helm Charts for the Application - Helm Charts are Package Managers for Kubernetes
- Modified the values.yaml file in Helm Chart to customize the Application parameters
- Added Ingress and tls capabilities in values.yaml file so app can recieve a tls certificate for http/https
- Deployed application on Google Cloud GKE Kubernetes Cluster as Deployment with 3 Pods for high availability
replicaCount: 3
- Also enabled Horizontal Pod Autoscaler which allows the Pods to scale from 1 to 100 if load reaches 80%
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
- Created Separate dev, qa, stage, and prod version of the app with it's own domain name
Application was build using Jenkins for CI
- A Jenkins job was run to build the image
- It went through Sonarqube for static analyis of code
- Once the unit test was successful the artifact was pushed to docker repository
- ArgoCD uses GitOps and uses the git repository as a source of truth and constantly syncs the current state wtih desired state of infrastructure
- To automate this process a multi-branch pipeline can be created that will ArgoCD to pull from git repository and deploy to multiple enviornments
- Application was deployed with multiple pods for high availability
- Google Cloud GKE Clusters were used to minimize the cost
- Helm Charts were used to simplify the deployment of application on Kubernetes Clusters
- Another automated way was used to deploy application and CI/CD was implemented
- Jenkins was used for CI to build the artifact and push it to docker hub
- ArgoCD and GitOps methodology was used for CD process and application was deployed in automated fashion directly on Kubernetes Clusters
├
├── application.yaml
├── argocd
│ ├── deployment.yaml
│ └── service.yaml
├── docker
│ ├── app.py
│ ├── Dockerfile
│ ├── LICENSE
│ ├── README.md
│ └── requirements.txt
├── hello-world-dev
│ ├── Chart.yaml
│ ├── templates
│ │ ├── deployment.yaml
│ │ ├── _helpers.tpl
│ │ ├── hpa.yaml
│ │ ├── ingress.yaml
│ │ ├── NOTES.txt
│ │ ├── serviceaccount.yaml
│ │ ├── service.yaml
│ │ └── tests
│ │ └── test-connection.yaml
│ └── values.yaml