This project showcases the use of several CI/CD tools and Cloud services employed to automate the deployment of a sample Flask application (provided) into a Kubernetes cluster.
This project operationalizes a sample Flask application TechTrends deployed into a Kubernetes(K8S) cluster built with K3S.
The TechTrends applications is a monolithic app, that is containerized using Docker and deployed into a Kubernetes cluster. The K8S cluster is installed in a Vagrant Box (this virtual machine uses OpenSUSE).
All the steps to build and deploy the application into the Kubernetes cluster are fully automated using a CI pipeline and CD tools.
-
A pipeline deployed in GitHub Actions builds the container image and deploys it to DockerHub
-
Then, using ArgoCD the app is deployed into two namespaces in the Kubernetes cluster:
- Helm is used to write the application configuration templates
- Docker - Platform as a service products that use OS-level virtualization to deliver software in packages called containers
- Docker Hub - Container images repository service
- Kubernetes - System for automating deployment, scaling, and management of containerized applications
- K3S - Lightweight Kubernetes distribution
- Vagrant - Tool for building and managing virtual machine environments
- GitHub Actions - Cloud-based CI/CD service
- ArgoCD - GitOps Continuous Delivery tool for Kubernetes
- Helm - Application package manager for Kubernetes
Set up the following variables in the GitHub repo to configure the GitHub Actions pipeline:
- DOCKERHUB_USERNAME: the Docker Hub username
- DOCKERHUB_TOKEN: to authenticate into DockerHub
-
Several Makefiles are provides as a convenience for specific groups of tasks:
-
To manage the Vagrant Box: ./Makefile.vagrant
-
To setup/install the python environment for local development, test, and also Docker management: ./Makefile
-
To install all the dependencies in the Vagrant Box (OpenSUSE): ./suse_box/Makefile
-
To manually deploy all the Kubernetes resources in the Vagrant Box: ./kubernetes/Makefile
-
To deploy the application using ArgoCD: ./argocd/Makefile
-
-
GitHub Actions configuration file: techtrends-dockerhub.yml
-
ArgoCD application definition files: helm-techtrends-prod.yaml, helm-techtrends-staging.yaml
-
Helm Chart and related files: Chart.yaml and helm files
-
Kubernetes declarative files: kubernetes
-
TechTrends application: techtrends
-
Container definition file: Dockerfile
-
Vagrant Box definition file: Vagrantfile