FailedScheduling:0/3 个节点可用:3 个 Pod 不足 [英] FailedScheduling: 0/3 nodes are available: 3 Insufficient pods

查看:28
本文介绍了FailedScheduling:0/3 个节点可用:3 个 Pod 不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 NodeJS 应用程序部署到 EKS 并使用完全相同的容器运行 3 个 Pod.

I'm trying to deploy my NodeJS application to EKS and run 3 pods with exactly the same container.

错误信息如下:

$ kubectl get pods
NAME                                 READY   STATUS             RESTARTS   AGE
cm-deployment-7c86bb474c-5txqq       0/1     Pending            0          18s
cm-deployment-7c86bb474c-cd7qs       0/1     ImagePullBackOff   0          18s
cm-deployment-7c86bb474c-qxglx       0/1     ImagePullBackOff   0          18s
public-api-server-79b7f46bf9-wgpk6   0/1     ImagePullBackOff   0          2m30s

$ kubectl describe pod cm-deployment-7c86bb474c-5txqq
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  23s (x4 over 2m55s)  default-scheduler  0/3 nodes are available: 3 Insufficient pods.

所以它说 0/3 个节点可用 但是,如果我运行kubectl 获取节点 --watch

So it says that 0/3 nodes are available However, if I run kubectl get nodes --watch

$ kubectl get nodes --watch
NAME                                                 STATUS   ROLES    AGE    VERSION
ip-192-168-163-73.ap-northeast-2.compute.internal    Ready    <none>   6d7h   v1.14.6-eks-5047ed
ip-192-168-172-235.ap-northeast-2.compute.internal   Ready    <none>   6d7h   v1.14.6-eks-5047ed
ip-192-168-184-236.ap-northeast-2.compute.internal   Ready    <none>   6d7h   v1.14.6-eks-5047ed

3 个 Pod 正在运行.

3 pods are running.

这是我的配置:

aws-auth-cm.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system
data:
  mapRoles: |
    - rolearn: [MY custom role ARN]
      username: system:node:{{EC2PrivateDNSName}}
      groups:
        - system:bootstrappers
        - system:nodes


deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: cm-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: cm-literal
  template:
    metadata:
      name: cm-literal-pod
      labels:
        app: cm-literal
    spec:
      containers:
        - name: cm
          image: docker.io/cjsjyh/public_test:1
          imagePullPolicy: Always
          ports:
            - containerPort: 80
          #imagePullSecrets:
          #  - name: regcred
          env:
            [my environment variables]

我应用了两个 .yaml 文件

I applied both .yaml files

我该如何解决这个问题?谢谢

How can I solve this? Thank you

推荐答案

我的猜测是,如果不运行清单,您的图像上的图像标签 1 不存在,所以你得到 ImagePullBackOff 这通常意味着容器运行时找不到要拉的图像.

My guess, without running the manifests you've got is that the image tag 1 on your image doesn't exist, so you're getting ImagePullBackOff which usually means that the container runtime can't find the image to pull .

查看 Docker 中心 页面 没有 1 标记在那里,只是 latest.

Looking at the Docker Hub page there's no 1 tag there, just latest.

因此,删除标记或将 1 替换为 latest 可能会解决您的问题.

So, either removing the tag or replace 1 with latest may resolve your issue.

这篇关于FailedScheduling:0/3 个节点可用:3 个 Pod 不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆