This repo aims to present gitops principles by showing the automatic reconciliation steps with ArgoCD. It uses minikube as a replacement for a real k8s cluster.
- Docker v26.1.3 or higher
- Minikube v1.33.1 or higher
- kubectl v1.22.10 or higher
- argocd CLI v2.11.3 or higher
Steps taken from: https://argo-cd.readthedocs.io/en/stable/cli_installation/
- curl -sSL -o argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
- chmod +x argocd
- sudo mv argocd /usr/local/bin/
Steps taken from argocd docs: https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd
- minikube start
- kubectl create namespace argocd
- kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- kubectl get pods -n argocd
- argocd login --core
If these steps have been followed once, steps 2-4 can be skipped.
- docker build -t shrimp:latest .
- docker images | grep shrimp
- docker run --name shrimp -e MESSAGE="test" shrimp:latest
- docker logs -f shrimp
- docker stop shrimp
- eval $(minikube docker-env)
- minikube image load shrimp
- kubectl apply -f infra/deployment.yaml
- kubectl logs -f
- kubectl port-forward svc/argocd-server -n argocd 8080:443
- Go to https://localhost:8080
- argocd admin initial-password -n argocd
- kubectl apply -f application.yaml
- minikube start
- kubectl port-forward svc/argocd-server -n argocd 8080:443
- Go to http://localhost:8080
- Create new branch
- Open infra/deployment.yaml
- Change message, push, merge PR
- Checkout main again and pull
- In new terminal: kubectl get pods -w
- In argocd UI: trigger sync with prune enabled
- Watch the new pod come up in CLI and argocd UI.