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 CKS Exam - Topic 1 Question 9 Discussion

SIMULATIONCreate a new ServiceAccount named backend-sa in the existing namespace default, which has the capability to list the pods inside the namespace default.Create a new Pod named backend-pod in the namespace default, mount the newly created sa backend-sa to the pod, and Verify that the pod is able to list pods.Ensure that the Pod is running.
A) Explanation: A service account provides an identity for processes that run in a Pod. When you (a human) access the cluster (for example, usingkubectl), you are authenticated by the apiserver as a particular User Account (currently this is usuallyadmin, unless your cluster administrator has customized your cluster). Processes in containers inside pods can also contact the apiserver. When they do, they are authenticated as a particular Service Account (for example,default). When you create a pod, if you do not specify a service account, it is automatically assigned thedefaultservice account in the same namespace. If you get the raw json or yaml for a pod you have created (for example,kubectl get pods/ -o yaml), you can see thespec.serviceAccountNamefield has beenautomatically set. You can access the API from inside a pod using automatically mounted service account credentials, as described inAccessing the Cluster. The API permissions of the service account depend on theauthorization plugin and policyin use. In version 1.6+, you can opt out of automounting API credentials for a service account by settingautomountServiceAccountToken: falseon the service account: apiVersion: v1 kind: ServiceAccount metadata: name: build-robot automountServiceAccountToken: false ... In version 1.6+, you can also opt out of automounting API credentials for a particular pod: apiVersion: v1 kind: Pod metadata: name: my-pod spec: serviceAccountName: build-robot automountServiceAccountToken: false ... The pod spec takes precedence over the service account if both specify aautomountServiceAccountTokenvalue.

Linux Foundation CKS Exam - Topic 1 Question 9 Discussion

Actual exam question for Linux Foundation's CKS exam
Question #: 9
Topic #: 1
[All CKS Questions]

SIMULATION

Create a new ServiceAccount named backend-sa in the existing namespace default, which has the capability to list the pods inside the namespace default.

Create a new Pod named backend-pod in the namespace default, mount the newly created sa backend-sa to the pod, and Verify that the pod is able to list pods.

Ensure that the Pod is running.

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

0/2000 characters
Una
8 months ago
Yeah, but having specific permissions is way better for security!
upvoted 0 times
...
Edmond
8 months ago
I thought the default service account was enough for most cases?
upvoted 0 times
...
Ruthann
8 months ago
Wait, can you really list pods from inside a pod? Sounds risky.
upvoted 0 times
...
Burma
8 months ago
Totally agree, service accounts are essential for pod security!
upvoted 0 times
...
Charlie
8 months ago
Just created a ServiceAccount named backend-sa in the default namespace.
upvoted 0 times
...
Launa
8 months ago
I feel like I need to double-check the exact commands for creating the service account and pod. I hope I remember the syntax correctly!
upvoted 0 times
...
Kanisha
8 months ago
I'm a bit confused about the automounting feature. Do I need to explicitly set `automountServiceAccountToken` to false for this task?
upvoted 0 times
...
Beata
8 months ago
I think we did a similar question where we had to create a pod with a specific service account. It involved setting the `serviceAccountName` in the pod spec, right?
upvoted 0 times
...
Mendy
9 months ago
I remember we practiced creating service accounts, but I'm not entirely sure how to set the permissions for listing pods.
upvoted 0 times
...
Ressie
9 months ago
I'm leaning towards Option D. Spreading the EC2 instances across multiple AZs, using Auto Scaling, and Spot Instances seems like a solid way to improve reliability.
upvoted 0 times
...
Melda
9 months ago
Hmm, I'm not sure about this one. I know Salesforce has a lot of different tools, but I'm not familiar with all of them. I'll have to think this through carefully.
upvoted 0 times
...
Dana
9 months ago
Hmm, this looks like a tricky one. I'll need to think carefully about the different file systems and their timestamp formats.
upvoted 0 times
...

Save Cancel