-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path90_ntp_daemon_set.yaml
61 lines (61 loc) · 1.56 KB
/
90_ntp_daemon_set.yaml
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
apiVersion: v1
kind: ConfigMap
metadata:
name: ntp-server
namespace: kube-system
data:
#first #backup
server: "de.pool.ntp.org pool.ntp.org"
syncInterval: "60"
---
### Tested for OS-Systems:
#- flatcar
#- ubuntu 20.04
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ntp-sync
namespace: kube-system
labels:
app: ntp-sync
spec:
selector:
matchLabels:
app: ntp-sync
template:
metadata:
labels:
app: ntp-sync
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
- effect: NoExecute
operator: Exists
- effect: NoSchedule
operator: Exists
hostPID: true
hostNetwork: true
containers:
- name: ntp-sync
#{{ Registry "gcr.io" }}/
image: quay.io/kubermatic/util:1.4.1
command:
- /bin/sh
args:
- -c
- nsenter -t 1 -m -u -i -n -p -- sh -c 'if test -f /usr/sbin/ntpdate; then echo installed; else /usr/bin/apt-get update && /usr/bin/apt-get -y install ntpdate; fi && while true; do ntpdate $NTP_SERVER && sleep $INTERVAL; done'
securityContext:
privileged: true
env:
- name: NTP_SERVER
valueFrom:
configMapKeyRef:
name: ntp-server
key: server
- name: INTERVAL
valueFrom:
configMapKeyRef:
name: ntp-server
key: syncInterval
terminationGracePeriodSeconds: 10