exam questions

Exam CKA All Questions

View all questions & answers for the CKA exam

Exam CKA topic 1 question 21 discussion

Actual exam question from CNCF's CKA
Question #: 21
Topic #: 1
[All CKA Questions]

SIMULATION
-






Task
-

Schedule a pod as follows:

• Name: nginx-kusc00401
• Image: nginx
• Node selector: disk=spinning

Show Suggested Answer Hide Answer
Suggested Answer: apiVersion: v1 kind: Pod metadata: name: nginx-kusc00401 spec: containers: - name: nginx-kusc00401 image: nginx nodeSelector: disk=spinning

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
2211094
3 months, 1 week ago
here is the answer, but you can also add labels on metadata apiVersion: v1 kind: Pod metadata: name: nginx-kusc00401 spec: containers: - name: nginx-kusc00401 image: nginx nodeSelector: disk: spinning
upvoted 3 times
...
fc146fc
11 months, 2 weeks ago
kubectl label nodes <your-node-name> disk=spinning and then create the below nginx.yaml file apiVersion: v1 kind: Pod metadata: name: nginx labels: env: test spec: containers: - name: nginx image: nginx imagePullPolicy: IfNotPresent nodeSelector: disktype: spinning and finally Kubectl create -f nginx.yaml
upvoted 2 times
...
abu7midan
1 year, 2 months ago
k label node node01 disk=spanning apiVersion: v1 kind: Pod metadata: name: nginx-kusc00401 labels: env: test spec: containers: - name: nginx image: nginx imagePullPolicy: IfNotPresent nodeSelector: disk: spinning
upvoted 4 times
skywalker
1 year, 2 months ago
Should be ssd as disk.. --- apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: run: nginx-kusc00401 name: nginx-kusc00401 spec: containers: - image: nginx name: nginx-kusc00401 nodeSelector: disk: ssd
upvoted 1 times
testingspeedz214
4 months, 2 weeks ago
Wrong. nodeSelector shouled be disk=spinning as specified in the question
upvoted 1 times
...
Stargazer11
1 year ago
No it's Not. Question mentions disk=spinning. So we have to label the node first as disk=spinning.
upvoted 4 times
Nasser_Sam
1 month, 4 weeks ago
Why do you need to label a node? How do you know which node to label? I think the label already exists, and all you need to do is create a pod with a node selector referring to this label.
upvoted 2 times
...
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago