Open csantanapr opened 1 year ago
NINJA EDIT: Just updated to the latest and greatest argo v2.7.8 and I still have this problem.
Not to dog pile the issue but I am going to dogpile the issue...
I am getting the same errors from my automation when trying to add clusters to argo using the argocd cluster add command.
I have validated that the argo-cm configmap has the correct labels:
...
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
...
Install code snippit:
...
kubectl config set-context --current --namespace=argocd
./bin/argocd login $ARGOSERVER --core
for resource_group in $(az aks list | grep resourceGroup | grep -v subscriptions | cut -f 4 -d \")
do
cluster=${resource_group/-rg-/-aks-}
az aks get-credentials -g $resource_group -n $cluster --admin --file ${KUBECONFIG}
yes y | ./bin/argocd cluster add ${cluster}-admin
done
...
The logs look like:
time="2023-07-21T09:26:15-04:00" level=info msg="ServiceAccount \"argocd-manager\" already exists in namespace \"kube-system\""
time="2023-07-21T09:26:15-04:00" level=info msg="Role \"argocd/argocd-manager-role\" created"
time="2023-07-21T09:26:15-04:00" level=info msg="RoleBinding \"argocd/argocd-manager-role-binding\" created"
time="2023-07-21T09:26:16-04:00" level=fatal msg="configmap \"argocd-cm\" not found"
If I do something like yes y | ./bin/argocd --namespace argocd cluster add ${cluster}-admin
I will get an error that the namespace doesn't exist on the target cluster.
SOLVED: The az login
also changes the default context, and marks it as active. I had to use kubectl to point back at the argo server after doing the az login
so it could find the configmap.
Installed argocd core using the core-install.yaml manifest.
➜ argocd version
argocd: v2.8.0+804d4b8
BuildDate: 2023-08-07T19:41:16Z
GitCommit: 804d4b8ca6bc4c2cf02c5c971aa923ec5b8623f0
GitTreeState: clean
GoVersion: go1.20.6
Compiler: gc
Platform: linux/amd64
I'm also seeing this issue. Commands don't seem to be honoring the --namespace
option. I can only get argocd commands to work if I switch the entire kubernetes config context to use the argocd
namespace.
# Kubeconfig set with environment var
➜ export KUBECONFIG=/home/jgreat/.../cluster.yaml
# Set to default namespace
➜ argocd admin dashboard
FATA[0000] configmap "argocd-cm" not found
# Try with --namespace
➜ argocd --namespace argocd admin dashboard
FATA[0000] configmap "argocd-cm" not found
# Switch context in config file
➜ kubens argocd
✔ Active namespace is "argocd"
# now it works?
➜ argocd admin dashboard
Argo CD UI is available at http://localhost:8080
Checklist:
argocd version
.Describe the bug
can't start dashboard with cli
try passing namespace
It works if I switch the kubeconfig namespace context
To Reproduce
Install latest version of argocd cli and argocd via helm chart
Version