kubernetes - kubernetes:部署失败来自守护进程的错误响应:OCI 运行时创建失败:
问题描述
我在树莓派上建立了一个两节点集群,并试图建立一个幽灵博客平台。我创建了一个部署,我看到容器正在崩溃,状态为“CrashLoopback”。非常感谢任何有关故障排除的帮助。谢谢
Warning Failed 7m13s kubelet, kube-node-2 Error: failed to start container "ghost": Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/var/lib/docker/volumes/994c880776e4f19087b08dbd0b36362f71ed32a412691f0aac28c6f024ea20ed/_data\\\" to rootfs \\\"/var/lib/docker/overlay2/c83d0b7a7a4e0f576c63c39907aad3d54b4657d6520ca47fbd201e1e3b3a9fe3/merged\\\" at \\\"/var/lib/docker/overlay2/c83d0b7a7a4e0f576c63c39907aad3d54b4657d6520ca47fbd201e1e3b3a9fe3/merged/var/lib/ghost/content\\\" caused \\\"mkdir /var/lib/docker/overlay2/c83d0b7a7a4e0f576c63c39907aad3d54b4657d6520ca47fbd201e1e3b3a9fe3/merged/var/lib/ghost/content: permission denied\\\"\"": unknown
Normal Pulling 6m31s (x5 over 10m) kubelet, kube-node-2 pulling image "arm32v7/ghost"
Normal Created 6m5s (x5 over 9m49s) kubelet, kube-node-2 Created container
Normal Pulled 6m5s (x5 over 9m50s) kubelet, kube-node-2 Successfully pulled image "arm32v7/ghost"
Warning BackOff 18s (x29 over 8m5s) kubelet, kube-node-2 Back-off restarting failed container
我看到它与权限有关,但不确定这些权限是什么。这是 PV 和 PVC 的输出
kubectl describe pv pv-ghost
Name: pv-ghost
Labels: pv=pv-ghost
Annotations: pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass:
Status: Bound
Claim: default/pvc-ghost
Reclaim Policy: Retain
Access Modes: RWX
Capacity: 3Gi
Node Affinity: <none>
Message:
Source:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.178.50
Path: /mnt/ud-hdd/ghost/data
ReadOnly: false
Events: <none>
kubectl describe pvc pvc-ghost
Name: pvc-ghost
Namespace: default
StorageClass:
Status: Bound
Volume: pv-ghost
Labels: <none>
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 3Gi
Access Modes: RWX
Events: <none>
Mounted By: ghost-deployment-6cd67cbb7f-5vh5j
ghost-deployment-6cd67cbb7f-67xtr
ghost-deployment-6cd67cbb7f-fvq8w
ghost-deployment-6cd67cbb7f-sgksk
ghost-deployment-6cd67cbb7f-wgtzf
ghost-deployment-6cd67cbb7f-xrrdc
为 nfs 服务器提供 root 访问权限后出错
kubectl logs ghost-deployment-5759f4855c-294cl
tar: /var/lib/ghost/content.orig: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
解决方案
权限被拒绝错误与以下操作有关:mkdir /var/lib/docker/overlay2/c83d0b7a7a4e0f576c63c39907aad3d54b4657d6520ca47fbd201e1e3b3a9fe3/merged/var/lib/ghost/content: permission denied
从您提供的信息中不清楚,但如果我不得不猜测您正在尝试在 NFS 共享上创建一个目录。如果是这样,您很可能没有 NFS 服务器的写入权限来写入该路径。
推荐阅读
- javascript - 尝试将带有顺风的 MERN 堆栈部署到 Heroku 时构建失败
- python - 以 Python 方式编写多个 for 循环(包括一个类似于 sum() 函数的循环)
- python - 有没有办法从推文中获取不用于过滤推文的单词?
- c - 将 sqlite_exec 响应的行组合成来自 C 中 SQLite 回调的单个字符串
- api - JSON 路径结果名称不匹配。如何解决这个问题?
- python - 在 kivy 中编写新的动态类所需的最少代码?
- c++ - 如何在 C++ 中正确播种具有最大熵的 mersenne_twister RNG
- javascript - 浏览器后退按钮不起作用并且不会更改状态值
- c++ - 如何在c ++中计算重复数
- python - Python以不同的方式保存数据