Update the command/args:
command: [ "/bin/sh", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
Run a command
kubectl exec my-pod -c my-container -- ls /
Get a shell:
kubectl exec -it shell-demo -- /bin/sh
Using an initContainer:
initContainers:
- name: debug
image: busybox:1.28
command: ['sh', '-c', 'echo initContainer! && sleep 3600']
kubectl exec -it my-pod -c debug -- bash