Kcna Kubernetes And Cloud Native Associate · Free Practice Question Medium

Question 7

How can you manually assign a pod to a specific node in a Kubernetes cluster?

  • A

    use a label selector in the node field on the node configuration

  • B

    specify the node's IP address in the nodeNameIP field

  • C

    provide the name of the target node in the nodeName field in the pod definition file

  • D

    add the pod's name as the podName value on the cluster node configuration

Reveal correct answer

Correct answer: C

Explanation

To assign a pod to a specific node in Kubernetes, you can use the nodeName field in your pod manifest and specify the name of the target node. This ensures that the pod is scheduled to run on the specified node.

https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename

A. Using a label selector in the node field on the node configuration is not the correct way to manually assign a pod to a specific node in a Kubernetes cluster. Label selectors are used for selecting pods based on labels, not for assigning pods to specific nodes.

B. Specifying the node's IP address in the nodeNameIP field is not the correct method for manually assigning a pod to a specific node in a Kubernetes cluster. The nodeName field should be used to specify the name of the target node, not the IP address.

C. By providing the name of the target node in the nodeName field in the pod definition file, you can manually assign a pod to a specific node in a Kubernetes cluster. This allows you to control the placement of the pod on a particular node based on your requirements.

D. Adding the pod's name as the podName value on the cluster node configuration is not the correct approach for manually assigning a pod to a specific node in a Kubernetes cluster. The nodeName field in the pod definition file should be used to specify the target node for pod assignment.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need