liveBook · Manning

Chapter 17: Deploying per-node workloads with DaemonSets

What you will learn in chapter 17 of Kubernetes in Action, Second Edition

Introduces DaemonSets as the Kubernetes resource for running one agent or daemon Pod on each cluster node.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces DaemonSets as the Kubernetes resource for running one agent or daemon Pod on each cluster node.

Key terms: DaemonSet, agent, daemon, replica, node

17.1 Introducing DaemonSets

This section introduces DaemonSets as the way to run one pod replica per cluster node, with an option to limit which nodes receive one.

Key terms: DaemonSet, daemon Pods, node selector

17.1.1 Understanding the DaemonSet object

This section explains how a DaemonSet maintains one pod per node and why that pattern suits node-level infrastructure services.

Key terms: DaemonSet, Pod template, replicas, nodes, ReplicaSet, infrastructure pods, system-level service, Kube Proxy, Container Network Interface (CNI) plugin, DaemonSet controller

17.1.2 Deploying pods with a DaemonSet

This section creates and inspects a DaemonSet, then explains how its status, node eligibility, and pod manifests reveal where daemon pods run.

Key terms: DaemonSet, label selector, Pod template, status, nodes, control plane node, worker nodes, node selector, taints, tolerations

17.1.3 Deploying to a subset of Nodes with a node selector

This section shows how a DaemonSet uses node labels to run pods on selected nodes and how changes to labels or the node selector change which nodes are targeted.

Key terms: node selector, pod selector, Pod template, spec.nodeSelector, Node objects, reconciliation loop, kubernetes.io/arch, kubernetes.io/os, multiarch container images, pod label selector

17.1.4 Updating a DaemonSet

This section explains how RollingUpdate and OnDelete replace DaemonSet pods, and why manual updates can be safer for critical daemons.

Key terms: RollingUpdate, maxSurge, minReadySeconds, maxUnavailable, ready and available, Recreate, readiness probe, OnDelete, Pod template, cluster-critical pods

17.1.5 Deleting the DaemonSet

This subsection closes the DaemonSet demo by deleting the DaemonSet and checking that its pods are gone.

Key terms: DaemonSet, Pods

17.2 Special features in pods running node agents and daemons

This section explains why node agents and daemons may need greater access to their host node and where that access must be requested.

Key terms: node agents, daemons, Linux namespaces, pod manifest

17.2.1 Giving containers access to the OS kernel

This section explains why containers need explicit permission for sensitive kernel operations and contrasts privileged containers with granting specific capabilities.

Key terms: system calls, securityContext, privileged, kube-proxy, capabilities, NET_RAW, NET_ADMIN, kindnet

17.2.2 Accessing the node’s filesystem

Explains why a daemon Pod may need access to the node’s filesystem and illustrates that access with kube-proxy’s hostPath volumes.

Key terms: hostPath volume, daemon Pod, kube-proxy, xtables.lock, kernel modules

17.2.3 Using the node’s network and other namespaces

Explains how a DaemonSet pod can use its node’s network while remaining isolated by other namespaces unless explicitly configured otherwise.

Key terms: hostNetwork, node’s network environment, node’s address(es), hostIPC, hostPID, IPC namespaces, PID namespaces

17.2.4 Marking daemon Pods as critical

Explains why critical node daemons need higher pod priority and how to assign it with PriorityClasses.

Key terms: system pods, DaemonSet, Pod priority classes, PriorityClass, priorityClassName, system-cluster-critical, system-node-critical, preemption policy, kube-proxy

17.3 Communicating with the local daemon Pod

Introduces why client pods need a way to reach a daemon Pod on their own node and the node-agent example used to explore that problem.

Key terms: daemon Pod, Service, client pod, node, node agent, Kiada, uptime, average node utilization

17.3.1 Binding directly to a host port

This subsection shows how to expose each node-agent Pod through its node’s host port and configure Kiada to contact the agent on its own node.

Key terms: hostPort, host port, NodePort Service, NODE_AGENT_URL, NODE_IP, Downward API, DaemonSet, GET /, Node info, Request processed by

17.3.2 Using the node’s network stack

This subsection shows how a node-agent pod can use its host node’s network environment to serve clients through the node’s IP address and its listening port.

Key terms: host node’s network environment, node’s IP address, hostPort, --listen-address

17.3.3 Using a local Service

Shows how to expose DaemonSet agents through a node-local Service, configure a client to use it, and choose it over host networking when external access is unnecessary.

Key terms: Service, internalTrafficPolicy, Local, node-agent, node selector, hostPort, hostNetwork, app: node-agent, NODE_AGENT_URL, local Service

17.4 Summary

The section summarizes how DaemonSets place and update per-node Pods, how those Pods access node resources, and how clients reach a local daemon.

Concepts explained in this chapter

← Chapter 16: Handling stateful applications with StatefulSets Chapter 18: Batch processing with Jobs and CronJobs →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.