【发布时间】:2022-01-19 12:40:12
【问题描述】:
标志“-c”在 Kubernetes Cronjob 中有什么作用?
kind: CronJob
metadata:
name: hello
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
【问题讨论】:
-
你好,它是标准的shell。 “-c”代表命令。所以它要求 shell 二进制运行 date 命令,然后回显一个字符串。如果您在任何 linux 容器中运行“/bin/sh --help”,您可能会得到更好的理解。
-
@François 感谢您的回答!
-
很高兴它有帮助:)
标签: kubernetes command args kubernetes-cronjob