Kubernetes pod desc 显示 "connection refused" 错误

Kubernetes pod desc shows "connection refused" error

我是 Kubernetes 新手。我 运行 想出了解决 Pod 状态卡在 ContainerCreating 的想法。我正在处理来自 AWS (https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#eks-guestbook), the sample is very similar to the official sample (https://kubernetes.io/docs/tutorials/stateless-application/guestbook/) 的示例应用程序。

非常感谢任何在寻找根本原因方面提供指导的人:

为什么我会收到 conn refused 错误,端口 50051 有什么作用?谢谢

$ kubectl get pods --all-namespaces

NAMESPACE     NAME                        READY   STATUS              RESTARTS   AGE
default       guestbook-8k9pp             0/1     ContainerCreating   0          15h
default       guestbook-b2n49             0/1     ContainerCreating   0          15h
default       guestbook-gtjnj             0/1     ContainerCreating   0          15h
default       redis-master-rhwnt          0/1     ContainerCreating   0          15h
default       redis-slave-b284x           0/1     ContainerCreating   0          15h
default       redis-slave-vnlj4           0/1     ContainerCreating   0          15h
kube-system   aws-node-jkfg8              0/1     CrashLoopBackOff    273        1d
kube-system   aws-node-lpvn9              0/1     CrashLoopBackOff    273        1d
kube-system   aws-node-nmwzn              0/1     Error               274        1d
kube-system   kube-dns-64b69465b4-ftlm6   0/3     ContainerCreating   0          4d
kube-system   kube-proxy-cxdj7            1/1     Running             0          1d
kube-system   kube-proxy-g2js4            1/1     Running             0          1d
kube-system   kube-proxy-rhq6v            1/1     Running             0          1d

$ kubectl describe pod guestbook-8k9pp

Name:           guestbook-8k9pp
Namespace:      default
Node:           ip-172-31-91-242.ec2.internal/172.31.91.242
Start Time:     Wed, 31 Oct 2018 04:59:11 -0800
Labels:         app=guestbook
Annotations:    <none>
Status:         Pending
IP:             
Controlled By:  ReplicationController/guestbook
Containers:
  guestbook:
    Container ID:   
    Image:          k8s.gcr.io/guestbook:v3
    Image ID:       
    Port:           3000/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-jb75l (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  default-token-jb75l:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-jb75l
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age                    From                                    Message
  ----     ------                  ----                   ----                                    -------
  Normal   SandboxChanged          11m (x19561 over 13h)  kubelet, ip-172-31-91-242.ec2.internal  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  74s (x19368 over 13h)  kubelet, ip-172-31-91-242.ec2.internal  Failed create pod sandbox: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up pod "guestbook-8k9pp_default" network: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: **desc = "transport: Error while dialing dial tcp 127.0.0.1:50051: connect: connection refused"**

我创建的 Kubernetes 集群在 AWS EKS 上。 EKS 集群是我通过 EKS 控制台手动创建的。

我已经为 EKS 集群 (https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2018-08-30/amazon-eks-vpc-sample.yaml) 创建了第二个带有官方 VPC 示例的集群,它现在似乎可以正常工作。

所以应该是VPC配置的问题。一旦我弄清楚到底出了什么问题,请post提供信息,谢谢。

我遇到了类似的问题。相同的错误消息,但一组 Pods 更简单。 使用 kubectl get pods --all-namespaces 它表明一个特定节点有 CrashLoopBackOff。

我缩小了我的节点,然后又缩小了(有效地重新创建了那个节点),这个问题似乎已经消失了。