[英]Kubernetes deploy failed with "Failed create pod sandbox" in GKE
While deploying a new deployment to our GKE cluster, the pod is created but is failing with the following error:在将新部署部署到我们的 GKE 集群时,pod 已创建但失败并显示以下错误:
Failed create pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:319: getting the final child's pid from pipe caused \"read init-p: connection reset by peer\"": unknown
The cluster is not loaded at all, and there is enough free disk, memory and CPU.集群完全没有加载,有足够的空闲磁盘、内存和CPU。
No other issue was seen in the pod/cluster logs.在 pod/cluster 日志中没有发现其他问题。
The issue was eventually in the deployment YAML.问题最终出在部署 YAML 中。
If you encounter a similar issue, check your resources section and verify it has to correct syntax which can be found here: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/如果您遇到类似问题,请检查您的资源部分并验证它是否具有正确的语法,可以在此处找到: https : //kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
In my case, the issue was in the memory value:就我而言,问题出在内存值上:
Working example (Note the Mi):工作示例(注意 Mi):
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 5m
memory: 256Mi
The initial resources definition (BAD SYNTAX):初始资源定义(BAD SYNTAX):
resources:
limits:
cpu: 500m
memory: 256m
requests:
cpu: 5m
memory: 256m
I hope that it'll help other community members in the future, since it took me a decent amount of time to find the root cause in my case...我希望它会在未来帮助其他社区成员,因为我花了相当多的时间来找到我的案例的根本原因......
The RAM resource is measured in bytes . RAM 资源以字节为单位。 You can express RAM as a plain integer or a fixed-point integer with one of these suffixes : E, P, T, G, M, K, Ei, Pi, Ti, Gi, Mi, Ki .您可以将 RAM 表示为带有以下后缀之一的普通整数或定点整数: E, P, T, G, M, K, Ei, Pi, Ti, Gi, Mi, Ki 。
Refer Memory Meaning on Kubernetes Docs请参阅Kubernetes Docs 上的内存含义
CPU resources are defined in millicores . CPU 资源以毫核数定义。 Fractional values are allowed and you can use the suffix m to mean mili when defining CPU limits.允许使用小数值,您可以在定义 CPU 限制时使用后缀 m 表示 mili 。 For example 100m cpu is 100 milicpu, and is the same as 0.1 cpu.比如100m cpu就是100 milicpu,和0.1 cpu一样。
Example : If your container needs one full cores to run, you would put the value “1000m”.示例:如果您的容器需要一个完整的内核来运行,您可以输入值“1000m”。 If your container only needs ¼ of a core, you would put a value of “250m”.如果您的容器只需要 1/4 的核心,您将输入“250m”的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.