Hye Jin Park:
Hi everyone. I have a question about kubectl run command.
Problem: declaritive way works fine. but Imperative way doesn’t work…
- This works fine.
apiVersion: v1
kind: Pod
metadata:
labels:
run: test
name: test
spec:
containers:
- args: ["/bin/sh","-c","--","while true; do sleep 60; done;"]
image: busybox
name: test
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
$ kubectl apply -f test.yaml
- This doesn’t work.
kubectl run test --image=busybox -- /bin/bash -c -- while true; do sleep 10; done;
> bash: syntax error near unexpected token 'do'
kubectl run test --image=busybox -- /bin/bash -c -- 'while true; do sleep 10; done;'
> Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown