无法将Windows Worker加入Kubernetes

时间:2019-05-05 15:13:25

标签: windows docker kubernetes containers

我想要将Windows个工作节点加入到Kubernetes集群中,为此,我点击了此链接 https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/joining-windows-workers?tabs=LogDir#joining-a-flannel-cluster 我的Windows版本是Windows server 2019,而我的Kubernetes主版本在ubuntu 16.04中运行 我将flanneld部署为群集网络。 当我运行此命令时

cd c:\k
.\start.ps1 -ManagementIP 192.168.1.6 -NetworkMode l2bridge  -ClusterCIDR  10.244.0.0/16 -ServiceCIDR 10.96.0.0/12 -KubeDnsServiceIP 10.96.0.10 -LogDir C:\k

我的Windows worker将出现在kubectl get nodes中 但在kubectl get pods中,kube-flannel-ds-amd64-qntps窗格将堆叠为Init:0/1状态,而kube-proxy-njbmv窗格将堆叠为ContainerCreating状态 在运行命令的Powershell中,我得到了这个错误


E0505 07:33:36.252050    5824 pod_workers.go:190] Error syncing pod d52edd7b-6f1f-11e9-886d-fa163ebe3ec2 ("kube-flannel-ds-amd64-qntps_kube-system(d52edd7b-6f1f-11e9-886d-fa163ebe3ec2)"), skipping: failed to "CreatePodSandbox" for "kube-flannel-ds-amd64-qntps_kube-system(d52edd7b-6f1f-11e9-886d-fa163ebe3ec2)" with CreatePodSandboxError: "CreatePodSandbox for pod \"kube-flannel-ds-amd64-qntps_kube-system(d52edd7b-6f1f-11e9-886d-fa163ebe3ec2)\" failed: rpc error: code = Unknown desc = failed to start sandbox container for pod \"kube-flannel-ds-amd64-qntps\": Error response from daemon: network host not found"
E0505 07:33:37.349410    5824 kuberuntime_manager.go:899] PodSandboxStatus of sandbox "5c68c87c154e8c25548bc976106acdd3730ad4f9a0ff04cc9e14d68f1487906c" for pod "kube-proxy-njbmv_kube-system(d52e21e8-6f1f-11e9-886d-fa163ebe3ec2)" error: rpc error: code = Unknown desc = Error: No such container: 5c68c87c154e8c25548bc976106acdd3730ad4f9a0ff04cc9e14d68f1487906c

================================================ =

kubectl describe pod kube-proxy-njbmv -n kube-system

Name:               kube-proxy-njbmv
Namespace:          kube-system
Priority:           2000001000
PriorityClassName:  system-node-critical
Node:               win-db5tvepefhp/192.168.1.6
Start Time:         Sun, 05 May 2019 03:23:32 -0700
Labels:             controller-revision-hash=6488cfdd59
                    k8s-app=kube-proxy
                    pod-template-generation=1
Annotations:        <none>
Status:             Pending
IP:                 192.168.1.6
Controlled By:      DaemonSet/kube-proxy
Containers:
  kube-proxy:
    Container ID:
    Image:         k8s.gcr.io/kube-proxy:v1.14.1
    Image ID:
    Port:          <none>
    Host Port:     <none>
    Command:
      /usr/local/bin/kube-proxy
      --config=/var/lib/kube-proxy/config.conf
      --hostname-override=$(NODE_NAME)
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:
      NODE_NAME:   (v1:spec.nodeName)
    Mounts:
      /lib/modules from lib-modules (ro)
      /run/xtables.lock from xtables-lock (rw)
      /var/lib/kube-proxy from kube-proxy (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-proxy-token-cx5sm (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-proxy:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      kube-proxy
    Optional:  false
  xtables-lock:
    Type:          HostPath (bare host directory volume)
    Path:          /run/xtables.lock
    HostPathType:  FileOrCreate
  lib-modules:
    Type:          HostPath (bare host directory volume)
    Path:          /lib/modules
    HostPathType:
  kube-proxy-token-cx5sm:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kube-proxy-token-cx5sm
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:
                 CriticalAddonsOnly
                 node.kubernetes.io/disk-pressure:NoSchedule
                 node.kubernetes.io/memory-pressure:NoSchedule
                 node.kubernetes.io/network-unavailable:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute
                 node.kubernetes.io/pid-pressure:NoSchedule
                 node.kubernetes.io/unreachable:NoExecute
                 node.kubernetes.io/unschedulable:NoSchedule
Events:
  Type     Reason                  Age                     From                      Message
  ----     ------                  ----                    ----                      -------
  Normal   SandboxChanged          48m (x1866 over 3h47m)  kubelet, win-db5tvepefhp  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  38m (x2079 over 3h47m)  kubelet, win-db5tvepefhp  Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "kube-proxy-njbmv": Error response from daemon: network host not found
  Warning  FailedCreatePodSandBox  21m (x158 over 28m)     kubelet, win-db5tvepefhp  Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "kube-proxy-njbmv": Error response from daemon: network host not found
  Normal   SandboxChanged          16m (x260 over 28m)     kubelet, win-db5tvepefhp  Pod sandbox changed, it will be killed and re-created.
  Normal   SandboxChanged          7m30s (x12 over 7m59s)  kubelet, win-db5tvepefhp  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  2m42s (x60 over 8m)     kubelet, win-db5tvepefhp  Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "kube-proxy-njbmv": Error response from daemon: network host not found

================================

还有kubectl get pod --all-namespaces

NAMESPACE     NAME                             READY   STATUS              RESTARTS   AGE
kube-system   coredns-fb8b8dccf-dmgbj          1/1     Running             0          5h27m
kube-system   coredns-fb8b8dccf-xlldl          1/1     Running             0          5h27m
kube-system   etcd-master                      1/1     Running             0          5h27m
kube-system   kube-apiserver-master            1/1     Running             0          5h26m
kube-system   kube-controller-manager-master   1/1     Running             0          5h27m
kube-system   kube-flannel-ds-amd64-cw9x2      1/1     Running             0          5h27m
kube-system   kube-flannel-ds-amd64-qntps      0/1     Init:0/1            0          4h14m
kube-system   kube-proxy-5jg2b                 1/1     Running             0          5h27m
kube-system   kube-proxy-njbmv                 0/1     ContainerCreating   0          4h14m
kube-system   kube-scheduler-master            1/1     Running             0          5h27m

我不知道这是什么错误,我在哪里弄错了?

0 个答案:

没有答案