Welcome to the Linux Foundation Forum!

kubectl on calico yaml gives errors

In 'Installation and Configuration' Lab section 16, I am trying to run kubectl on downloaded calico yaml to setup network plugin configuration. During this, I get following error.

[email protected]<>:~$ kubectl apply -f calico.yaml
configmap/calico-config unchanged
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org configured
......
.....
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers unchanged
clusterrole.rbac.authorization.k8s.io/calico-node unchanged
clusterrolebinding.rbac.authorization.k8s.io/calico-node unchanged
error: error parsing calico.yaml: error converting YAML to JSON: yaml: line 182: did not find expected '-' indicator

Has anyone come across and solved this error? Thanks in advance

Comments

  • karthickmekarthickme Posts: 2

    I use AWS and have installed Ubuntu 18.0.4, all kube packages as 19.0.4. I am able to execute kubeadm, kubectl commands, just that the network configuration does not work with the documented 'kubectl apply -f calico.yaml' throws error

  • chrispokornichrispokorni Posts: 1,065

    Hi @karthickme,

    The error you see is related to the YAML formatting of the file - it may be incorrect indentation, or a field/property that is not found where expected.

    I recommend downloading the calico.yaml file once more, and if any edits are necessary, to pay close attention at the YAML formatting of the file while the file is being saved. Revise the file after the Save action, to ensure it was saved with the expected format. If no edits are made, then just run the kubectl apply ... command as presented in the lab exercise guide.

    Regards,
    -Chris

  • chrispokornichrispokorni Posts: 1,065

    I also see you are mentioning the following:

    ... kube packages as 19.0.4...

    I am not familiar with this version. Did you mean Kubernetes release 1.19.4? Please keep in mind that the latest course content begins with Kubernetes release 1.19.1, with an upgrade to 1.20.1 following in a later lab exercise.

    Regards,
    -Chris

Sign In or Register to comment.