【发布时间】:2022-01-29 07:38:54
【问题描述】:
我正在使用 GKE 的 Autopilot 集群来运行一些 kubernetes 工作负载。将 Pod 安排到其中一个分配的节点大约需要 10 分钟才能停留在 init 阶段。不同节点中的同一个 pod 在几秒钟内就启动了。
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: jobs
spec:
replicas: 1
selector:
matchLabels:
app: job
template:
metadata:
labels:
app: job
spec:
volumes:
- name: shared-data
emptyDir: {}
initContainers:
- name: init-volume
image: gcr.io/dummy_image:latest
imagePullPolicy: Always
resources:
limits:
memory: "1024Mi"
cpu: "1000m"
ephemeral-storage: "10Gi"
volumeMounts:
- name: shared-data
mountPath: /data
command: ["/bin/sh","-c"]
args:
- cp -a /path /data;
containers:
- name: job-server
resources:
requests:
ephemeral-storage: "5Gi"
limits:
memory: "1024Mi"
cpu: "1000m"
ephemeral-storage: "10Gi"
image: gcr.io/jobprocessor:latest
imagePullPolicy: Always
volumeMounts:
- name: shared-data
mountPath: /ebdata1
仅当容器具有 init 容器时才会发生这种情况。在我的情况下,我将一些数据从虚拟容器复制到我安装在实际容器上的共享卷.. 但是,每当 pod 被安排到这个特定节点时,它就会在 init 阶段停留大约 10 分钟,然后自动得到解决。我在事件日志中看不到任何错误。
kubectl 描述节点有问题的节点
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning SystemOOM 52m kubelet System OOM encountered, victim process: cp, pid: 477887
Warning OOMKilling 52m kernel-monitor Memory cgroup out of memory: Killed process 477887 (cp) total-vm:2140kB, anon-rss:564kB, file-rss:768kB, shmem-rss:0kB, UID:0 pgtables:44kB oom_score_adj:-997
只有消息是上述警告。这个问题是由我这边的一些错误配置引起的吗?
【问题讨论】:
-
我可以帮助您了解其他信息吗?如果您认为我的回答对您有所帮助,请考虑通过单击左侧投票箭头下方的复选标记(✔️)来接受它。应将颜色更改为绿色。
标签: kubernetes google-kubernetes-engine