英文:
Container Failing to deploy on GKE
问题
我有一个用Go语言编写的容器。它可以在我的DockerDesktop上部署和运行,也可以在我的Kubernetes集群中的DockerDesktop上运行。
我已经将相同的容器推送到了Artifact Repository,但无法部署。
所以我将它部署到了CloudRun上,它可以正常工作!非常困惑。
我的GKE集群是自动驾驶模式,所以我认为没有资源问题。
我期望能够获得一个正在运行的容器,但实际上我得到的是:
无法调度Pod:CPU不足。
PodUnschedulable
原因
无法调度Pod:CPU不足。
了解更多
来源
gmail-sender-7944d6d4d4-tsdt9
gmail-sender-7944d6d4d4-pc9xp
gmail-sender-7944d6d4d4-kdlds
PodUnschedulable 无法调度Pod:内存不足。
我的部署文件如下:
apiVersion: apps/v1
kind: Deployment
metadata:
name: gmail-sender
labels:
app: gmail-sender
spec:
replicas: 1
selector:
matchLabels:
app: gmail-sender
template:
metadata:
labels:
app: gmail-sender
spec:
containers:
- name: gmail-sender
image: europe-west2-docker.pkg.dev/ea-website-359514/gmail-sender/gmail-sender:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8099
---
apiVersion: v1
kind: Service
metadata:
name: gmail-sender-cluster-ip
labels:
app: gmail-sender
spec:
ports:
- port: 8099
protocol: TCP
英文:
I have a container written in go. It deploys and runs on my DockerDesktop & on my Kubernetes cluster in DockerDesktop.
I have pushed the same container to Artefact Repository and it fails to deploy.
So I deployed it to CloudRun, and it works! Very confused.
My GKE cluster is autopilot so I assume the are no resource issues.
I expected to get a running container however i got
Cannot schedule pods: Insufficient cpu.
PodUnschedulable
Reason
Cannot schedule pods: Insufficient cpu.
Learn more
Source
gmail-sender-7944d6d4d4-tsdt9
gmail-sender-7944d6d4d4-pc9xp
gmail-sender-7944d6d4d4-kdlds
PodUnschedulable Cannot schedule pods: Insufficient memory.
My deployment file is as follows
apiVersion: apps/v1
kind: Deployment
metadata:
name: gmail-sender
labels:
app: gmail-sender
spec:
replicas: 1
selector:
matchLabels:
app: gmail-sender
template:
metadata:
labels:
app: gmail-sender
spec:
containers:
- name: gmail-sender
image: europe-west2-docker.pkg.dev/ea-website-359514/gmail-sender/gmail-sender:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8099
---
apiVersion: v1
kind: Service
metadata:
name: gmail-sender-cluster-ip
labels:
app: gmail-sender
spec:
ports:
- port: 8099
protocol: TCP
答案1
得分: 1
根据错误信息,很明显节点的内存和CPU不足以安排/运行工作负载。请检查节点配置,并确保节点上有足够的资源来承载工作负载。
无法调度Pod:CPU不足。
PodUnschedulable原因:无法调度Pod:CPU不足。
了解更多来源:gmail-sender-7944d6d4d4-tsdt9
gmail-sender-7944d6d4d4-pc9xp gmail-sender-7944d6d4d4-kdlds PodUnschedulable
无法调度Pod:内存不足。
英文:
Looking at the error it is clear that node doesnt have sufficient memory and cpu to schedule/run the workload. Check the node configuration and ensure that resources are available on the node to host the workload
Cannot schedule pods: Insufficient cpu.
PodUnschedulable Reason Cannot schedule pods: Insufficient cpu.
Learn more Source gmail-sender-7944d6d4d4-tsdt9
gmail-sender-7944d6d4d4-pc9xp gmail-sender-7944d6d4d4-kdlds PodUnschedulable
Cannot schedule pods: Insufficient memory.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论