- To Install ArgoCD
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- Access ArgoCD UI
kubectl port-forward svc/argocd-server -n argocd 8080:443
The default username is admin
. Retrieve the password with:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
- Create an ArgoCD Application to Watch the Terraform Repo and apply the yaml
kubectl apply -f argocd-application.yaml
- Patch the argocd-server Service
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "NodePort"}}'
- Get NodePort service
kubectl get svc argocd-server -n argocd
The output will show a port in the NodePort range (e.g., 30000-32767).
- Access the ArgoCD UI:
- Find the external IP of one of your nodes.
- Access the ArgoCD UI at https://:.
Assumption - ArgoCD is deployed on the same cluster where the application needs to be deployed.
- Configure your app similar to this one - https://github.com/sowmyav27/argocd-app-config/blob/main/vcluster/my-vcluster-app.yaml
- Configure argoCD application like - https://github.com/sowmyav27/argocd-app-config/blob/main/argocd-application.yaml
- Apply the
argocd-application.yaml
yaml in the cluster manually using
kubectl apply -f argocd-application.yaml
- You will see a vCluster is deployed using command
vcluster list
NAME | NAMESPACE | STATUS | VERSION | CONNECTED | AGE
---------+-----------+---------+---------------+-----------+--------
argocd | argocd | Running | 0.21.0-beta.6 | | 6m43s
- Then to test auto-sync - make any changes in github - https://github.com/sowmyav27/argocd-app-config/blob/main/argocd-application.yaml - example: changed vCluster version to
0.20.3
- You will notice the application in ArgoCD will be in
Out of Sync
status. - Because auto-sync is configured, it will automatically sync the changes to the deployed application (Else, in the ArgoCD UI --> click on Application Details --> Under
SYNC POLICY
--> SelectEnable auto-Sync
- You will see version of vCluster will changed
vcluster list
NAME | NAMESPACE | STATUS | VERSION | CONNECTED | AGE
---------+-----------+---------+---------+-----------+---------
argocd | argocd | Running | 0.20.3 | | 19m44s