Add unifi controller

This commit is contained in:
2025-08-14 21:06:59 +03:00
parent d8120a3b0d
commit c0f79a229c
4 changed files with 17 additions and 29 deletions

View File

@@ -40,6 +40,15 @@ spec:
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: unifi
namespace: metallb-system
spec:
addresses:
- 172.21.102.0/24
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: bind-secondary-external
namespace: metallb-system

View File

@@ -4,5 +4,6 @@ kind: Kustomization
namespace: &ns unifi
resources:
- ssh://git@git.k-space.ee/secretspace/kube/unifi # secrets: unifi, unifi-mongo
- unifi-mongo.yaml
- unifi.yaml

View File

@@ -1,14 +1,4 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: unifi-mongo-init
namespace: unifi
data:
init-mongo.js: |
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "unifipass", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi",pwd: "unifipass",roles: [{role: "dbOwner", db: "unifi_stat"}]});
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -18,7 +8,6 @@ spec:
selector:
matchLabels:
app: unifi-db
serviceName: "router-manager-db"
replicas: 1
minReadySeconds: 10
template:
@@ -29,20 +18,16 @@ spec:
terminationGracePeriodSeconds: 10
containers:
- name: mongodb
image: mongo:4
image: mongo:8
ports:
- containerPort: 27017
name: mongo
envFrom:
- secretRef:
name: unifi-mongo
volumeMounts:
- name: data
mountPath: /data/db
- name: unifi-mongo-init
mountPath: /docker-entrypoint-initdb.d/init-mongo.js
subPath: init-mongo.js
volumes:
- name: unifi-mongo-init
configMap:
name: unifi-mongo-init
volumeClaimTemplates:
- metadata:
name: data

View File

@@ -39,16 +39,9 @@ spec:
value: '1000'
- name: TZ
value: Etc/UTC
- name: MONGO_USER
value: "unifi"
- name: MONGO_PASSWORD
value: "unifipass"
- name: MONGO_HOST
value: unifi-db
- name: MONGO_DBNAME
value: "unifi"
- name: MONGO_PORT
value: "27017"
envFrom:
- secretRef:
name: unifi
ports:
- containerPort: 3478
protocol: UDP