简体   繁体   English

Google Kubernetes引擎(GKE)CPU /吊舱

[英]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.

相关问题 将 AWS IAM 角色授予在 GKE (Google Kubernetes Engine) 中运行的 Pod - Give AWS IAM Role to a pod running in GKE (Google Kubernetes Engine) 在Google Kubernetes Engine(GKE)中挂载Rook卷 - Mounting Rook Volumes in Google Kubernetes Engine (GKE) 在Google Kubernetes Engine(GKE)中使用sysctls - Using sysctls in Google Kubernetes Engine (GKE) kubectl 和 GKE (Google Kubernetes Engine) 未经授权的问题 - kubectl and GKE (Google Kubernetes Engine) unauthorized issue Google Kubernetes Engine(GKE)中的Windows Server容器 - Windows Server Containers in Google Kubernetes Engine (GKE) Google Kube.netes Engine (GKE) 上的 Horizontal Pod Autoscaler (HPA) 通过 Stackdriver 外部指标使用 Ingress LoadBalancer 的后端延迟 - Horizontal Pod Autoscaler (HPA) on Google Kubernetes Engine (GKE) using Backend Latency from an Ingress LoadBalancer via Stackdriver External Metric 基于 Kubernetes 指标的 Google Cloud GKE 水平 pod 自动缩放 - Google cloud GKE horizontal pod autoscaling based on Kubernetes metrics 使用 Google Container Engine (GKE) 和 Stackdriver 监控 Pod 状态并发出警报或重新启动 - Monitoring and alerting on pod status or restart with Google Container Engine (GKE) and Stackdriver Ingress 不适用于 Google Kubernetes Engine (GKE) - Ingress doesn't work on Google Kubernetes Engine (GKE) 在Kubernetes / Google容器引擎(GKE)上使用Stackdriver API进行日志记录 - Logging using Stackdriver API on Kubernetes / Google Container Engine (GKE)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM