Linux kubernetes中容器的参数-c是什么
我已经附上了Kubernetes脚本,其中的参数是-c为什么不需要提供它Linux kubernetes中容器的参数-c是什么,linux,kubernetes,sh,Linux,Kubernetes,Sh,我已经附上了Kubernetes脚本,其中的参数是-c为什么不需要提供它 apiVersion: apps/v1 kind: Deployment metadata: annotations: deployment.kubernetes.io/revision: "1" labels: run: ngn name: ngn namespace: default spec: replicas: 1 selector: matchL
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
labels:
run: ngn
name: ngn
namespace: default
spec:
replicas: 1
selector:
matchLabels:
run: ngn
template:
metadata:
labels:
run: ngn
spec:
containers:
- image: nginx
imagePullPolicy: Always
name: ngn
command: ["/bin/sh"]
args: ["-c", "while true; do echo hello; sleep 10;done"]
您在这里询问的-c是/bin/sh的一个参数,在您提供的代码段中,它是true;打招呼;睡眠10;作为参数对/bin/sh执行
这有助于我理解
-c Read commands from the command_string operand instead of from the standard input. Special parameter 0 will be set from the
command_name operand and the positional parameters ($1, $2, etc.) set from the remaining argument operands.