ArgoCD hands-on Demo using Minikube
- Launch an EC2 instance with a
t2.micro
instance type and Ubuntu OS - Open port 80 for HTTP traffic
- Connect to the instance and perform system updates.
sudo apt update -y
4. Now install Docker on your system.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-get install docker.io
5. You can check the status of the Docker service using the following command:
systemctl status docker
sudo apt install -y curl wget apt-transport-https
6. To install Minikube, follow these steps
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
7. Move the Minikube binary to the appropriate location and provide execution permissions
sudo cp minikube-linux-amd64 /usr/local/bin/minikube
cd /usr/local/bin
sudo chmod +x minikube
8. minikube version
minikube version
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version -o yaml
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
minikube start
minikube status
kubectl cluster-info
sudo snap install kubectl --classic
9. Install Argo CD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
10. Then, check if the pods are up and running.
kubectl get pod -n argocd
11. Then, check the service. You should see argocd-server
, which is accessible on port 80. You can verify this with the provided IP
kubectl get svc -n argocd
12. Now, the issue is that there is a cluster IP, so we cannot access it. To resolve this, change the cluster IP to a node port.
kubectl edit svc argocd-server -n argocd
13. Now, forward the port to make it accessible over the internet.
kubectl get all -n argocd
kubectl port-forward --address 0.0.0.0 service/argocd-server 31124:80 -n argocd
14. Fetch the password for login.
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
15. Now, let’s connect our repository. I’ve already mentioned my repo; you can fork or clone it. To configure the repository, follow these steps: Go to the ‘Settings’ option and then choose ‘Repositories.’
16. Then, click on “Connect Repo” and choose “Via HTTPS.”
17. Enter the credentials, then click the “Connect” button.
18. We have successfully connected the repository, and now Argo CD will sync to fetch updates from it.
19. Now, go back to “Application” and select “Create Application.” Enter the application name in lowercase, set the project name to “default,” and refer to the following options for other settings.
20. After configuring, click the “Create” button in the top-left corner. It will then be automatically deployed to the cluster.
21. Before creating, you can check if any pods already exist.
kubectl get pods
22. Gitlab repo
https://gitlab.com/demo9985241/argocd-app-config.git
23. Now, when I make changes to the deployment.yaml
file, Argo CD will automatically sync those changes.