Skip to content

Commit

Permalink
[networking] copied certs on runtime for unifi
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberdev committed Dec 27, 2023
1 parent 234cfba commit d06348a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions apps/networking/unifi/controller/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,28 @@ spec:
app: unifi-controller
spec:
terminationGracePeriodSeconds: 5
initContainers:
- name: volume-permissions
image: busybox
securityContext:
runAsUser: 0
command:
[
"/bin/sh",
"-c",
"chown -R 999:999 /unifi && cp /tmp-secrets/* /certs/",
]
volumeMounts:
- name: data
mountPath: /unifi
- name: temp-secrets
mountPath: /tmp-secrets
readOnly: true
- name: certs
mountPath: /certs
containers:
- name: unifi-controller
image: jacobalberty/unifi:v7.4.162
lifecycle:
postStart:
exec:
command: ["sudo", "chown", "-R", "/unifi"]
securityContext:
runAsUser: 999
runAsGroup: 999
Expand Down Expand Up @@ -71,12 +86,6 @@ spec:
mountPath: /unifi/data
- name: logs
mountPath: /unifi/log
- name: unifi-cert
mountPath: /unifi/cert/cert.pem
subPath: cert.pem
- name: unifi-key
mountPath: /unifi/cert/privkey.pem
subPath: privkey.pem
- mountPath: /unifi/data/sites/default/gateway.config.json
name: config
subPath: gateway.config.json
Expand Down Expand Up @@ -108,18 +117,11 @@ spec:
claimName: unifi-storage
- name: logs
emptyDir: {}
- name: unifi-cert
secret:
secretName: unifi-tls
items:
- key: tls.crt
path: cert.pem
- name: unifi-key
- name: temp-secrets
secret:
secretName: unifi-tls
items:
- key: tls.key
path: privkey.pem
- name: certs
emptyDir: {}
- name: config
configMap:
name: unifi-controller-cm
Expand Down

0 comments on commit d06348a

Please sign in to comment.