Skip to content

Commit

Permalink
Switch to new Unifi controller image
Browse files Browse the repository at this point in the history
The maintainers split the controller and database, and now the old
image is deprecated.
  • Loading branch information
mchill committed May 3, 2024
1 parent 403e66e commit 3bfbc1e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
31 changes: 30 additions & 1 deletion k8s/applications/unifi/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
fsGroup: 1000
containers:
- name: unifi
image: lscr.io/linuxserver/unifi-controller:8.0.24
image: lscr.io/linuxserver/unifi-network-application:8.1.127
ports:
- name: ingress
containerPort: 8443
Expand All @@ -31,10 +31,39 @@ spec:
value: "1000"
- name: PGID
value: "1000"
- name: MONGO_USER
value: unifi
- name: MONGO_PASS
value: unifi
- name: MONGO_HOST
value: localhost
- name: MONGO_PORT
value: "27017"
- name: MONGO_DBNAME
value: unifi
volumeMounts:
- name: unifi
mountPath: /config
subPath: unifi
- name: mongo
image: mongo:4.4.18
ports:
- name: mongo
containerPort: 27017
env:
- name: TZ
value: America/New_York
volumeMounts:
- name: unifi
mountPath: /data/db
subPath: mongo
- name: config
mountPath: /docker-entrypoint-initdb.d/init-mongo.js
subPath: init-mongo.js
volumes:
- name: unifi
persistentVolumeClaim:
claimName: unifi
- name: config
configMap:
name: unifi
2 changes: 2 additions & 0 deletions k8s/applications/unifi/init-mongo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi_stat"}]});
4 changes: 4 additions & 0 deletions k8s/applications/unifi/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ resources:
- ../../overlays/persistence
- deployment.yaml
- service.yaml
configMapGenerator:
- name: unifi
files:
- init-mongo.js
patches:
- target:
kind: IngressRoute
Expand Down

0 comments on commit 3bfbc1e

Please sign in to comment.