U.S. Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation CKAD Exam - Topic 3 Question 69 Discussion

Refer to Exhibit.ContextYou are tasked to create a secret and consume the secret in a pod using environment variables as follow:Task* Create a secret named another-secret with a key/value pair; key1/value4* Start an nginx pod named nginx-secret using container image nginx, and add an environment variable exposing the value of the secret key key 1, using COOL_VARIABLE as the name for the environment variable inside the pod
A) Explanation: Solution:

Linux Foundation CKAD Exam - Topic 3 Question 69 Discussion

Actual exam question for Linux Foundation's CKAD exam
Question #: 69
Topic #: 3
[All CKAD Questions]

Refer to Exhibit.

Context

You are tasked to create a secret and consume the secret in a pod using environment variables as follow:

Task

* Create a secret named another-secret with a key/value pair; key1/value4

* Start an nginx pod named nginx-secret using container image nginx, and add an environment variable exposing the value of the secret key key 1, using COOL_VARIABLE as the name for the environment variable inside the pod

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Veronika
2 months ago
I agree, key1 must match exactly.
upvoted 0 times
...
Tawny
3 months ago
Don't forget to check the key names!
upvoted 0 times
...
Jaclyn
3 months ago
I prefer option C, it seems clearer.
upvoted 0 times
...
Sylvie
3 months ago
I feel confident about it.
upvoted 0 times
...
Amira
3 months ago
This question is tricky!
upvoted 0 times
...
Dolores
3 months ago
I thought we were supposed to avoid using environment variables for secrets?
upvoted 0 times
...
Nobuko
4 months ago
Just make sure to use the right container image, nginx is perfect!
upvoted 0 times
...
Carlee
4 months ago
Wait, can you really expose secrets like that? Seems risky.
upvoted 0 times
...
Ethan
4 months ago
Totally agree, that's the right way to do it!
upvoted 0 times
...
Edmond
4 months ago
You need to create a secret named another-secret with key1/value4.
upvoted 0 times
...
Willie
5 months ago
Haha, I bet the exam writers had a good laugh coming up with "COOL_VARIABLE" as the environment variable name. Gotta love those creative touches!
upvoted 0 times
...
Elmer
5 months ago
Option C looks good, but I'm still a bit confused about the environment variable name. Shouldn't it be something more descriptive?
upvoted 0 times
...
Lucina
5 months ago
I agree, C is the way to go. Straight to the point and gets the job done.
upvoted 0 times
...
Laticia
5 months ago
The correct answer is C. That's the easiest way to create a secret and consume it in a pod.
upvoted 0 times
...
Kimbery
5 months ago
I definitely recall the steps for creating a pod, but I’m uncertain if I need to specify the secret in the pod definition or just in the environment section.
upvoted 0 times
...
Delisa
5 months ago
This question seems similar to one we practiced where we had to expose a config map as an environment variable. I hope I can apply that knowledge here.
upvoted 0 times
...
Na
6 months ago
Ah, I see what I need to do now. I'll create the secret first, then in the pod definition I'll use the `env` field to reference the secret value by its key. Simple!
upvoted 0 times
...
Germaine
6 months ago
I'm a little confused about the difference between the `env` and `envFrom` fields in the pod definition. I'll need to double-check the documentation to make sure I'm using the right one for this task.
upvoted 0 times
...
Marylou
6 months ago
I think I remember how to create a secret, but I'm not entirely sure about the exact command syntax.
upvoted 0 times
...
Merissa
6 months ago
No problem, I've done this kind of task before. I'll use the `kubectl create secret` command to create the secret, and then in the pod definition I'll use the `env` field to expose the secret value as an environment variable.
upvoted 0 times
...
Avery
7 months ago
I think option A looks good.
upvoted 0 times
...
Edwin
7 months ago
I feel a bit confused about the naming conventions for the environment variable. Was it COOL_VARIABLE or something else?
upvoted 0 times
...
Mirta
7 months ago
Hmm, I'm a bit unsure about how to create the secret and then reference it in the pod. I'll need to review the syntax for that.
upvoted 0 times
...
Lanie
7 months ago
Okay, this looks straightforward. I'll start by creating the secret with the key/value pair, then I'll create the nginx pod and add the environment variable to expose the secret value.
upvoted 0 times
Felicidad
2 months ago
And for the pod, you'll use `kubectl run` with the right flags, right?
upvoted 0 times
...
Deeann
2 months ago
I think `kubectl create secret` is the way to go.
upvoted 0 times
...
Vanna
2 months ago
What command will you use to create the secret?
upvoted 0 times
...
Franchesca
2 months ago
Don't forget to name the secret correctly!
upvoted 0 times
...
Angelo
6 months ago
Sounds good! Make sure to double-check the key/value pair.
upvoted 0 times
...
...

Save Cancel