Kubernetes/ArgoCD

From Ever changing code
< Kubernetes
Revision as of 10:11, 3 May 2024 by Pio2pio (talk | contribs) (→‎Login)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Install cli

Note: Requires jq

REPO=argoproj/argo-cd
REPO_FILE=argocd-linux-amd64
BINARY=argocd
LATEST=$(curl --silent "https://api.github.com/repos/${REPO}/releases/latest" | jq -r .tag_name | tr -d v); echo ${LATEST}
TEMPDIR=$(mktemp -d)
curl -L https://github.com/${REPO}/releases/download/v${LATEST}/${REPO_FILE} -o ${TEMPDIR}/${BINARY}
sudo install ${TEMPDIR}/${BINARY} /usr/local/bin/${BINARY}

Login

ARGOCD_SERVER=argocd.acme.com
ARGOCD_ADMINPASSWORD=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)

# Usual login
argocd login $ARGOCD_SERVER --username admin --password $ARGOCD_ADMINPASSWORD --grpc-web

# Behind a proxy or ArgoCD is configured only on port 80 (never worked)
argocd login argocd.acme.com --username admin --password $ARGOCD_ADMINPASSWORD --plaintext --port-forward --port-forward-namespace argocd
'admin:login' logged in successfully
Context 'port-forward' updated