添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
听话的手套  ·  VueJS place multiple ...·  1 年前    · 
失恋的面包  ·  Polyaxon's Auxiliary ...·  1 年前    · 
很酷的小熊猫  ·  tkinter选择文件夹-掘金·  1 年前    · 
兴奋的脆皮肠  ·  draft-ietf-oauth-pop-a ...·  1 年前    · 

I'm installing kubernetes(kubeadm) on centos VM running inside Virtualbox , so with yum I installed kubeadm, kubelet and docker .

Now while trying to setup cluster with kubeadm init --pod-network-cidr=192.168.56.0/24 --apiserver-advertise-address=192.168.56.33/32 i run into the following error :

Unable to update cni config: No networks found in /etc/cni/net.d
Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

So I checked, no cni folder in /etc even that kubernetes-cni-0.6.0-0.x86_64 is installed. I Tried commenting KUBELET_NETWORK_ARGS in /etc/systemd/system/kubelet.service.d/10-kubeadm.conf but it didn't work.

  • I'm installing behind proxy.

  • I have multiple network adapters:

  • NAT : 10.0.2.15/24 for Internet

  • Host Only : 192.168.56.33/32

  • And docker interface : 172.17.0.1/16

  • There are several points to remember when setting up the cluster with "kubeadm init" and it is clearly documented on the Kubernetes site kubeadm cluster create:

  • "kubeadm reset" if you have already created a previous cluster
  • Remove the ".kube" folder from the home or root directory
  • (Also stopping the kubelet with systemctl will allow for a smooth setup)
  • Disable swap permanently on the machine, especially if you are rebooting your linux system
  • And not to forget, install a pod network add-on according to the instructions provided on the add on site (not Kubernetes site)
  • Follow the post initialization steps given on the command window by kubeadm.
  • If all these steps are followed correctly then your cluster will run properly.

    And don't forget to do the following command to enable scheduling on the created cluster:

    kubectl taint nodes --all node-role.kubernetes.io/master-
    

    About how to install from behind proxy you may find this useful:

    install using proxy

    Use this PR (till will be approved):

    kubectl -n kube-system apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml

    it's a known issue: coreos/flannel#1044

    It was a proxy error as mentionned in Github https://github.com/kubernetes/kubernetes/issues/34695

    They suggested to use kubeadm init --use-kubernetes-version v1.4.1 but i change my network entirely (no proxy) and i manage to setup my cluster.

    After that we can setup pod network with kubectl apply -f ... see https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network

    I could not see the helm server version:

    $ helm version --tiller-namespace digital-ocean-namespace
    Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
    Error: could not find a ready tiller pod
    

    The kubectl describe node kubernetes-master --namespace digital-ocean-namespace command was showing the message:

    NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
    

    The nodes was not ready:

    $ kubectl get node --namespace digital-ocean-namespace
    NAME                  STATUS     ROLES    AGE   VERSION
    kubernetes-master     NotReady   master   82m   v1.14.1
    kubernetes-worker-1   NotReady   <none>   81m   v1.14.1
    

    I had a version compatibility issue between Kubernetes and the flannel network.

    My k8s version was 1.14 as seen in the command:

    $ kubectl version
    Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
    

    After re-installing the flannel network with the command:

    kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
    

    I could then see the helm server version:

    $ helm version --tiller-namespace digital-ocean-namespace
    Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.

    site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.9.27.35032