I was working through the CKAD mock test by CNCF on Killer Shell and question 14 goes like this:
Create a new Secret
secret1
which containsuser=test
andpass=pwd
. The Secret’s content should be available in Podsecret-handler
as environment variablesSECRET1_USER
andSECRET1_PASS
.
The provided solution configures the pod like so:
- name: SECRET1_USER # add
valueFrom: # add
secretKeyRef: # add
name: secret1 # add
key: user # add
- name: SECRET1_PASS # add
valueFrom: # add
secretKeyRef: # add
name: secret1 # add
key: pass # add
However, searching the Kubernetes documentation for secretKeyRef
does not yield any references to this structure, except for:
For each container in your Pod specification, add an environment variable for each Secret key that you want to use to the
env[].valueFrom.secretKeyRef
field
But this text doesn’t provide the name
& value
structure referenced in the mock test solution.
Have I got this wrong or is this a gap in the docs?