diff --git a/charts/unifi-controller/templates/service.yaml b/charts/unifi-controller/templates/service.yaml index a70ce26..186ac63 100644 --- a/charts/unifi-controller/templates/service.yaml +++ b/charts/unifi-controller/templates/service.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service metadata: @@ -23,6 +24,33 @@ spec: targetPort: 3478 protocol: TCP name: stun + {{- if eq .Values.service.separateProtocols false }} + - port: 1900 + targetPort: 1900 + protocol: UDP + name: l2discover + - port: 5514 + targetPort: 5514 + protocol: UDP + name: syslog + {{- end }} + selector: + {{- include "unifi-controller.selectorLabels" . | nindent 4 }} +{{- if eq .Values.service.separateProtocols true }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "unifi-controller.fullname" . }}-udp + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "unifi-controller.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: - port: 1900 targetPort: 1900 protocol: UDP @@ -33,3 +61,4 @@ spec: name: syslog selector: {{- include "unifi-controller.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/charts/unifi-controller/values.test.yaml b/charts/unifi-controller/values.test.yaml new file mode 100644 index 0000000..fedba18 --- /dev/null +++ b/charts/unifi-controller/values.test.yaml @@ -0,0 +1,3 @@ +service: + type: ClusterIP + separateProtocols: true \ No newline at end of file diff --git a/charts/unifi-controller/values.yaml b/charts/unifi-controller/values.yaml index bc674e6..1a921d4 100644 --- a/charts/unifi-controller/values.yaml +++ b/charts/unifi-controller/values.yaml @@ -50,6 +50,8 @@ securityContext: {} service: type: ClusterIP + # Separate TCP and UDP ports into different services (required for MetalLB) + separateProtocols: false annotations: {} ingress: