MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

ArgoCd Commands Reference

This page collects the Argo CD commands engineers use most: getting the initial admin password, finding the Argo CD URL, changing or resetting the admin password with kubectl or the argocd CLI, and running everyday app, repo and cluster operations. The notes above were cut short and have some mistakes, so the sections below give complete, corrected commands that work on current Argo CD 2.x and later.


What the commands above do

The notes above cover three tasks: changing the admin password by patching the argocd-secret Secret, finding the Argo CD hostname from an Ingress, and getting the admin password. They assume Argo CD runs in a namespace called management. A default install uses the argocd namespace, so the examples below use argocd. Replace it with your own namespace if it differs.

Note: Several commands above stop partway through: they end with a trailing | or a half-finished bcrypt hash, so they won't run if you paste them. Use the full versions below instead.

Get the initial admin password

The step above that finds the argocd-server pod name only applies to Argo CD 1.8 and earlier. In those versions the first admin password was the pod name. Since 1.9, Argo CD generates a random password and stores it in the argocd-initial-admin-secret Secret.

# With kubectl
kubectl -n argocd get secret argocd-initial-admin-secret \
  -o jsonpath='{.data.password}' | base64 -d; echo

# With the argocd CLI (no login needed, uses your kubeconfig)
argocd admin initial-password -n argocdCode language: PHP (php)

The username is always admin. Once you've logged in and changed the password, delete argocd-initial-admin-secret with kubectl -n argocd delete secret argocd-initial-admin-secret. Argo CD only uses it to hand you the first password, and leaving it in place keeps a working credential lying around.

Find the Argo CD URL

The URL command above greps for grafana, which returns the Grafana Ingress, not the Argo CD one. Using awk '{print $3}' is also unreliable: recent kubectl versions add a CLASS column that shifts the columns, and awk prints the header row too. A jsonpath query reads the hostname directly:

# List every Ingress in the namespace with its hosts
kubectl -n argocd get ingress \
  -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.rules[*].host}{"\n"}{end}'

# If argocd-server is exposed as a LoadBalancer Service instead
kubectl -n argocd get svc argocd-server \
  -o jsonpath='{.status.loadBalancer.ingress[0].hostname}{.status.loadBalancer.ingress[0].ip}{"\n"}'

# No Ingress or LoadBalancer: port-forward and open https://localhost:8080
kubectl -n argocd port-forward svc/argocd-server 8080:443Code language: PHP (php)

Change the admin password

The easiest way is the CLI. It checks the current password and hashes the new one for you:

argocd login argocd.example.com --username admin
argocd account update-password \
  --account admin \
  --current-password 'OLD_PASSWORD' \
  --new-password 'NEW_STRONG_PASSWORD'Code language: JavaScript (javascript)

If you can't log in, patch the Secret directly. The admin.password field must contain a bcrypt hash, not plain text. That's why the THE_NEW_PASSWORD placeholder above is misleading. Generate the hash first:

# Option 1: argocd CLI
argocd account bcrypt --password 'NEW_STRONG_PASSWORD'

# Option 2: htpasswd (apache2-utils / httpd-tools)
htpasswd -nbBC 10 "" 'NEW_STRONG_PASSWORD' | tr -d ':\n' | sed 's/$2y/$2a/'Code language: PHP (php)
kubectl -n argocd patch secret argocd-secret \
  -p '{"stringData": {
    "admin.password": "$2a$10$REPLACE_WITH_YOUR_BCRYPT_HASH",
    "admin.passwordMtime": "'$(date +%FT%T%Z)'"
  }}'Code language: PHP (php)

Keep the JSON in single quotes so the shell doesn't expand the $ characters inside the hash. The '$(date ...)' part briefly closes the single quotes so the shell can insert the current timestamp. When admin.passwordMtime changes, Argo CD invalidates existing admin sessions.

Reset a lost admin password

If nobody knows the current password, remove both password keys and restart the API server. Argo CD then creates a new random password and stores it in argocd-initial-admin-secret.

  1. Remove the keys: kubectl -n argocd patch secret argocd-secret --type json -p '[{"op":"remove","path":"/data/admin.password"},{"op":"remove","path":"/data/admin.passwordMtime"}]'
  2. Restart the server: kubectl -n argocd rollout restart deployment argocd-server
  3. Wait for it to become ready: kubectl -n argocd rollout status deployment argocd-server
  4. Read the new password with argocd admin initial-password -n argocd, log in, and set a permanent password.

Everyday argocd CLI commands

Most argocd commands need a session, so run argocd login first. If you have kubectl access and don't want to go through the API server, argocd login --core talks to the Kubernetes API directly.

TaskCommand
Log inargocd login argocd.example.com --username admin --grpc-web
Show client and server versionsargocd version
Current user infoargocd account get-user-info
List local accountsargocd account list
Register a cluster from kubeconfigargocd cluster add my-context-name
List clustersargocd cluster list
Add a Git repositoryargocd repo add https://github.com/argoproj/argocd-example-apps.git
Create an applicationargocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default
List and inspect appsargocd app list / argocd app get guestbook
Preview changesargocd app diff guestbook
Sync, pruning deleted resourcesargocd app sync guestbook --prune
Wait until healthyargocd app wait guestbook --health --timeout 300
Enable auto-syncargocd app set guestbook --sync-policy automated --auto-prune --self-heal
History and rollbackargocd app history guestbook / argocd app rollback guestbook 3
Delete an appargocd app delete guestbook
List projectsargocd proj list
End the sessionargocd logout argocd.example.com

Note: argocd app rollback doesn't work while automated sync is turned on, because auto-sync would immediately put the app back to what Git says. Disable auto-sync first with argocd app set guestbook --sync-policy none.

Common errors and fixes

SymptomLikely causeFix
Invalid username or password after patching the SecretPlain text was stored in admin.password, or the hash was mangled by shell quotingStore a bcrypt hash and keep the JSON in single quotes
secrets "argocd-initial-admin-secret" not foundWrong namespace, the Secret was already deleted, or Argo CD is older than 1.9Check -n, or reset the password as described above
x509: certificate signed by unknown authority on loginThe server uses a self-signed certificateAdd --insecure for testing only, or install a trusted certificate
Login hangs or fails with gRPC errors behind an IngressThe Ingress or load balancer doesn't pass HTTP/2 gRPC trafficAdd --grpc-web to argocd login
Argo CD server address unspecifiedNo active CLI sessionRun argocd login or use --core
token is expiredThe session token has timed outRun argocd login again

Security practices for the admin account

  • The notes above publish a plain-text password next to a bcrypt hash. If those values were ever used anywhere, treat them as compromised and rotate them.
  • Never commit passwords or hashes to Git, gists or wiki pages. Keep them in a secrets manager.
  • Delete argocd-initial-admin-secret after the first login.
  • Set up SSO (OIDC or Dex) and RBAC in argocd-rbac-cm, then disable the local admin by setting admin.enabled: "false" in argocd-cm.
  • Create separate local accounts or project tokens for CI pipelines rather than sharing admin.

Frequently asked questions

What is the default Argo CD admin password?

Since Argo CD 1.9, the default password is randomly generated and stored in the argocd-initial-admin-secret Secret. You can read it with argocd admin initial-password -n argocd. In 1.8 and earlier it was the name of the argocd-server pod.

Can I put a plain-text password in argocd-secret?

No. admin.password must be a bcrypt hash. You can generate one with argocd account bcrypt --password 'yourpass' or with htpasswd. If you store plain text, every login fails.

How do I reset the Argo CD admin password if I forgot it?

Remove the admin.password and admin.passwordMtime keys from argocd-secret and restart the argocd-server deployment. Argo CD creates a new random password in argocd-initial-admin-secret.

How do I access the Argo CD UI without an Ingress?

Run kubectl -n argocd port-forward svc/argocd-server 8080:443 and open https://localhost:8080 in your browser. You can also point the CLI at localhost:8080 with --insecure.

When should I use –grpc-web with argocd login?

Use it when Argo CD sits behind an Ingress or load balancer that doesn't support HTTP/2 gRPC. The flag sends CLI traffic as gRPC-Web over HTTP/1.1.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

GitOps vs. DevOps: What Are The Differences?

Versus often compares two sides to see which one is better but in the case of GitOps and DevOps, the two are considered more of complimentary methodologies…

Read More

Top 10 GitOps Tools: Features, Pros, Cons & Comparison

Introduction GitOps tools enable teams to manage infrastructure and application deployments using Git as the single source of truth. In a GitOps model, desired system statesโ€”such as…

Read More

Feature-by-Feature Comparison: Argo CD vs Flux

Here is a very comprehensive, feature-by-feature comparison between Argo CD and Flux, including: ๐Ÿ“Š Feature-by-Feature Comparison: Argo CD vs Flux Feature Argo CD Flux GitOps Core Functionality…

Read More

GitOps Tutorial

Introduction to GitOps GitOps is a modern approach to managing infrastructure and application deployments using Git as the single source of truth. It leverages Git repositories to…

Read More

What is GitOps and use cases of GitOps?

What is GitOps ? GitOps is a modern approach to managing infrastructure and applications by treating their desired state as code stored in Git repositories. It leverages…

Read More

What is ArgoCD and use cases of ArgoCD?

What is ArgoCD ? ArgoCD is an open-source, Kubernetes-native, declarative continuous delivery (CD) tool that empowers you to manage and deploy applications to your Kubernetes clusters through…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x