Browse Source

pihole/unify updated

Fred Damstra [k8s4] 2 months ago
parent
commit
4b4b690e49
2 changed files with 48 additions and 33 deletions
  1. 14 1
      Workloads/pihole.yaml
  2. 34 32
      Workloads/unifi.yaml

+ 14 - 1
Workloads/pihole.yaml

@@ -141,7 +141,7 @@ spec:
     spec:
       terminationGracePeriodSeconds: 30
       containers:
-        - image: pihole/pihole
+        - image: pihole/pihole:latest
           imagePullPolicy: "Always"
           name: pihole
           env:
@@ -175,6 +175,19 @@ spec:
             initialDelaySeconds: 300
             periodSeconds: 60
       restartPolicy: Always
+      dnsConfig:
+        nameservers:
+          - 10.42.42.239
+          - 10.42.42.1
+        searches:
+          - default.svc.cluster.local
+          - svc.cluster.local
+          - cluster.local
+        options:
+          - name: ndots
+            value: "2"
+          - name: edns0
+          - name: trust-ad
       volumes:
         - name: pihole
           persistentVolumeClaim:

+ 34 - 32
Workloads/unifi.yaml

@@ -1,46 +1,46 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: unifi-tcp
+  name: ui-tcp
   labels:
-    run: unifi
+    run: ui
   annotations:
-    metallb.universe.tf/allow-shared-ip: "unifi"
+    metallb.universe.tf/allow-shared-ip: "ui"
 spec:
   ports:
-    - name: unifi-device-communication
+    - name: ui-device-communication
       protocol: TCP
       port: 8080
       targetPort: 8080
-    - name: unifi-management
+    - name: ui-management
       protocol: TCP
       port: 8443
       targetPort: 8443
-    - name: unifi-guest-https
+    - name: ui-guest-https
       protocol: TCP
       port: 8843
       targetPort: 8843
-    - name: unifi-guest-http
+    - name: ui-guest-http
       protocol: TCP
       port: 8880
       targetPort: 8880
-    - name: unifi-mobile-throughput
+    - name: ui-mobile-throughput
       protocol: TCP
       port: 6789
       targetPort: 6789
   selector:
-    run: unifi
+    run: ui
   type: LoadBalancer
   loadBalancerIP: 10.42.42.240
 ---
 apiVersion: v1
 kind: Service
 metadata:
-  name: unifi-udp
+  name: ui-udp
   labels:
-    run: unifi
+    run: ui
   annotations:
-    metallb.universe.tf/allow-shared-ip: "unifi"
+    metallb.universe.tf/allow-shared-ip: "ui"
 spec:
   ports:
     - name: stun
@@ -51,23 +51,23 @@ spec:
       protocol: UDP
       port: 10001
       targetPort: 10001
-    - name: unifi-make-controller-discoverable
+    - name: ui-make-controller-discoverable
       protocol: UDP
       port: 1900
       targetPort: 1900
-    - name: unifi-syslog
+    - name: ui-syslog
       protocol: UDP
       port: 5514
       targetPort: 5514
   selector:
-    run: unifi
+    run: ui
   type: LoadBalancer
   loadBalancerIP: 10.42.42.240
 ---
 apiVersion: v1
 kind: PersistentVolume
 metadata:
-  name: unifi
+  name: ui
 spec:
   capacity:
     storage: 5Mi
@@ -80,18 +80,18 @@ spec:
     - hard
     - nfsvers=3
   nfs:
-    path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/unifi
+    path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/ui
     server: 10.42.42.10
   claimRef:
-    name: unifi
+    name: ui
     namespace: default
 ---
 apiVersion: v1
 kind: PersistentVolumeClaim
 metadata:
-  name: unifi
+  name: ui
   annotations:
-    nfs.io/storage-path: "unifi"
+    nfs.io/storage-path: "ui"
 spec:
   storageClassName: default
   accessModes:
@@ -104,24 +104,25 @@ status: {}
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: unifi
+  name: ui
 spec:
   replicas: 1
   selector:
     matchLabels:
-      run: unifi
+      run: ui
   strategy:
     type: Recreate
   template:
     metadata:
       labels:
-        run: unifi
+        run: ui
     spec:
       terminationGracePeriodSeconds: 30
       containers:
-        - image: linuxserver/unifi-controller
+        #- image: 11notes/unifi:8.0.24
+        - image: 11notes/unifi:9
           imagePullPolicy: "Always"
-          name: unifi
+          name: ui
           env:
             - name: TZ
               value: US/Michigan
@@ -159,13 +160,13 @@ spec:
               memory: "500Mi"
               cpu: "500m"
           volumeMounts:
-            - mountPath: /config
-              name: unifi
+            - mountPath: /unifi/var
+              name: ui
       restartPolicy: Always
       volumes:
-        - name: unifi
+        - name: ui
           persistentVolumeClaim:
-            claimName: unifi
+            claimName: ui
       dnsPolicy: "None"
       dnsConfig:
         nameservers:
@@ -186,16 +187,17 @@ status: {}
 apiVersion: networking.k8s.io/v1
 kind: Ingress
 metadata:
-  name: unifi-management
+  name: ui-management
   annotations:
     nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
     nginx.ingress.kubernetes.io/proxy-ssl-verify: "off"
+    nginx.ingress.kubernetes.io/proxy-body-size: 100m
     cert-manager.io/cluster-issuer: "letsencrypt-prod"
 spec:
   tls:
   - hosts:
     - unifi.monkeybox.org
-    secretName: unifi-tls
+    secretName: ui-tls
   rules:
   - host: unifi.monkeybox.org
     http:
@@ -204,6 +206,6 @@ spec:
         pathType: Prefix
         backend:
           service:
-            name: unifi-tcp
+            name: ui-tcp
             port:
               number: 8443