我从K8s开始,我的DaemonSet资源有问题。当我应用它时,它会进入Running状态,然后是Completed,然后是CrashLoopBackOff,然后再到运行等等。我希望所有的豆荚都处于Running状态。这是我的舱单:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ds-test
labels:
app: busybox-ds
spec:
selector:
matchLabels:
name: busybox-ds
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 3
template:
metadata:
labels:
name: busybox-ds
spec:
containers:
- name: busybox-ds
image: busybox有人能告诉我我做错了什么吗?
发布于 2022-07-27 20:45:58
busybox映像只是作为它的命令运行sh。如果没有与之交互,它就会立即退出,因此你会看到你的吊舱进入Completed状态。
您需要让该映像运行一个命令,该命令将使其进程保持运行。
使用tail -f /dev/null是一种常见的方法。所以你的舱单看起来是:
spec:
containers:
- name: busybox-ds
image: busybox
command:
- tail
- -f
- /dev/nullhttps://stackoverflow.com/questions/73144306
复制相似问题