-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment-rpi-chromium.yaml
79 lines (79 loc) · 1.96 KB
/
deployment-rpi-chromium.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
apiVersion: apps/v1
kind: Deployment
metadata:
name: chromium-rpi${NUM}
namespace: monitors-ii-nz
labels:
environment: production
spec:
strategy:
type: Recreate
replicas: 1
selector:
matchLabels:
app: chromium-rpi${NUM}
template:
metadata:
labels:
app: chromium-rpi${NUM}
environment: production
spec:
automountServiceAccountToken: false
hostNetwork: true
hostPID: true
containers:
- name: chromium
image: registry.gitlab.com/ii/nz/chromium:latest
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true
imagePullPolicy: IfNotPresent
volumeMounts:
- name: dev
mountPath: /dev
- name: sys
mountPath: /sys
- name: unix-socket
mountPath: /tmp/.X11-unix
- name: home-user
mountPath: /home/user
command:
- nsenter
- -t
- "1"
- -m
- -u
- -n
- -i
- su
- pi
- -c
- "whoami ; cat /etc/passwd ; rm -rf /home/pi/.config/chromium; rm -rf /home/pi/.cache/chromium/; chromium --start-fullscreen https://careers-expo.ii.nz/monitor.html"
env:
- name: TZ
value: "Pacific/Auckland"
- name: DISPLAY
value: "unix:0"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- pi${NUM}.ii.nz
volumes:
- name: dev
hostPath:
path: /dev
- name: sys
hostPath:
path: /sys
- name: unix-socket
hostPath:
path: /tmp/.X11-unix
- name: home-user
emptyDir: {}