unifi.old.yaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: unifi-tcp
  5. labels:
  6. run: unifi
  7. annotations:
  8. metallb.universe.tf/allow-shared-ip: "unifi"
  9. spec:
  10. ports:
  11. - name: unifi-device-communication
  12. protocol: TCP
  13. port: 8080
  14. targetPort: 8080
  15. - name: unifi-management
  16. protocol: TCP
  17. port: 8443
  18. targetPort: 8443
  19. - name: unifi-guest-https
  20. protocol: TCP
  21. port: 8843
  22. targetPort: 8843
  23. - name: unifi-guest-http
  24. protocol: TCP
  25. port: 8880
  26. targetPort: 8880
  27. - name: unifi-mobile-throughput
  28. protocol: TCP
  29. port: 6789
  30. targetPort: 6789
  31. selector:
  32. run: unifi
  33. type: LoadBalancer
  34. loadBalancerIP: 10.42.42.240
  35. ---
  36. apiVersion: v1
  37. kind: Service
  38. metadata:
  39. name: unifi-udp
  40. labels:
  41. run: unifi
  42. annotations:
  43. metallb.universe.tf/allow-shared-ip: "unifi"
  44. spec:
  45. ports:
  46. - name: stun
  47. protocol: UDP
  48. port: 3478
  49. targetPort: 3478
  50. - name: ap-discovery
  51. protocol: UDP
  52. port: 10001
  53. targetPort: 10001
  54. - name: unifi-make-controller-discoverable
  55. protocol: UDP
  56. port: 1900
  57. targetPort: 1900
  58. - name: unifi-syslog
  59. protocol: UDP
  60. port: 5514
  61. targetPort: 5514
  62. selector:
  63. run: unifi
  64. type: LoadBalancer
  65. loadBalancerIP: 10.42.42.240
  66. ---
  67. apiVersion: v1
  68. kind: PersistentVolume
  69. metadata:
  70. name: unifi
  71. spec:
  72. capacity:
  73. storage: 5Mi
  74. volumeMode: Filesystem
  75. accessModes:
  76. - ReadWriteMany
  77. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  78. storageClassName: default
  79. mountOptions:
  80. - hard
  81. - nfsvers=3
  82. nfs:
  83. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/unifi
  84. server: 10.42.42.10
  85. claimRef:
  86. name: unifi
  87. namespace: default
  88. ---
  89. apiVersion: v1
  90. kind: PersistentVolumeClaim
  91. metadata:
  92. name: unifi
  93. annotations:
  94. nfs.io/storage-path: "unifi"
  95. spec:
  96. storageClassName: default
  97. accessModes:
  98. - ReadWriteMany
  99. resources:
  100. requests:
  101. storage: 5Mi
  102. status: {}
  103. ---
  104. apiVersion: apps/v1
  105. kind: Deployment
  106. metadata:
  107. name: unifi
  108. spec:
  109. replicas: 1
  110. selector:
  111. matchLabels:
  112. run: unifi
  113. strategy:
  114. type: Recreate
  115. template:
  116. metadata:
  117. labels:
  118. run: unifi
  119. spec:
  120. terminationGracePeriodSeconds: 30
  121. containers:
  122. - image: linuxserver/unifi-controller
  123. imagePullPolicy: "Always"
  124. name: unifi
  125. env:
  126. - name: TZ
  127. value: US/Michigan
  128. # PUID and PGID are for volume permissions
  129. # - name: PUID
  130. # value: "1000"
  131. # - name: PGID
  132. # value: "1000"
  133. - name: MEM_LIMIT
  134. value: "1024"
  135. ports:
  136. - containerPort: 3478
  137. protocol: UDP
  138. - containerPort: 10001
  139. protocol: UDP
  140. - containerPort: 8080
  141. protocol: TCP
  142. - containerPort: 8443
  143. protocol: TCP
  144. - containerPort: 1900
  145. protocol: UDP
  146. - containerPort: 8843
  147. protocol: TCP
  148. - containerPort: 8880
  149. protocol: TCP
  150. - containerPort: 6789
  151. protocol: TCP
  152. - containerPort: 5514
  153. protocol: UDP
  154. resources:
  155. limits:
  156. memory: "2Gi"
  157. cpu: "1500m"
  158. requests:
  159. memory: "500Mi"
  160. cpu: "500m"
  161. volumeMounts:
  162. - mountPath: /config
  163. name: unifi
  164. restartPolicy: Always
  165. volumes:
  166. - name: unifi
  167. persistentVolumeClaim:
  168. claimName: unifi
  169. dnsPolicy: "None"
  170. dnsConfig:
  171. nameservers:
  172. - 10.42.42.239
  173. - 10.42.42.1
  174. searches:
  175. - default.svc.cluster.local
  176. - svc.cluster.local
  177. - cluster.local
  178. options:
  179. - name: ndots
  180. value: "2"
  181. - name: edns0
  182. - name: trust-ad
  183. status: {}
  184. ---
  185. # Hosting
  186. apiVersion: networking.k8s.io/v1
  187. kind: Ingress
  188. metadata:
  189. name: unifi-management
  190. annotations:
  191. nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
  192. nginx.ingress.kubernetes.io/proxy-ssl-verify: "off"
  193. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  194. spec:
  195. tls:
  196. - hosts:
  197. - unifi.monkeybox.org
  198. secretName: unifi-tls
  199. rules:
  200. - host: unifi.monkeybox.org
  201. http:
  202. paths:
  203. - path: /
  204. pathType: Prefix
  205. backend:
  206. service:
  207. name: unifi-tcp
  208. port:
  209. number: 8443