nerdexam
Linux_Foundation

CKA · Question #16

Configure the kubelet systemd- managed service, on the node labelled with name=wk8s-node-1, to launch a pod containing a single container of Image httpd named webtool automatically. Any spec files…

To configure the kubelet to automatically launch a specific pod on a node, create a static pod YAML manifest in the node's /etc/kubernetes/manifests directory.

Submitted by diego_uy· May 4, 2026Cluster Architecture, Installation & Configuration

Question

Configure the kubelet systemd- managed service, on the node labelled with name=wk8s-node-1, to launch a pod containing a single container of Image httpd named webtool automatically. Any spec files required should be placed in the /etc/kubernetes/manifests directory on the node. You can ssh to the appropriate node using: [student@node-1] ~$ ssh wk8s-node-1 You can assume elevated privileges on the node with the following command: [student@wk8s-node-1] ~$ sudo -i

Exhibits

CKA question #16 exhibit 1
CKA question #16 exhibit 2

Explanation

To configure the kubelet to automatically launch a specific pod on a node, create a static pod YAML manifest in the node's /etc/kubernetes/manifests directory.

Approach. The question asks to configure the kubelet service on a specific node (wk8s-node-1) to automatically launch a pod with an httpd container, using spec files placed in /etc/kubernetes/manifests. This directly points to the concept of Static Pods.

Here's the step-by-step correct interaction:

  1. Access the node: The question states 'You can ssh to the appropriate node using: [student@node-1] ~$ ssh wk8s-node-1'. Although the terminal is already open, this is the implied starting point.
  2. Elevate privileges: As instructed, 'You can assume elevated privileges on the node with the following command: [student@wk8s-node-1] ~$ sudo -i'. This is crucial for creating files in system directories.
  3. Navigate to the manifest directory: Change directory to the location kubelet monitors for static pods: cd /etc/kubernetes/manifests.
  4. Create the static pod YAML file: Use a text editor (like vi or nano) to create a new YAML file, for example, vi webtool-pod.yaml.
  5. Add the pod definition: Insert the following YAML content into the file:
    apiVersion: v1
    kind: Pod
    metadata:
      name: webtool
    spec:
      containers:
      - name: webtool
        image: httpd
    
    • apiVersion: v1: Specifies the Kubernetes API version for Pods.
    • kind: Pod: Declares this object as a Pod.
    • metadata.name: webtool: Names the pod 'webtool' as required.
    • spec.containers: Defines the container(s) within the pod.
    • name: webtool: Names the container 'webtool' as required.
    • image: httpd: Specifies the 'httpd' image as required.
  6. Save and exit: Save the file (e.g., :wq in vi or Ctrl+X, Y, Enter in nano).

The kubelet service, which runs on the node, continuously scans the /etc/kubernetes/manifests directory. Upon detecting the webtool-pod.yaml file, it will automatically create and manage the specified webtool pod on that node.

Common mistakes.

  • common_mistake. 1. Using kubectl apply -f <file>: This is a common mistake for those used to deploying objects via the Kubernetes API server. However, the question specifically asks to configure kubelet and place files in /etc/kubernetes/manifests, which is the mechanism for static pods directly managed by kubelet on a node, bypassing the API server for creation.
  1. Modifying or applying the DaemonSet shown in the exhibit: The exhibit displays a DaemonSet YAML. A DaemonSet ensures a copy of a Pod runs on all (or selected) nodes and is managed by the Kubernetes control plane, not directly by kubelet through a local manifest file for a single node's static pod. The question specifically targets wk8s-node-1 and implies a single pod, making a DaemonSet incorrect.
  2. Incorrect Pod YAML syntax: Errors in indentation, missing required fields (like apiVersion, kind, metadata.name, spec.containers[0].name, spec.containers[0].image), or using incorrect values (e.g., image: nginx instead of httpd, name: nginx instead of webtool) would result in the pod not being created or being incorrectly configured.
  3. Not elevating privileges (sudo -i): Attempting to create or modify files in /etc/kubernetes/manifests without root privileges would result in a 'Permission denied' error.

Concept tested. Static Pods in Kubernetes, kubelet's role in managing them, Kubernetes Pod definition basics (YAML structure for apiVersion, kind, metadata, spec, containers, image, name), and fundamental Linux command-line operations (SSH, sudo, cd, vi/nano for file creation and editing).

Reference. https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/

Topics

#Static Pods#Kubelet Configuration#Pod Manifests#Node Configuration

Community Discussion

No community discussion yet for this question.

Full CKA Practice