kubeadm init [panic: assignment to entry in nil map]

12/14/2018

I want to setup k8s Cluster, when I try to use:

kubeadm init --kubernetes-version=v1.11.4 --pod-network-cidr=10.244.0.0/16 --service-cidr=10.96.0.0/12 --apiserver-advertise-address=192.168.178.101 --ignore-preflight-errors=all

Issue screen

It occurs panic´╝Ü

[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
[init] waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests" 
[init] this might take a minute or longer if the control plane images have to be pulled
[apiclient] All control plane components are healthy after 39.506743 seconds
[uploadconfig] storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.11" in namespace kube-system with the configuration for the kubelets in the cluster
[markmaster] Marking the node kube-node as master by adding the label "node-role.kubernetes.io/master=''"
[markmaster] Marking the node kube-node as master by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to the Node API object "kube-node" as an annotation
panic: assignment to entry in nil map
goroutine 1 [running]:
k8s.io/kubernetes/cmd/kubeadm/app/phases/patchnode.annotateNodeWithCRISocket(...)
        /workspace/anago-v1.11.3-beta.0.71+a4529464e4629c/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/phases/patchnode/patchnode.go:39
k8s.io/kubernetes/cmd/kubeadm/app/phases/patchnode.AnnotateCRISocket.func1(0xc4208a22c0)
        /workspace/anago-v1.11.3-beta.0.71+a4529464e4629c/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/phases/patchnode/patchnode.go:34 +0x69
k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient.PatchNode.func1(0xc420638ea0, 0xc4209695af, 0xc42046a101)
        /workspace/anago-v1.11.3-beta.0.71+a4529464e4629c/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient/idempotency.go:218 +0x1b1
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.WaitFor(0xc420295780, 0xc420668ba0, 0xc420638e40, 0x9034ed, 0x167f000)

I try to kubeadm reset or reinstall k8s component, but no effect.

Environment:

  • Centos7
  • Docker 18.09
  • Kubernetes 1.11.4

What's wrong with it? Please help.

-- wento
containers
docker
kubeadm
kubernetes

0 Answers