unifi.yaml 4.4 KB

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