gshabi
gshabi

Reputation: 181

Argocd getting started guide getting FATA[0000] configmap "argocd-cm" not found error

I just tried to go over the getting started guide of Argocd found here https://argo-cd.readthedocs.io/en/stable/getting_started/.
I did steps 1 and 2 and then ran the command argocd login --core to skip steps 3-5 (as it said in the guide).
when running the next command
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default.
to apply the app itself I got the following error: FATA[0000] configmap "argocd-cm" not found. Although I did find it on the cluster with the label app.kubernetes.io/part-of: argocd.
I also tried going back to steps 3-5 and changing the server and namespace but some steps didn't work or I didn't know what to do in them, I also got the same error during the second command of step 5. Thanks for the help.

Upvotes: 18

Views: 17100

Answers (4)

xorinzor
xorinzor

Reputation: 6477

For some reason my ~/.kube directory was configured with root:root permissions; this caused kubectl to be unable to switch contexts.

This problem only showed up for me once I manually tried to execute kubectl config set-context --current --namespace=argocd (it would say: error: open /home/user/.kube/config.lock: permission denied).

Once I corrected these permissions the argocd login command correctly switched contexts (despite claiming the same earlier) and it was no longer complaining about being unable to find argocd-cm.

Upvotes: 0

Riuzaky
Riuzaky

Reputation: 41

Is mandatory to set the labels to argocd be able to find the config map:

metadata:
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
  namespace: argocd

Upvotes: 4

Martin Tovmassian
Martin Tovmassian

Reputation: 1468

As noticed by @emile-tenezakis if it is a current namespace issue you can also use the argocd --namespace or -n flag to specify the targeted namespace.

I encountered the same error when running the export command:

argocd admin export
FATA[0000] configmaps "argocd-cm" not found 

And I was able to make it work like so:

argocd -n argocd admin export

Upvotes: 9

Emile Tenezakis
Emile Tenezakis

Reputation: 481

Although the configmap is in the argocd namespace, if argocd is not your current namespace, it won't work. To make sure it is, run :

kubectl config set-context --current --namespace=argocd

That solved it for me. Command from How to switch namespace in kubernetes

Upvotes: 44

Related Questions