rancher部署安装好后,无法部署pod

rancher部署安装好后,无法部署pod

部署一个php7后

一直处于updating状态,如下提示

Deployment does not have minimum availability.

最后报错

ReplicaSet "php7-59d6785ff9" has timed out progressing.; Deployment does not have minimum availability.

点击进入pod,发现一直是

ContainerCreating

docker log kubetel后,发现

network: open /run/flannel/subnet.env: no such file or directory

进入webui,进入kubectl

kubectl get pods
kubectl describe pod [pod name]

k for pod "php7-6dc785bc4c-cvpt2": networkPlugin cni failed to set up pod "php7-6dc785bc4c-cvpt2_default" network: open /run/flannel/subnet.env: no such file or directory
  Normal   SandboxChanged          41s (x12 over 3m24s)  kubelet, k8s-master  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  29s (x4 over 74s)     kubelet, k8s-master  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "5e76636f68ec34c883038146ded8577c4353ca1b12883ac66569b3d212d43665" network for pod "php7-6dc785bc4c-cvpt2": networkPlugin cni failed to set up pod "php7-6dc785bc4c-cvpt2_default" network: open /run/flannel/subnet.env: no such file or directory

提示所缺subnet.env文件
通过docker logs kubetel查看容器日志也可以看到缺少文件

解决办法

查看是否有 /run/flannel/subnet.env,没有则创建

FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true

你可能感兴趣的:(docker,k8s,kubernetes,docker,容器)