Phani M:
I have a question about the pod command and args - I’m trying to understand what is the difference in these two manifests. Both will bring up a pod successfully in Running status, but the Lightning Lab question#7 is failed even though the busybox pod is running.
apiVersion: v1
kind: Pod
metadata:
labels:
run: secret-1401
name: secret-1401
namespace: admin1401
spec:
containers:
- command:
- sleep
- "4800"
image: busybox
name: secret-1401
volumeMounts:
- name: secret-volume
mountPath: "/etc/secret-volume"
readOnly: true
volumes:
- name: secret-volume
secret:
secretName: dotfile-secret
The above Pod is created using
k run secret-1401 --image=busybox -n admin1401 --restart=Never --command sleep 4800 $do > pod.yaml
Referring to the Solutions of Lightning Lab, Question #7 states to use this manifest:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: secret-1401
name: secret-1401
namespace: admin1401
spec:
volumes:
- name: secret-volume
secret:
secretName: dotfile-secret
containers:
- command:
- sleep
args:
- "4800"
image: busybox
name: secret-admin
volumeMounts:
- name: secret-volume
readOnly: true
mountPath: "/etc/secret-volume"
The only difference I see is mention of args in second one, but when given
--command sleep 4800
there is no args being auto created.
I believe in the exam, it shouldn’t matter, ultimately the Pod should be in Running status in the right namespace. May be @Tej_Singh_Rana please modify the criteria of validating the question/answer before grading the test.
controlplane $ kgp -n admin1401
NAME READY STATUS RESTARTS AGE
secret-1401 1/1 Running 0 96s
controlplane $