Gaurav Garg:
Hi anyone can help on below question
Mock Exam 2 , Ques - 8
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: multi-pod
name: multi-pod
spec:
containers:
- name: jupiter
image: nginx
env:
- name: europa
image: busybox
command: [“sleep”,“4800”]
env:
i have used different combination but still its failing , can anyone plz help
Command: [“sleep”]
args: [“10”]
command: [“/bin/sh”]
args: [“-c”, “sleep 10”] @Tej_Singh_Rana
Tej_Singh_Rana:
Hello, @Gaurav Garg
Your approach is correct but at present validation is looking for:
apiVersion: v1
kind: Pod
metadata:
labels:
run: multi-pod
name: multi-pod
spec:
containers:
- image: nginx
name: jupiter
env:
- name: type
value: planet
- image: busybox
name: europa
command: ["/bin/sh", "-c", "sleep 4800"]
env:
- name: type
value: moon
Tej_Singh_Rana:
For exam perspective, if they specify to add parameters in the args field, then you have to use args field otherwise command field is sufficient and rest depends on question’s description.
command: ["sleep"]
args: ["10"]
–
command: ["/bin/sh"]
args: ["-c", "sleep 10"]
Gaurav Garg:
Thanks @Tej_Singh_Rana its working
Mohamed Ayman:
Yes, you need to pass the lab validation;
command: ["/bin/sh", "-c", "sleep 4800"]
y2kn:
but doesn’t the --command sleep 4800
satisfy what the question is asking for?
Mohamed Ayman:
You have to use this format command: ["/bin/sh", "-c", "sleep 4800"]
to pass the lab validation: