DaemonSet
What is Daemonset ? K8s feature allows single copy of pod running on each node in cluster all time.
only single copy of pod per node.
When new node added to cluster there is single copy of pod deployed to new node [automatic].
When node evicted from cluster ———> pod will evicted from node[automatic].
Use cases?
Logging agent
monitoring agent
networking agent [waevenet]
Examples ————>
kube-proxy deployed as daemonset
How to list daemonsets ?
$ kubectl get daemonsets
Deploy a DaemonSet for FluentD
Logging.
Name: elasticsearch
Namespace: kube-system
Image: registry.k8s.io/fluentd-elasticsearch:1.20
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: elasticsearch
namespace: kube-system
spec:
selector:
matchLabels:
app: Tier1
template:
metadata:
labels:
app: Tier1
spec:
containers:
- name: c1
image: registry.k8s.io/fluentd-elasticsearch:1.20