Welcome to the Linux Foundation Forum!

kubeadm init

kubeadm init --config=kubeadm-config.yaml --upload-certs | tee kubeadm-init.out

W0206 18:09:08.995885 39990 strict.go:54] error unmarshaling configuration schema.GroupVersionKind{Group:"kubeadm.k8s.io", Version:"v1beta2", Kind:"ClusterConfiguration"}: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into Go struct field ClusterConfiguration.networking of type v1beta2.Networking
v1beta2.ClusterConfiguration.Networking: readObjectStart: expect { or n, but found 6, error found in #10 byte of ...|working":6,"podSubne|..., bigger context ...|ation","kubernetesVersion":"1.16.1","networking":6,"podSubnet":""}|...
To see the stack trace of this error execute with --v=5 or higher

who could help me.


  • Hi @etofran810,

    Similar errors have been reported when the kubeadm-config.yaml file was not properly formatted. During the copy/paste process, the line numbers (1 through 6) may get copied over, causing errors during the YAML to JSON conversion. In other cases, the last line of the file may end up left-aligned, when it should be indented two spaces to the right.

    Please review your file and ensure there are no line numbers, and that all fields are specified and indented as expected.


  • ok , I modified file and now I have the follow error

    error converting YAML to JSON: yaml: line 6: mapping values are not allowed in this context

    apiVersion: kubeadm.k8s.io/v1beta2
    kind: ClusterConfiguration
    kubernetesVersion: 1.16.1 #<-- Use the word stable for newest version
    controlPlaneEndpoint: "k8smaster:6443" #<-- Use the node alias not the IP
    networking: 6

    my IP is ens33 inet

  • chrispokornichrispokorni Posts: 504
    edited February 7

    Your file includes extra characters, producing YAML parsing errors.
    Also, the podSubnet: ... line seems to not be indented as expected, but it could be just the forum editor removing the two expected blank spaces when pasting the text in the comment field.

    It also appears that your host IP overlaps the pod subnet. This could cause serious issues when bootstrapping your cluster. In order to avoid such issues, I would suggest modifying either your host IPs in your hypervisor's configuration, OR keep the host IPs as they are but modify the podSubnet: value in the kubeadm-config.yaml file together with the value of CALICO_IP4POOL_CIDR in the calico.yaml file, which is presented in the YAML code block of step 9 of lab exercise 3.1.


Sign In or Register to comment.