'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.



Solution 1:[1]

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

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Emile Tenezakis
Solution 2 Martin Tovmassian