-
Notifications
You must be signed in to change notification settings - Fork 1
/
DaemonSet
60 lines (53 loc) · 1.11 KB
/
DaemonSet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
DaemonSet creation.
yaml file for DaemonSet is same as ReplicaSet except replicas
master $ cat ds.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: elasticsearch
namespace: kube-system
spec:
selector:
matchLabels:
app: logger
template:
metadata:
labels:
app: logger
spec:
containers:
- name: el-pod
image: k8s.gcr.io/fluentd-elasticsearch:1.20
master $
kubectl create -f ds.yaml
with nginx image
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-daemon
labels:
k8s-app: nginx-daemon
spec:
selector:
matchLabels:
name: nginx-daemon
template:
metadata:
labels:
name: nginx-daemon
spec:
tolerations:
# this toleration is to have the daemonset runnable on master nodes
# remove it if your masters can't run pods
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: nginx-daemonset
image: nginx
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
terminationGracePeriodSeconds: 30