由于内存消耗,我的部署 pod 被驱逐:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning Evicted 1h kubelet, gke-XXX-default-pool-XXX The node was low on resource: memory. Container my-container was using 1700040Ki, which exceeds its request of 0.
Normal Killing 1h kubelet, gke-XXX-default-pool-XXX Killing container with id docker://my-container:Need to kill Pod
我试图通过在我的部署中添加以下内容来授予它更多内存yaml
:
apiVersion: apps/v1
kind: Deployment
...
spec:
...
template:
...
spec:
...
containers:
- name: my-container
image: my-container:latest
...
resources:
requests:
memory: "3Gi"
但是,它未能部署:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 4s (x5 over 13s) default-scheduler 0/3 nodes are available: 3 Insufficient memory.
Normal NotTriggerScaleUp 0s cluster-autoscaler pod didn't trigger scale-up (it wouldn't fit if a new node is added)
部署只请求一个容器。
我正在使用GKE
自动缩放,默认(也是唯一)池中的节点具有 3.75 GB 内存。
通过反复试验,我发现我可以请求的最大内存是“2Gi”。为什么我不能在单个 pod 中使用完整的 3.75 节点?我需要更大内存容量的节点吗?