背景

在阅读k8s资源配置yaml中,看到command中有-c,如 command: ["/bin/sh","-c","touch /tmp/hello.txt;while true;do /bin/echo $(date +%T) >> /tmp/hello.txt; sleep 3; done;"]

作用

就是把-c 后面的字符串做为命令使用

例如

image

image

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐