简体   繁体   English

在GCP Kubernetes(GKE)中,如何将部署创建的无状态Pod分配给预配置的vm

[英]In GCP Kubernetes (GKE) how do I assign a stateless pod created by a deployment to a provisioned vm

I have several operational deployments on minikube locally and am trying to deploy them on GCP with kubernetes. 我在本地的minikube上进行了几项操作部署,并且正在尝试使用kubernetes在GCP上进行部署。

When I describe a pod created by a deployment (which created a replication set that spawned the pod): 当我描述由部署创建的容器(该容器创建了一个生成该容器的复制集)时:

kubectl get po redis-sentinel-2953931510-0ngjx -o yaml

It indicates it landed on one of the kubernetes vms. 它表明它已落在kubernetes虚拟机之一上。

I'm having trouble with deployments that work separately failing due to lack of resources eg cpu even though I provisioned a VM above the requirements. 我遇到了由于资源不足(例如cpu)而无法单独工作的部署的问题,即使我提供了超出要求的VM。 I suspect the cluster is placing the pods on it's own nodes and running out of resources. 我怀疑集群正在将Pod放置在其自己的节点上,并且资源不足。

How should I proceed? 我应该如何进行?

Do I introduce a vm to be orchestrated by kubernetes? 我是否会引入一个由kubernetes协调的虚拟机? Do I enlarge the kubernetes nodes? 我是否要扩大kubernetes节点? Or something else all together? 还是其他东西在一起?

It was a resource problem and node pool size was inhibiting the deployments.I was mistaken in trying to provide google compute instances and disks. 这是一个资源问题,节点池的大小限制了部署。我在尝试提供谷歌计算实例和磁盘时弄错了。

I ended up provisioning Kubernetes node pools with more cpu and disk space and solved it. 我最终为Kubernetes节点池配置了更多的cpu和磁盘空间,并解决了它。 I also added elasticity by provisioning autoscaling. 我还通过设置自动缩放功能增加了弹性。

here is a node pool documentation 这是节点池文档

here is a terraform Kubernetes deployment 这是一个Terraform Kubernetes部署

here is the machine type documentation 这是机器类型文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kubernetes pod 与 GCP Compute Engine 虚拟机通信 - Kubernetes pod to GCP Compute Engine VM communication 如何将GCP用户与GKE Kubernetes用户相关联,以进行身份​​验证和后续授权? - How do I relate GCP users to GKE Kubernetes users, for authentication and subsequent authorization? 部署时如何使用Kubernetes将静态IP分配给Pod - How to assign a static IP to a pod using Kubernetes on deployment GCP GKE Kubernetes 的指标服务器无法获取 pod 指标 - metrics-server of GCP GKE Kubernetes is not able to fetch pod metrics Kubernetes RBAC:如何只允许exec部署创建的特定Pod - Kubernetes RBAC: How to allow exec only to a specific Pod created by Deployment Kubernetes:应用部署后未创建Pod - Kubernetes: Pod is not created after applying deployment Kubernetes 仪表板部署存在,未创建 pod - Kubernetes dashboard deployment exists, pod not being created pod 未在 kube.netes 中创建但部署存在? - pod are not getting created in kubernetes but deployment exists? 如何在Kubernetes中注册并查找部署中的各个Pod主机名? - How do I get individual pod hostnames in a Deployment registered and looked up in Kubernetes? 如何在 GKE 中重启 kubernetes 节点(vm 实例) - How to reboot a kubernetes node (vm instance) in GKE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM