Anish Nagaraj:
This is Lighning 2 Q4. I am unable to find out what is wrong with this definition. Could somebody help please?
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: my-busybox
name: my-busybox
namespace: dev2406
spec:
nodeName: controlplane
volumes:
- name: secret-volume
secret:
secretName: dotfile-secret
containers:
- command:
- sleep
- "3600"
image: busybox
name: my-busybox
resources: {}
volumeMounts:
- name: secret-volume
mountPath: "/etc/secret-volume"
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
Memo Toro:
Unless you copy/paste in the wrong format, the kind is wrong. You are missing a new line after Pod. metadata is an item at the root level after kind
Shivraj Sonth:
yes…the kind and metadata should be in different line. Think its a copy paste error.
Anish Nagaraj:
Let me quickly correct. It is just a error in when copied pasted
Shivraj Sonth:
check the container name
Shivraj Sonth:
should it be secret?
Shivraj Sonth:
i randomly remember a question similar to this in LL
Memo Toro:
What is the question?
Anish Nagaraj:
No the name in the question is my-busybox
Anish Nagaraj:
My pod is running but when checking the answers it shows to be failed
Shivraj Sonth:
can u post the question?
Anish Nagaraj:
Create a pod called my-busybox
in the dev2406
namespace using the busybox
image. The container should be called secret
and should sleep for 3600
seconds.
The container should mount a read-only
secret volume called secret-volume
at the path /etc/secret-volume
. The secret being mounted has already been created for you and is called dotfile-secret
.
Make sure that the pod is scheduled on master/controlplane
and no other node in the cluster.
Anish Nagaraj:
This is the question
Shivraj Sonth:
“the container should be called secret”
Shivraj Sonth:
change the name to secret and rerun
Anish Nagaraj:
I just realised that too. Thnak you!