admin 管理员组文章数量: 887019
Kubernetes
Kubernetes | 《Kubernetes in Action中文版》第8章错误
1. 查看容器详情
Name: downward
Namespace: default
Priority: 0
Node: minikube/192.168.64.3
Start Time: Mon, 29 Nov 2021 09:43:23 +0800
Labels: <none>
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Containers:main:Container ID:Image: k8s.gcr.io/busyboxImage ID:Port: <none>Host Port: <none>Command:sleep9999999State: WaitingReason: ContainerCreatingReady: FalseRestart Count: 0Limits:cpu: 500mmemory: 4MiRequests:cpu: 250mmemory: 100KiEnvironment:POD_NAME: downward (v1:metadata.name)POD_NAMESPACE: default (v1:metadata.namespace)POD_IP: (v1:status.podIP)NODE_NAME: (v1:spec.nodeName)SERVICE_ACCOUNT: (v1:spec.serviceAccountName)Mounts:/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4js5b (ro)
Conditions:Type StatusInitialized TrueReady FalseContainersReady FalsePodScheduled True
Volumes:kube-api-access-4js5b:Type: Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds: 3607ConfigMapName: kube-root-ca.crtConfigMapOptional: <nil>DownwardAPI: true
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300snode.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:Type Reason Age From Message---- ------ ---- ---- -------Normal Scheduled 3s default-scheduler Successfully assigned default/downward to minikubeWarning FailedCreatePodSandBox 3s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "downward": Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:348: copying bootstrap data to pipe caused: write init-p: broken pipe: unknownNormal SandboxChanged 1s (x2 over 2s) kubelet Pod sandbox changed, it will be killed and re-created.Warning FailedCreatePodSandBox 1s (x2 over 2s) kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "downward": Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:352: getting the final child's pid from pipe caused: read init-p: connection reset by peer: unknown
2. 原因
给容器分配的内存过低无法启动。
3. 解决办法
- downward-api-env.yaml
- downward-api-volume.yaml
修改上面两个文件中下面标注的两处位置。
# ...
spec:containers:- name: mainimage: busyboxcommand: ["sleep", "9999999"]resources:requests:cpu: 15m# 修改此处memory: 64Milimits:cpu: 100m# 修改此处memory: 128Mi
# ...
本文标签: kubernetes
版权声明:本文标题:Kubernetes 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1687596276h119315.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论