>_ IzzyLab

Hands-on task

This task is step 10 of the course “Kubernetes: manifests from Namespace to RBAC”

k8s: DaemonSet

medium~5 min

In /root/ds.yaml there is a Deployment agent with three replicas. But by its nature it's a node agent — it should run as one instance on each node, not as a fixed number of replicas. Rework the manifest into a DaemonSet. Edit the file in the Editor tab.

What you'll practise:
  • kubernetes
  • daemonset
  • deployment
  • yq
  • workloads

Topic breakdown

Different workload controllers solve different problems: a Deployment keeps a given number of replicas anywhere in the cluster, while a DaemonSet guarantees exactly one pod on EACH node — this is the model for node agents (collecting logs, metrics, network plugins). When changing the type, it's important that the object schemas differ: a DaemonSet has no spec.replicas field, and if you leave it, strict validation (kubeconform -strict) rejects the manifest as containing an extra field. The selector and pod template are carried over unchanged, and apiVersion stays apps/v1.

What's checked

  1. manifest is valid (kubeconform)
  2. kind = DaemonSet
  3. selector app: agent

What it looks like