What is wrong in this command -> kubectl run busybox --image=busybox -- /bin/ . . .

vikas mahajan:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
containers:
- name: hello
image: busybox
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster

vikas mahajan:
NAME READY STATUS RESTARTS AGE
nginx 0/1 CrashLoopBackOff 1 8s

vikas mahajan:
Problem remains same with command/ args

vikas mahajan:
does it have some issues

vikas mahajan:
Events:
Type Reason Age From Message
node01 Back-off restarting failed container

vikas mahajan:
date is creating any problem; is there any other of mentioning it ?

chris resnik:
i’m checking, give me a second

chris resnik:
> apiVersion: v1
> kind: Pod
> metadata:
> labels:
> run: busybox
> name: busybox
> spec:
> containers:
> - args:
> - /bin/sh
> - -c
> - date; sleep 3600
> image: busybox
> name: busybox

chris resnik:
this one works and stays running

chris resnik:
> NAME READY STATUS RESTARTS AGE
> nginx 0/1 CrashLoopBackOff 1 8s
this might be because there is a label mismatch between the pod and the container

chris resnik:
pls note that echo hello also only takes just one second to complete

chris resnik:
sleep 3600 will basically take one hour to finish

vikas mahajan:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
containers:
- name: hello
image: nginx
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster

vikas mahajan:
This should run ? but same issue

chris resnik:
do you write this by hand?

chris resnik:
the indentation between containers and the line below looks too big

chris resnik:
like 4 spaces instead of only two

vikas mahajan:
if that was the issue then POD wouldn’t be created … i guess

vikas mahajan:
lemme check it again

vikas mahajan:
Hi Here is the yaml