简体   繁体   English

在新创建的 kubernetes 集群中启动 POD 时出错 (ContainerCreating)

[英]Error while starting POD in a newly created kubernetes cluster (ContainerCreating)

I am new to Kubernetes.我是 Kubernetes 的新手。 I have created a Kubernetes cluster with one Master node and 2 worker nodes.我创建了一个 Kubernetes 集群,其中包含一个主节点和 2 个工作节点。 I have installer helm for the deployment of apps.我有用于部署应用程序的安装程序掌舵。 I am getting the following error while starting the tiller pod启动舵柄时出现以下错误

tiller-deploy-5b4685ffbf-znbdc 0/1 ContainerCreating 0 23h分蘖部署 5b4685ffbf-znbdc 0/1 ContainerCreating 0 23h

After describing the pod I got the following result描述 pod 后,我得到以下结果

[root@master-node flannel]# kubectl --namespace kube-system describe pod tiller-deploy-5b4685ffbf-znbdc [root@master-node flannel]# kubectl --namespace kube-system 描述 pod Tiller-deploy-5b4685ffbf-znbdc

Events: Type Reason Age From Message事件:键入消息中的原因年龄

Warning FailedCreatePodSandBox 10m (x34020 over 22h) kubelet, worker-node1 (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "cdda0a8ae9200668a2256e8c7b41904dce604f73f0282b0443d972f5e2846059" network for pod "tiller-deploy-5b4685ffbf-znbdc": networkPlugin cni failed to set up pod "tiller-deploy-5b4685ffbf-znbdc_kube-system" network: open /run/flannel/subnet.env: no such file or directory Normal SandboxChanged 25s (x34556 over 22h) kubelet, worker-node1 Pod sandbox changed, it will be killed and re-created.警告FailedCreatePodSandBox 10M(x34020超过22小时)kubelet,工人节点1(从类似事件的组合):无法创建荚沙:RPC错误:代码=未知DESC =未能建立沙箱集装箱分蘖部署“cdda0a8ae9200668a2256e8c7b41904dce604f73f0282b0443d972f5e2846059”网络荚” -5b4685ffbf-znbdc": networkPlugin cni 无法设置 pod "tiller-deploy-5b4685ffbf-znbdc_kube-system" network: open /run/flannel/subnet.env: no such file or directory Normal SandboxChanged 25s (x34556) over kubeleth ,worker-node1 Pod 沙箱变了,会被kill掉重新创建。

Any hint of how can I get away with this error.关于如何摆脱此错误的任何提示。

You need to setup a CNI plugin such as Flannel.您需要设置一个 CNI 插件,例如 Flannel。 Verify if all the pods in kube-system namespace are running.验证 kube-system 命名空间中的所有 pod 是否都在运行。

To apply flannel in you cluster run the following command:要在集群中应用法兰绒,请运行以下命令:

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

For flannel to work correctly pod-network-cidr should be 10.244.0.0/16 or if you have a different CIDR, you can customize flannel manifest (kube-flannel.yml) according to your needs.为了让 flannel 正常工作,pod-network-cidr 应该是10.244.0.0/16或者如果您有不同的 CIDR,您可以根据需要自定义 flannel manifest (kube-flannel.yml)。

Example:例子:

  net-conf.json: |
    {
      "Network": "10.10.0.0/16",
      "Backend": {
        "Type": "vxlan"
      }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM