error: yaml: line : mapping values are not allowed in this context



  • Hello, When I run the any kubectl command I get this error, it was working then it stopped all of a sudden.

    $ kubectl get
    error: yaml: line 9: mapping values are not allowed in this context
    $ kubectl get nodes
    error: yaml: line 9: mapping values are not allowed in this context
    


  • I have seen this when using GCP, and gcloud cli, if the credentials or endpoints are not configured properly, for me running this fixed it:

    $ gcloud container clusters get-credentials spaceboy
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for spaceboy. 
    

Log in to reply
 

© Lightnetics 2024