DaemonSets
Run this task on once on every node.
A Daemonset is similar to a ReplicaSets. It has a nested pod spec template for container, and selectors to link the daemonset to the pod.
DaemonSets, behind the scenes, iterate the node list and set nodeAffinity on each required pod. Previous (<= 1.12) they set nodeName instead.
Template
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ${RESOURCE_NAME}
labels: &app_labels
name: ${RESOURCE_NAME}
spec:
selector:
matchLabels:
<<: *app_labels
template:
metadata:
name: ${RESOURCE_NAME}
labels:
<<: *app_labels
spec:
containers:
- name: ${RESOURCE_NAME}-container
image: ${RESOURCE_NAME}:latest
# command: ["sleep"]
# args: ["3600"]
# updateStrategy:
---