/
values.yaml
112 lines (111 loc) · 2.68 KB
/
values.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
image:
repository: ghcr.io/goofball222/unifi
tag: 8.0.7@sha256:218565257fdb4b2c7f27b8e4fdb4925e9348fd7cfb3ed027974bebf78bdc45ba
pullPolicy: IfNotPresent
service:
main:
ports:
main:
protocol: https
port: 8443
targetPort: 8443
comm:
enabled: true
ports:
comm:
enabled: true
port: 8080
targetPort: 8080
stun:
enabled: true
ports:
stun:
enabled: true
port: 3478
targetPort: 3478
protocol: udp
speedtest:
enabled: true
ports:
speedtest:
enabled: true
port: 6789
targetPort: 6789
guestportal:
enabled: true
ports:
web:
enabled: true
port: 8880
targetPort: 8880
protocol: http
websecure:
enabled: true
port: 8843
targetPort: 8843
protocol: https
persistence:
config:
enabled: true
targetSelector:
main:
main:
mountPath: /usr/lib/unifi/olddata
migrate:
mountPath: /usr/lib/unifi/olddata
data:
enabled: true
targetSelector:
main:
main:
mountPath: /usr/lib/unifi/data
migrate:
mountPath: /usr/lib/unifi/data
logs:
enabled: true
mountPath: "/usr/lib/unifi/logs"
type: "emptyDir"
certs:
enabled: true
mountPath: "/usr/lib/unifi/cert"
portal:
open:
enabled: true
securityContext:
container:
readOnlyRootFilesystem: false
runAsGroup: 0
runAsUser: 0
workload:
main:
podSpec:
containers:
main:
env:
RUN_CHOWN: true
DB_MONGO_LOCAL: true
initContainers:
migrate:
enabled: true
type: init
imageSelector: alpineImage
command:
- /bin/sh
args:
- -c
- |
newdatadir="/usr/lib/unifi/data"
olddatadir="/usr/lib/unifi/olddata/data"
# Check the dir exists
[ ! -d "$newdatadir" ] && echo "$newdatadir missing" && exit 1
# Check if there is a data/data dir to migrate
[ ! -d "$olddatadir" ] && echo "No $olddatadir dir found. Migration skipped" && exit 0
# Check if the new data dir is empty, ignoring the old data dir
dirs=$(ls -A "$newdatadir" | grep -v "data")
if [ -n "$dirs" ]; then
echo "New data dir is empty. Migrating data one level up"
mv $olddatadir/* $newdatadir || echo "Failed to move data" && exit 1
# Remove the data/data dir
rm -rf $olddatadir
echo "Data migration complete"
fi