1) How many DaemonSets exist in the cluster (all namespaces)?
Run:kube-flannel-dskube-proxy
2) Which namespace are the DaemonSets created in?
Check theNAMESPACE column in the kubectl get ds -A output: both DaemonSets in this example are in the kube-system namespace.
3) Which of the following are DaemonSets?
From the items shown in this cluster:kube-flannel-ds— DaemonSetkube-proxy— DaemonSet
kube-scheduler, coredns, etcd-master—are not DaemonSets in this example.
4) On how many nodes are the pods scheduled by the kube-proxy DaemonSet?
Describe the DaemonSet (note use of singular resource name):
Desired Number of Nodes Scheduled: 1 and Current Number of Nodes Scheduled: 1, so the DaemonSet is scheduled on a single node in this cluster.
To confirm the cluster node count:
5) What image does the kube-flannel-ds DaemonSet use?
Describe the flannel DaemonSet:
kube-flannel-ds DaemonSet uses quay.io/coreos/flannel:v0.13.1-rc1 for both its init container and the flannel container.
6) Deploy a DaemonSet for fluentd logging
Below is a straightforward DaemonSet manifest that runs fluentd on each node in thekube-system namespace. It includes a toleration so pods can be scheduled on master nodes; remove the toleration if you do not want to run logging pods on control-plane nodes.
This DaemonSet manifest is a minimal example for demonstration. For production you should add RBAC rules, a ConfigMap for fluentd configuration, proper volume permissions, and node selectors/affinity as required.
- Save the YAML above to a file and apply it directly:
- Or generate a starting YAML with kubectl and edit it into a DaemonSet:
fluentd.yaml:
- Change
kind: Deploymenttokind: DaemonSet. - Remove
replicas:and anystrategy:entries (DaemonSets don’t usereplicas). - Add tolerations, volume mounts, and
volumes:for host log paths as required. - Save and apply:
If your kubectl or cluster tooling doesn’t include a direct
kubectl create daemonset subcommand, generate YAML with kubectl create --dry-run=client -o yaml and edit it into a DaemonSet manifest, or simply apply a prepared manifest with kubectl apply -f.