16 Deploying node agents and daemons with DaemonSets

 

This chapter covers

  • Running an agent Pod on each cluster node
  • Running agent Pods on a subset of nodes
  • Allowing Pods to access the host node’s resources
  • Assigning a priority class to a Pod
  • Communicating with the local agent Pod

In the previous chapters, you learned how to use Deployments or StatefulSets to distribute multiple replicas of a workload across the nodes of your cluster. But what if you want to run exactly one replica on each node? For example, you might want each node to run an agent or daemon that provides a system service such as metrics collection or log aggregation for that node. To deploy these types of workloads in Kubernetes, you use a DaemonSet.

Before you begin, create the kiada Namespace, change to the Chapter16/ directory, and apply all manifests in the SETUP/ directory by running the following commands:

$ kubectl create ns kiada
$ kubectl config set-context --current --namespace kiada
$ kubectl apply -f SETUP -R
NOTE

16.1  Introducing DaemonSets

A DaemonSet is an API object that ensures that exactly one replica of a Pod is running on each cluster node. By default, daemon Pods are deployed on every node, but you can use a node selector to restrict deployment to some of the nodes.

16.1.1  Understanding the DaemonSet object

 
 
 

16.1.2  Deploying Pods with a DaemonSet

 
 
 

16.1.3  Deploying to a subset of Nodes with a node selector

 
 
 

16.1.4  Updating a DaemonSet

 
 
 
 

16.1.5  Deleting the DaemonSet

 
 
 

16.2  Special features in Pods running node agents and daemons

 
 
 
 

16.2.1  Giving containers access to the OS kernel

 
 

16.2.2  Accessing the node’s filesystem

 
 

16.2.3  Using the node’s network and other namespaces

 
 
 

16.2.4  Marking daemon Pods as critical

 
 

16.3  Communicating with the local daemon Pod

 
 
 
 

16.3.1  Binding directly to a host port

 
 

16.3.2  Using the node’s network stack

 
 
 
 

16.3.3  Using a local Service

 
 

16.4  Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest