Creating the skeleton of the pod by using imperative command like
kubectl create secret-1401 --image=busybox --dry-run=client -o yaml -- sleep 4800
It gives me the following yaml which I completed with the rest of the requirements of the exercise 7 of the Lighting Labs
apiVersion: v1
kind: Pod
metadata:
labels:
run: secret-1401
name: secret-1401
namespace: admin1401
spec:
volumes:
- name: foo
secret:
secretName: dotfile-secret
containers:
- args:
- sleep
- "4800"
image: busybox
name: secret-admin
volumeMounts:
- name: foo
mountPath: "/etc/secret-volume"
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
Then when I create the pod is running perfectly fine but the corrector of the exercise is not giving me the answer as valid and I need to understand why because I am meeting all the requirements
The right answer is
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: secret-1401
name: secret-1401
namespace: admin1401
spec:
volumes:
- name: secret-volume
# secret volume
secret:
secretName: dotfile-secret
containers:
- command:
- sleep
args:
- "4800"
image: busybox
name: secret-admin
# volumes' mount path
volumeMounts:
- name: secret-volume
readOnly: true
mountPath: "/etc/secret-volume"
I believe the problem is that the imperative commands introduces the command (sleep) and arguments (4800) with the argument section but it is the outcome of the kubectl, plus the Pod is running completely fine.