[英]Google Kubernetes Engine (GKE) CPU/pod
On GKE I have created a cluster with 1 node and n1-standard-1 instance type (vCPU:1, RAM: 3.75 GB). 在GKE上,我创建了一个具有1个节点和n1-standard-1实例类型(vCPU:1,RAM:3.75 GB)的集群。 The main purpose of the cluster is to host an application that has 3 pods (mysql, backend and frontend) on default namespace.
群集的主要目的是托管一个在默认名称空间上具有3个Pod(mysql,后端和前端)的应用程序。 I can deploy mysql with no problem.
我可以毫无问题地部署mysql。 After that when I try to deploy the backend it just remains in "Pending" state saying that not enough CPU is available.
之后,当我尝试部署后端时,它只是保持“ Pending”状态,表示没有足够的CPU可用。 The message is very verbose.
该消息非常冗长。
So my question is, is it not possible to have 3 pods running using 1 cpu unit? 所以我的问题是,使用1个CPU单元不能运行3个Pod吗? I want is reduce cost and let those pods use the same cpu.
我要降低成本,并让这些Pod使用相同的CPU。 Is it possible to achieve that?
有可能实现这一目标吗? If yes, then how?
如果是,那怎么办?
The error message "pending" is not that informative. 错误消息“待处理”不是那么有用。 Could you please run
你能跑吗
kubectl get pods
and get your pod name and again run 并获取您的广告连播名称,然后再次运行
kubectl describe pod {podname}
then you can get a idea about the error message. 那么您就可以对错误消息有所了解。
By the way you can run 3 pods in a single cpu. 顺便说一下,您可以在一个CPU中运行3个Pod。
Yes, it is possible to have multiple pods, or 3 in your case, on a single CPU unit. 是的,单个CPU单元上可以有多个吊舱,也可以是3个。
If you want to manage your memory resources, consider putting constraints such as those described in the official docs . 如果要管理内存资源,请考虑放置一些约束,如官方文档中所述 。 Below is an example.
下面是一个例子。
apiVersion: v1
kind: Pod
metadata:
name: frontend
spec:
containers:
- name: db
image: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "password"
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
One would need more information regarding your deployment to answer your queries in a more detailer manner. 人们可能需要有关部署的更多信息,才能以更详细的方式回答您的查询。 Please consider providing the same.
请考虑提供相同的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.