-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaemonset.yml
97 lines (96 loc) · 2.44 KB
/
daemonset.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
apiVersion: v1
kind: Secret
metadata:
name: mqtt
namespace: logs2mqtt
type: Opaque
data:
username: dXNlcm5hbWU= #e cho -n 'username' | base64
password: cGFzc3dvcmQ=
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: logs2mqtt
name: logs2mqtt
namespace: logs2mqtt
spec:
revisionHistoryLimit: 0
selector:
matchLabels:
app: logs2mqtt
template:
metadata:
labels:
app: logs2mqtt
spec:
initContainers:
- name: init-perms
image: busybox
imagePullPolicy: Always
command: ["/bin/sh"]
args:
[
"-c",
"chmod -R 755 /var/log/auth.log && chown 1000:1000 /var/log/auth.log",
]
securityContext:
runAsUser: 0
privileged: true
volumeMounts:
- mountPath: /var/log/auth.log
name: auth
- name: init-broker #rabbitmq
image: alpine
imagePullPolicy: Always
command:
[
"sh",
"-c",
"for i in {1..100}; do sleep 1; if nslookup rabbitmq.rabbitmq-system.svc.cluster.local; then exit 0; fi; done; exit 1;",
]
containers:
- env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HOST
value: "rabbitmq.rabbitmq-system.svc.cluster.local"
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
name: mqtt
key: password
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
name: mqtt
key: username
- name: PORT
value: "1883"
image: william1608/logs2mqtt
imagePullPolicy: IfNotPresent
name: logs2mqtt
resources:
limits:
memory: "200Mi"
cpu: "200m"
securityContext:
runAsUser: 1000
runAsGroup: 1000
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- mountPath: /var/log/auth.log
name: auth
#readOnly: true
restartPolicy: Always
volumes:
- name: auth
hostPath:
path: /var/log/auth.log