GitOps
is a methodology for implementing continuous deployment (CD)
and infrastructure as code (IaC)
using Git repositories
as the single source of truth for defining and managing infrastructure and application configurations.
This repository demonstrates how we can use ArgoCD
to implement GitOps methodology in our workflow to automate the deployment of our application on the Kubernetes cluster
.
- Under progress.
- Last updated on 16 April 2024
- Installing Docker
# update package list and install docker
sudo apt-get update
sudo apt-get install docker.io
# Start and enable Docker as a service
sudo systemctl start docker
sudo systemctl enable docker
# Verify docker installation
docker --version
- Install Jenkins
# installing java
yes | sudo apt install openjdk-11-jdk-headless
# installing Jenkins
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
yes | sudo apt-get install jenkins
- Install Kubernetes.
Follow these instructions according to your OS: kubernetes.io/releases/download/
- The source code for the Python application is stored in the
./python-app
dir. You can change the source code and push the changes to GitHub. - The
Jenkinsfile
will get triggered usingwebhooks
to create a newdocker image
and push it to the docker hub registry. - This will then trigger a different Jenkins job that will change the
Kubernetes manifest YAML file
in the repository thatArgoCD
monitors. - Finally
ArgoCD
picks up the new changes and deploys the latest version of our application on theKubernetes cluster
.