
A professional portfolio project showcasing GitOps implementation with Argo CD, Kubernetes, Sealed Secrets, Notifications, and Infrastructure as Code. This project demonstrates DevOps best practices using modern tools and techniques with a security first mindset.
The project uses Terraform to provision Argo CD into a Kind cluster, implements the App of Apps pattern, and leverages Helm charts for application deployment.
- Argo CD for Continuous delivery for Kubernetes applications
- Terraform for Infrastructure as Code
- Taskfiles for repeatable tasks
This project uses Devbox to manage the development environment. Devbox provides a consistent, isolated environment with all the necessary tools pre-installed.
- install Docker
- Follow the installation instructions for your operating system
The rest of the tools are installed using devbox
-
Install Devbox
- Follow the installation instructions for your operating system
-
Clone the Repository
git clone https://github.com/sean-njela/argocd-demo.git cd argocd-demo
-
Start the Devbox Environment and poetry environment
devbox shell # Start the devbox environment (this will also activate the poetry environment) poetry install # Install dependencies poetry env activate # use the output to activate the poetry environment (ONLY IF DEVBOX DIDNT ACTIVATE IT) mkdocs serve # Start the mkdocs server http://127.0.0.1:8000/argocd-demo/
Note - The first time you run
devbox shell
, it will take a few minutes to install the necessary tools. But after that it will be much faster.
This project is designed for a simple, one-command setup. All necessary actions are orchestrated through Taskfile.yml
.
There are 3 application.yaml files:
0-application.yaml
- This is the dev application.yaml file with app of apps pattern, TF, sealed secrets and helm.2-application.yaml
- This is the prod application.yaml file with app of apps pattern, TF, sealed secrets and helm.3-application.yaml
- This is another prod application.yaml file with app of apps pattern, TF, sealed secrets and helm.
To create the local Kubernetes cluster and deploy Argo CD, simply run:
task ssh-keygen
Then copy the private key to the 0-repo-secret.yaml
file for argocd-image-updater. Then copy the public key to the deploy key section in the github repo. Also make sure to add the slack token to the 0-notifications-secret.yaml
file. Then run the next command.
task dev
This single command will:
- Create a local Kind cluster (if it's not already running).
- Deploy Argo CD using the Terraform configuration.
- Bootstrap argocd application using 1-sealed-secrets.yaml (this is generated by kubeseal and is the secret argocd will use to update the image in the github repo).
- Bootstrap argocd application using 0-application.yaml (this is the application.yaml file with app of apps pattern, TF and helm).
- Expose cluster kubeconfig for tools like lens
- Add argocd helm repo
or
task prod
This single command will:
- Create an EKS cluster (if it's not already running).
- Deploy Argo CD using the Terraform configuration.
Then run:
task port-fwd-argocd
You can now access the Argo CD UI at http://localhost:8080 with username admin
and for the password run(in a seperate terminal):
task argocd-init-passwd-dev # This will print the password to the terminal for dev
task argocd-init-passwd-prod # This will print the password to the terminal for prod
Then in a seperate terminal window run:
task helm-package-push # This will package the helm chart and push it to the local chartmuseum helm repo
Then run:
task docs # This will serve the docs locally at http://127.0.0.1:8000/argocd-demo/
Use the following command to clean up the cluster and terraform resources:
task cleanup-dev
# or
task cleanup-prod
This will delete the cluster and terraform resources.
To see a full list of all available tasks, run
task --list-all
The Taskfile.gitflow.yml
provides a structured Git workflow using Git Flow. This helps in managing features, releases, and hotfixes in a standardized way.
use
task -t Taskfile.gitflow.yml --list-all
to see all gitflow tasks
The environments/dev/k8s
directory contains simple Kubernetes manifests for the sample application
The environments/dev/helm
directory contains Helm charts for the same application (default in use)
- ArgoCD implementation
- Terraform infrastructure as code
- Helm chart integration
- App of apps pattern
- Comprehensive documentation
- ArgoCD Image Updater
- Deployment freezing
- Notification system
- The
1-application.yaml
file is the same as the0-application.yaml
it is the file we used initially before we added the app of apps pattern, tf and helm - We number the files because we will be adding more and more files in the future
- With TF we can customise the values of the helm chart on creation. To check which values we can edit, use helm show e.g
helm show values argocd/argocd-image-updater > image-updater-values.yaml
to check the values. Then specify in a values.yaml in the values folder the values you want to override. - SPECIFY A VALUES FILE IN THE TF VALUES FOLDER, ONLY WHEN NECESSARY
Comprehensive documentation is available in the docs/
directory. You can view it locally by running:
mkdocs serve # make sure you are in the poetry environment (check prerequisites)
Then navigate to http://127.0.0.1:8000/argocd-demo/
The documentation covers:
- Project architecture
- ArgoCD implementation details
- Application deployment process
- Environment management
- Terraform infrastructure
- Helm chart structure
- Automation with Task runner
Contributions are always welcome!
Distributed under the MIT License. See LICENSE
for more information.
Sean Njela - X/twitter - email
Project Link: https://github.com/sean-njela/argocd-demo