Skip to content

Commit 2569164

Browse files
committed
Kubernetes: Update DaemonSet configuration with specify namespace and enhance tolerations, security context, and probes
Signed-off-by: NotHarshhaa <[email protected]>
1 parent f7c637f commit 2569164

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Diff for: daemonset/daemonset.yaml

+20-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: apps/v1
22
kind: DaemonSet
33
metadata:
44
name: logdaemonset
5+
namespace: logging # Specify the namespace
56
labels:
67
app: fluentd-logging
78
spec:
@@ -14,9 +15,8 @@ spec:
1415
name: fluentd-elasticsearch
1516
spec:
1617
tolerations:
17-
# this toleration is to have the daemonset runnable on master nodes
18-
# remove it if your masters can't run pods
19-
- key: node-role.kubernetes.io/master
18+
# Allow the DaemonSet to run on control-plane nodes
19+
- key: node-role.kubernetes.io/control-plane
2020
effect: NoSchedule
2121
containers:
2222
- name: fluentd-elasticsearch
@@ -33,11 +33,27 @@ spec:
3333
- name: varlibdockercontainers
3434
mountPath: /var/lib/docker/containers
3535
readOnly: true
36+
securityContext:
37+
readOnlyRootFilesystem: true
38+
runAsNonRoot: true
39+
runAsUser: 1000
40+
livenessProbe:
41+
httpGet:
42+
path: /
43+
port: 80
44+
initialDelaySeconds: 10
45+
periodSeconds: 10
46+
readinessProbe:
47+
httpGet:
48+
path: /
49+
port: 80
50+
initialDelaySeconds: 5
51+
periodSeconds: 5
3652
terminationGracePeriodSeconds: 30
3753
volumes:
3854
- name: varlog
3955
hostPath:
4056
path: /var/log
4157
- name: varlibdockercontainers
4258
hostPath:
43-
path: /var/lib/docker/containers
59+
path: /var/lib/docker/containers

0 commit comments

Comments
 (0)