Skip to main content

Basic of ArgoCD

Getting started

minikube start
minikube dashboard
# To delete all and start fresh
kubectl delete deployment --all
minikube delete
minikube start

ArgoCD Example Install Repository

Accessing the Web UI

Install ArgoCD using Helm chart:

helm install argo-cd charts/argo-cd/

The Helm chart doesn't install an Ingress by default. To access the Web UI, you need to port-forward to the argocd-server service:

kubectl port-forward svc/argo-cd-argocd-server 8080:443

Get the Admin Password

To get the initial admin password, run the following command:

kubectl get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Reset Password

Use a tool like bcrypt to generate a new password hash and then update the ArgoCD secret:

<default> is the namespace

kubectl -n default patch secret argocd-secret -p '{"stringData": {"admin.password": "$2a$10$xxx","admin.passwordMtime": "'$(date +%FT%T%Z)'"}}'

Add an ArgoCD repository:

argocd repo add [email protected]:xxx/abc-autotest.git --ssh-private-key-path ~/.ssh/id_rsa_argo

argocd repo add https://github.com/redhat-developer-demos/openshift-gitops-examples.git

Add an Application

argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default

argocd app get guestbook

argocd app sync guestbook

kubectl port-forward svc/helm-guestbook 9090:80

kubectl port-forward svc/guestbook-ui 9090:80

# Force patch the revision target
argocd app patch root --patch '[{"op": "replace", "path": "/spec/source/targetRevision", "value": "test/bb-pipeline"}]'

# Apply Helm templates
helm template apps/ | kubectl apply -f -

Delete Everything

kubectl delete all --all --all-namespaces