Add unifi controller
This commit is contained in:
		| @@ -40,6 +40,15 @@ spec: | |||||||
| --- | --- | ||||||
| apiVersion: metallb.io/v1beta1 | apiVersion: metallb.io/v1beta1 | ||||||
| kind: IPAddressPool | kind: IPAddressPool | ||||||
|  | metadata: | ||||||
|  |   name: unifi | ||||||
|  |   namespace: metallb-system | ||||||
|  | spec: | ||||||
|  |   addresses: | ||||||
|  |   - 172.21.102.0/24 | ||||||
|  | --- | ||||||
|  | apiVersion: metallb.io/v1beta1 | ||||||
|  | kind: IPAddressPool | ||||||
| metadata: | metadata: | ||||||
|   name: bind-secondary-external |   name: bind-secondary-external | ||||||
|   namespace: metallb-system |   namespace: metallb-system | ||||||
|   | |||||||
| @@ -4,5 +4,6 @@ kind: Kustomization | |||||||
| namespace: &ns unifi | namespace: &ns unifi | ||||||
|  |  | ||||||
| resources: | resources: | ||||||
|  | - ssh://git@git.k-space.ee/secretspace/kube/unifi # secrets: unifi, unifi-mongo | ||||||
| - unifi-mongo.yaml | - unifi-mongo.yaml | ||||||
| - unifi.yaml | - unifi.yaml | ||||||
|   | |||||||
| @@ -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 | apiVersion: apps/v1 | ||||||
| kind: StatefulSet | kind: StatefulSet | ||||||
| metadata: | metadata: | ||||||
| @@ -18,7 +8,6 @@ spec: | |||||||
|   selector: |   selector: | ||||||
|     matchLabels: |     matchLabels: | ||||||
|       app: unifi-db |       app: unifi-db | ||||||
|   serviceName: "router-manager-db" |  | ||||||
|   replicas: 1 |   replicas: 1 | ||||||
|   minReadySeconds: 10 |   minReadySeconds: 10 | ||||||
|   template: |   template: | ||||||
| @@ -29,20 +18,16 @@ spec: | |||||||
|       terminationGracePeriodSeconds: 10 |       terminationGracePeriodSeconds: 10 | ||||||
|       containers: |       containers: | ||||||
|         - name: mongodb |         - name: mongodb | ||||||
|           image: mongo:4 |           image: mongo:8 | ||||||
|           ports: |           ports: | ||||||
|             - containerPort: 27017 |             - containerPort: 27017 | ||||||
|               name: mongo |               name: mongo | ||||||
|  |           envFrom:          | ||||||
|  |             - secretRef: | ||||||
|  |                 name: unifi-mongo              | ||||||
|           volumeMounts: |           volumeMounts: | ||||||
|             - name: data |             - name: data | ||||||
|               mountPath: /data/db |               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: |   volumeClaimTemplates: | ||||||
|     - metadata: |     - metadata: | ||||||
|         name: data |         name: data | ||||||
|   | |||||||
| @@ -39,16 +39,9 @@ spec: | |||||||
|               value: '1000' |               value: '1000' | ||||||
|             - name: TZ |             - name: TZ | ||||||
|               value: Etc/UTC |               value: Etc/UTC | ||||||
|             - name: MONGO_USER |           envFrom:          | ||||||
|               value: "unifi" |             - secretRef: | ||||||
|             - name: MONGO_PASSWORD |                 name: unifi               | ||||||
|               value: "unifipass" |  | ||||||
|             - name: MONGO_HOST |  | ||||||
|               value: unifi-db |  | ||||||
|             - name: MONGO_DBNAME |  | ||||||
|               value: "unifi" |  | ||||||
|             - name: MONGO_PORT |  | ||||||
|               value: "27017" |  | ||||||
|           ports: |           ports: | ||||||
|             - containerPort: 3478 |             - containerPort: 3478 | ||||||
|               protocol: UDP |               protocol: UDP | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user