diff --git a/charts/unifi/Chart.yaml b/charts/unifi/Chart.yaml index e4baeb9..f936314 100644 --- a/charts/unifi/Chart.yaml +++ b/charts/unifi/Chart.yaml @@ -3,7 +3,7 @@ appVersion: v7.5.176 kubeVersion: ">=1.18-0" description: Ubiquiti Network's Unifi Controller name: unifi -version: 1.7.0 +version: 1.7.1 keywords: - ubiquiti - unifi diff --git a/charts/unifi/README.md b/charts/unifi/README.md index acfd352..dd463f6 100644 --- a/charts/unifi/README.md +++ b/charts/unifi/README.md @@ -2,7 +2,7 @@ Ubiquiti Network's Unifi Controller -**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)** +**This chart is not maintained by the [upstream project](https://github.com/jacobalberty/unifi-docker) and any issues with the chart should be raised [here](https://github.com/mkilchhofer/unifi-chart/issues/new)** ## Source Code @@ -41,13 +41,13 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console helm install unifi \ --set env.TZ="America/New York" \ - k8s-at-home/unifi + oci://ghcr.io/mkilchhofer/unifi-chart/unifi ``` Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. ```console -helm install unifi k8s-at-home/unifi -f values.yaml +helm install unifi oci://ghcr.io/mkilchhofer/unifi-chart/unifi -f values.yaml ``` ## Custom configuration @@ -98,7 +98,7 @@ ingress: | UID | int | `999` | Set the UID (user id) the UniFi service runs as when `runAsRoot` is set to false | | affinity | object | `{}` | Affinity for pod assignment | | captivePortalService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| captivePortalService.enabled | bool | `false` | Enable service for the captive portal webpage | +| captivePortalService.enabled | bool | `true` | Enable service for the captive portal webpage | | captivePortalService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | captivePortalService.http | int | `8880` | Kubernetes port where the http service is exposed | | captivePortalService.https | int | `8843` | Kubernetes port where the https service is exposed | @@ -112,7 +112,7 @@ ingress: | captivePortalService.loadBalancerSourceRanges | list | `nil` | loadBalancerSourceRanges | | captivePortalService.type | string | `"ClusterIP"` | Kubernetes service type | | controllerService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| controllerService.enabled | bool | `false` | Enable service for the controller | +| controllerService.enabled | bool | `true` | Enable service for the controller | | controllerService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | controllerService.ingress.annotations | object | `{}` | Annotations for Ingress resource | | controllerService.ingress.enabled | bool | `false` | Enable Ingress resource | @@ -131,7 +131,7 @@ ingress: | customCert.keyName | string | `"tls.key"` | File name of the private key for the certificate | | deploymentAnnotations | object | `{}` | Annotations for UniFi deployment | | discoveryService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| discoveryService.enabled | bool | `false` | Enable service for the discovery feature | +| discoveryService.enabled | bool | `true` | Enable service for the discovery feature | | discoveryService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | discoveryService.ingress.annotations | object | `{}` | Annotations for Ingress resource | | discoveryService.ingress.enabled | bool | `false` | Enable Ingress resource | @@ -148,7 +148,7 @@ ingress: | extraVolumeMounts | list | `[]` | specify additional VolumeMount to be mounted inside unifi container | | extraVolumes | list | `[]` | specify additional volume to be used by extraVolumeMounts inside unifi container | | guiService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| guiService.enabled | bool | `false` | Enable service for the main web UI | +| guiService.enabled | bool | `true` | Enable service for the main web UI | | guiService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | guiService.labels | object | `{}` | Labels to add to the GUI service | | guiService.loadBalancerIP | string | `nil` | Use loadBalancerIP to request a specific static IP, otherwise leave blank | @@ -160,7 +160,7 @@ ingress: | image.repository | string | `"jacobalberty/unifi"` | Container image name | | image.tag | string | `""` (use appVersion in `Chart.yaml`) | Container image tag | | ingress.annotations | object | `{}` | Annotations for Ingress resource | -| ingress.enabled | bool | `false` | Enable Ingress resource | +| ingress.enabled | bool | `true` | Enable Ingress resource | | ingress.hosts | list | `["chart-example.local"]` | Hostname(s) for the Ingress resource | | ingress.path | string | `"/"` | Ingress path | | ingress.tls | list | `[]` | Ingress TLS configuration | @@ -184,10 +184,10 @@ ingress: | nodeSelector | object | `{}` | Node labels for pod assignment | | persistence.accessMode | string | `"ReadWriteOnce"` | Persistence access modes | | persistence.enabled | bool | `false` | Use persistent volume to store data | -| persistence.existingClaim | string | `nil` | Use an existing PVC to persist data | +| persistence.existingClaim | string | `""` | Use an existing PVC to persist data | | persistence.size | string | `"5Gi"` | Size of persistent volume claim | | persistence.skipuninstall | bool | `false` | Do not delete the pvc upon helm uninstall | -| persistence.storageClass | string | `nil` | Type of persistent volume claim | +| persistence.storageClass | string | `""` | Storage Class to use for the PVC | | podAnnotations | object | `{}` | Annotations for UniFi pod | | readinessProbe.enabled | bool | `true` | Enable readiness probe | | readinessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | @@ -198,7 +198,7 @@ ingress: | resources | object | `{}` | Set container requests and limits for different resources like CPU or memory | | runAsRoot | bool | `false` | This is used to determine whether or not the UniFi service runs as a privileged (root) user. The default value is `true` but it is recommended to use `false` instead. | | speedtestService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| speedtestService.enabled | bool | `false` | Enable service for mobile speedtest inside the UniFi Mobile app | +| speedtestService.enabled | bool | `true` | Enable service for mobile speedtest inside the UniFi Mobile app | | speedtestService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | speedtestService.labels | object | `{}` | Labels to add to the speedtest service | | speedtestService.loadBalancerIP | string | `nil` | Use loadBalancerIP to request a specific static IP, otherwise leave blank | @@ -207,7 +207,7 @@ ingress: | speedtestService.type | string | `"ClusterIP"` | Kubernetes service type | | strategyType | string | `"Recreate"` | upgrade strategy type (e.g. Recreate or RollingUpdate) | | stunService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| stunService.enabled | bool | `false` | Enable service the STUN feature | +| stunService.enabled | bool | `true` | Enable service the STUN feature | | stunService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | stunService.labels | object | `{}` | Labels to add to the STUN service | | stunService.loadBalancerIP | string | `nil` | Use loadBalancerIP to request a specific static IP, otherwise leave blank | @@ -215,7 +215,7 @@ ingress: | stunService.port | int | `3478` | Kubernetes port where the service is exposed | | stunService.type | string | `"NodePort"` | Kubernetes service type | | syslogService.annotations | object | `{}` | Provide any additional annotations which may be required. This can be used to set the LoadBalancer service type to internal only. ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer | -| syslogService.enabled | bool | `false` | Enable service for the syslog server. Used to capture syslog from Unifi devices if the feature is enabled in the site configuration. | +| syslogService.enabled | bool | `true` | Enable service for the syslog server. Used to capture syslog from Unifi devices if the feature is enabled in the site configuration. | | syslogService.externalTrafficPolicy | string | `nil` | Set the externalTrafficPolicy in the Service to either Cluster or Local | | syslogService.labels | object | `{}` | Labels to add to the syslog service | | syslogService.loadBalancerIP | string | `nil` | Use loadBalancerIP to request a specific static IP, otherwise leave blank | diff --git a/charts/unifi/README.md.gotmpl b/charts/unifi/README.md.gotmpl index d908a7b..71ac41d 100644 --- a/charts/unifi/README.md.gotmpl +++ b/charts/unifi/README.md.gotmpl @@ -2,7 +2,7 @@ Ubiquiti Network's Unifi Controller -**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)** +**This chart is not maintained by the [upstream project](https://github.com/jacobalberty/unifi-docker) and any issues with the chart should be raised [here](https://github.com/mkilchhofer/unifi-chart/issues/new)** {{ template "chart.sourcesSection" . }} @@ -39,13 +39,13 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console helm install unifi \ --set env.TZ="America/New York" \ - k8s-at-home/unifi + oci://ghcr.io/mkilchhofer/unifi-chart/unifi ``` Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. ```console -helm install unifi k8s-at-home/unifi -f values.yaml +helm install unifi oci://ghcr.io/mkilchhofer/unifi-chart/unifi -f values.yaml ``` ## Custom configuration diff --git a/charts/unifi/templates/captive-ingress.yaml b/charts/unifi/templates/captive-ingress.yaml index 70e51d7..5767f4f 100644 --- a/charts/unifi/templates/captive-ingress.yaml +++ b/charts/unifi/templates/captive-ingress.yaml @@ -1,47 +1,41 @@ {{- if (and .Values.captivePortalService.ingress.enabled (not .Values.unifiedService.enabled)) }} {{- $fullName := include "unifi.fullname" . -}} -{{- $ingressPath := .Values.captivePortalService.ingress.path -}} -{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}} -{{- $captivePortalHttps := .Values.captivePortalService.https -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }}-captive - labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- with .Values.captivePortalService.ingress.annotations }} + {{- with .Values.captivePortalService.ingress.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} -spec: -{{- if .Values.captivePortalService.ingress.tls }} - tls: - {{- range .Values.captivePortalService.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} + {{- toYaml . | nindent 4 }} {{- end }} -{{- end }} + labels: + {{- include "unifi.labels" . | nindent 4 }} +spec: rules: {{- range .Values.captivePortalService.ingress.hosts }} - host: {{ . }} http: paths: - - path: {{ $ingressPath }} + - path: {{ $.Values.captivePortalService.ingress.path }} pathType: Prefix backend: service: name: {{ $fullName }}-captiveportalservice port: - {{- if $captivePortalHttps }} + {{- if $.Values.captivePortalService.https }} name: captive-https {{- else }} name: captive-http {{- end }} {{- end }} + {{- if .Values.captivePortalService.ingress.tls }} + tls: + {{- range .Values.captivePortalService.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} {{- end }} diff --git a/charts/unifi/templates/captive-svc.yaml b/charts/unifi/templates/captive-svc.yaml index 81e0b14..2e3fe68 100644 --- a/charts/unifi/templates/captive-svc.yaml +++ b/charts/unifi/templates/captive-svc.yaml @@ -1,26 +1,23 @@ -{{ if (and .Values.captivePortalService.enabled (not .Values.unifiedService.enabled)) }} +{{- if and .Values.captivePortalService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-captiveportalservice labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.captivePortalService.labels }} -{{ toYaml .Values.captivePortalService.labels | indent 4 }} -{{- end }} -{{- with .Values.captivePortalService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.captivePortalService.labels }} + {{- toYaml .Values.captivePortalService.labels | nindent 4 }} + {{- end }} + {{- with .Values.captivePortalService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.captivePortalService.type "ClusterIP") (empty .Values.captivePortalService.type)) }} type: ClusterIP {{- if .Values.captivePortalService.clusterIP }} clusterIP: {{ .Values.captivePortalService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.captivePortalService.type "LoadBalancer" }} type: {{ .Values.captivePortalService.type }} {{- if .Values.captivePortalService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.captivePortalService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.captivePortalService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.captivePortalService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.captivePortalService.type }} {{- end }} -{{- if .Values.captivePortalService.externalIPs }} + {{- if .Values.captivePortalService.externalIPs }} externalIPs: -{{ toYaml .Values.captivePortalService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.captivePortalService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.captivePortalService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.captivePortalService.externalTrafficPolicy }} {{- end }} @@ -45,16 +42,16 @@ spec: targetPort: captive-http protocol: TCP name: captive-http -{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} + {{- if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} nodePort: {{.Values.captivePortalService.http}} -{{ end }} + {{- end }} - port: {{ .Values.captivePortalService.https }} targetPort: captive-https protocol: TCP name: captive-https -{{ if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} + {{- if (and (eq .Values.captivePortalService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} nodePort: {{.Values.captivePortalService.https}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 6 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/configmap.yaml b/charts/unifi/templates/configmap.yaml index 463abb1..ce65068 100644 --- a/charts/unifi/templates/configmap.yaml +++ b/charts/unifi/templates/configmap.yaml @@ -4,10 +4,7 @@ apiVersion: v1 metadata: name: {{ template "unifi.fullname" . }} labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "unifi.labels" . | nindent 4 }} data: -{{ toYaml .Values.extraConfigFiles | indent 2 }} + {{- toYaml .Values.extraConfigFiles | nindent 2 }} {{- end }} diff --git a/charts/unifi/templates/controller-ingress.yaml b/charts/unifi/templates/controller-ingress.yaml index 4e090fd..35ab6e0 100644 --- a/charts/unifi/templates/controller-ingress.yaml +++ b/charts/unifi/templates/controller-ingress.yaml @@ -1,42 +1,37 @@ {{- if (and .Values.controllerService.ingress.enabled (not .Values.unifiedService.enabled)) }} {{- $fullName := include "unifi.fullname" . -}} -{{- $ingressPath := .Values.controllerService.ingress.path -}} -{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }}-controller - labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- with .Values.controllerService.ingress.annotations }} + {{- with .Values.controllerService.ingress.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} -spec: -{{- if .Values.controllerService.ingress.tls }} - tls: - {{- range .Values.controllerService.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} + {{- toYaml . | nindent 4 }} {{- end }} -{{- end }} + labels: + {{- include "unifi.labels" . | nindent 4 }} +spec: rules: - {{- range .Values.controllerService.ingress.hosts }} + {{- range .Values.controllerService.ingress.hosts }} - host: {{ . }} http: paths: - - path: {{ $ingressPath }} + - path: {{ $.Values.controllerService.ingress.path }} pathType: Prefix backend: service: name: {{ $fullName }}-controller port: name: controller + {{- end }} + {{- if .Values.controllerService.ingress.tls }} + tls: + {{- range .Values.controllerService.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/unifi/templates/controller-svc.yaml b/charts/unifi/templates/controller-svc.yaml index ca3dc9a..e312f7a 100644 --- a/charts/unifi/templates/controller-svc.yaml +++ b/charts/unifi/templates/controller-svc.yaml @@ -1,26 +1,23 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.controllerService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-controller labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.controllerService.labels }} -{{ toYaml .Values.controllerService.labels | indent 4 }} -{{- end }} -{{- with .Values.controllerService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.controllerService.labels }} + {{- toYaml .Values.controllerService.labels | nindent 4 }} + {{- end }} + {{- with .Values.controllerService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.controllerService.type "ClusterIP") (empty .Values.controllerService.type)) }} type: ClusterIP {{- if .Values.controllerService.clusterIP }} clusterIP: {{ .Values.controllerService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.controllerService.type "LoadBalancer" }} type: {{ .Values.controllerService.type }} {{- if .Values.controllerService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.controllerService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.controllerService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.controllerService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.controllerService.type }} {{- end }} -{{- if .Values.controllerService.externalIPs }} + {{- if .Values.controllerService.externalIPs }} externalIPs: -{{ toYaml .Values.controllerService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.controllerService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.controllerService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.controllerService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: targetPort: controller protocol: TCP name: controller -{{ if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }} + {{- if (and (eq .Values.controllerService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }} nodePort: {{.Values.controllerService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/deployment.yaml b/charts/unifi/templates/deployment.yaml index 181f4f1..495519a 100644 --- a/charts/unifi/templates/deployment.yaml +++ b/charts/unifi/templates/deployment.yaml @@ -9,10 +9,7 @@ metadata: {{- end }} {{- end }} labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "unifi.labels" . | nindent 4 }} spec: replicas: 1 strategy: @@ -23,8 +20,7 @@ spec: template: metadata: labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + {{- include "unifi.selectorLabels" . | nindent 8 }} {{- if .Values.podAnnotations }} annotations: {{- range $key, $value := .Values.podAnnotations }} @@ -172,17 +168,23 @@ spec: - name: extra-config mountPath: /configmap {{- end }} - {{- if .Values.extraVolumeMounts }}{{ toYaml .Values.extraVolumeMounts | trim | nindent 12 }}{{ end }} + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} resources: -{{ toYaml .Values.resources | indent 12 }} + {{- toYaml .Values.resources | nindent 12 }} volumes: - name: unifi-data {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "unifi.fullname" . }}{{- end }} + {{- if .Values.persistence.existingClaim }} + claimName: {{ .Values.persistence.existingClaim }} + {{- else }} + claimName: {{ template "unifi.fullname" . }} + {{- end }} {{- else }} emptyDir: {} - {{ end }} + {{- end }} {{- if .Values.extraConfigFiles }} - name: extra-config configMap: @@ -204,16 +206,18 @@ spec: - key: promtail.yaml path: promtail.yaml {{- end }} - {{- if .Values.extraVolumes }}{{ toYaml .Values.extraVolumes | trim | nindent 8 }}{{ end }} - {{- with .Values.nodeSelector }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} tolerations: -{{ toYaml . | indent 8 }} - {{- end }} + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/unifi/templates/discovery-svc.yaml b/charts/unifi/templates/discovery-svc.yaml index 8567d62..e8cedac 100644 --- a/charts/unifi/templates/discovery-svc.yaml +++ b/charts/unifi/templates/discovery-svc.yaml @@ -1,20 +1,17 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.discoveryService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-discovery labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.discoveryService.labels }} -{{ toYaml .Values.discoveryService.labels | indent 4 }} -{{- end }} -{{- with .Values.discoveryService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.discoveryService.labels }} + {{- toYaml .Values.discoveryService.labels | nindent 4 }} + {{- end }} + {{- with .Values.discoveryService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.discoveryService.type "ClusterIP") (empty .Values.discoveryService.type)) }} type: ClusterIP @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.discoveryService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.discoveryService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.discoveryService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.discoveryService.type }} {{- end }} -{{- if .Values.discoveryService.externalIPs }} + {{- if .Values.discoveryService.externalIPs }} externalIPs: -{{ toYaml .Values.discoveryService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.discoveryService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.discoveryService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.discoveryService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: targetPort: discovery protocol: UDP name: discovery -{{ if (and (eq .Values.discoveryService.type "NodePort") (not (empty .Values.discoveryService.nodePort))) }} + {{- if (and (eq .Values.discoveryService.type "NodePort") (not (empty .Values.discoveryService.nodePort))) }} nodePort: {{.Values.discoveryService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/gui-svc.yaml b/charts/unifi/templates/gui-svc.yaml index da26021..37537d6 100644 --- a/charts/unifi/templates/gui-svc.yaml +++ b/charts/unifi/templates/gui-svc.yaml @@ -1,26 +1,23 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.guiService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-gui labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.guiService.labels }} -{{ toYaml .Values.guiService.labels | indent 4 }} -{{- end }} -{{- with .Values.guiService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.guiService.labels }} + {{- toYaml .Values.guiService.labels | nindent 4 }} + {{- end }} + {{- with .Values.guiService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.guiService.type "ClusterIP") (empty .Values.guiService.type)) }} type: ClusterIP {{- if .Values.guiService.clusterIP }} clusterIP: {{ .Values.guiService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.guiService.type "LoadBalancer" }} type: {{ .Values.guiService.type }} {{- if .Values.guiService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.guiService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.guiService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.guiService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.guiService.type }} {{- end }} -{{- if .Values.guiService.externalIPs }} + {{- if .Values.guiService.externalIPs }} externalIPs: -{{ toYaml .Values.guiService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.guiService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.guiService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.guiService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: port: {{ .Values.guiService.port }} protocol: TCP targetPort: https-gui -{{ if (and (eq .Values.guiService.type "NodePort") (not (empty .Values.guiService.nodePort))) }} + {{- if (and (eq .Values.guiService.type "NodePort") (not (empty .Values.guiService.nodePort))) }} nodePort: {{.Values.guiService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/ingress.yaml b/charts/unifi/templates/ingress.yaml index 2273224..b57d9cb 100644 --- a/charts/unifi/templates/ingress.yaml +++ b/charts/unifi/templates/ingress.yaml @@ -1,43 +1,41 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "unifi.fullname" . -}} -{{- $ingressPath := .Values.ingress.path -}} -{{- $unifiedServiceEnabled := .Values.unifiedService.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} -{{- with .Values.ingress.annotations }} + {{- with .Values.ingress.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} labels: {{- include "unifi.labels" . | nindent 4 }} spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} rules: {{- range .Values.ingress.hosts }} - host: {{ . }} http: paths: - - path: {{ $ingressPath }} + - path: {{ $.Values.ingress.path }} pathType: Prefix backend: service: - {{- if $unifiedServiceEnabled }} + {{- if $.Values.unifiedService.enabled }} name: {{ $fullName }} {{- else }} name: {{ $fullName }}-gui {{- end }} port: name: https-gui + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/unifi/templates/promtail-configmap.yaml b/charts/unifi/templates/promtail-configmap.yaml index 4f233af..64eb687 100644 --- a/charts/unifi/templates/promtail-configmap.yaml +++ b/charts/unifi/templates/promtail-configmap.yaml @@ -4,10 +4,7 @@ kind: ConfigMap metadata: name: {{ template "unifi.fullname" . }}-promtail labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "unifi.labels" . | nindent 4 }} data: promtail.yaml: | server: diff --git a/charts/unifi/templates/pvc.yaml b/charts/unifi/templates/pvc.yaml index 041ca56..25ff9a5 100644 --- a/charts/unifi/templates/pvc.yaml +++ b/charts/unifi/templates/pvc.yaml @@ -4,10 +4,7 @@ apiVersion: v1 metadata: name: {{ template "unifi.fullname" . }} labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "unifi.labels" . | nindent 4 }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} @@ -21,4 +18,4 @@ spec: storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} {{- end }} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/unifi/templates/speedtest-svc.yaml b/charts/unifi/templates/speedtest-svc.yaml index f59f1f7..ff017f0 100644 --- a/charts/unifi/templates/speedtest-svc.yaml +++ b/charts/unifi/templates/speedtest-svc.yaml @@ -1,26 +1,23 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.speedtestService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-speedtest labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.speedtestService.labels }} -{{ toYaml .Values.speedtestService.labels | indent 4 }} -{{- end }} -{{- with .Values.speedtestService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.speedtestService.labels }} + {{- toYaml .Values.speedtestService.labels | nindent 4 }} + {{- end }} + {{- with .Values.speedtestService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.speedtestService.type "ClusterIP") (empty .Values.speedtestService.type)) }} type: ClusterIP {{- if .Values.speedtestService.clusterIP }} clusterIP: {{ .Values.speedtestService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.speedtestService.type "LoadBalancer" }} type: {{ .Values.speedtestService.type }} {{- if .Values.speedtestService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.speedtestService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.speedtestService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.speedtestService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.speedtestService.type }} {{- end }} -{{- if .Values.speedtestService.externalIPs }} + {{- if .Values.speedtestService.externalIPs }} externalIPs: -{{ toYaml .Values.speedtestService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.speedtestService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.speedtestService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.speedtestService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: targetPort: speedtest protocol: TCP name: speedtest -{{ if (and (eq .Values.speedtestService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }} + {{- if (and (eq .Values.speedtestService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }} nodePort: {{.Values.speedtestService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/stun-svc.yaml b/charts/unifi/templates/stun-svc.yaml index bd766ee..9fc35d7 100644 --- a/charts/unifi/templates/stun-svc.yaml +++ b/charts/unifi/templates/stun-svc.yaml @@ -1,26 +1,23 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.stunService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-stun labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.stunService.labels }} -{{ toYaml .Values.stunService.labels | indent 4 }} -{{- end }} -{{- with .Values.stunService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.stunService.labels }} + {{- toYaml .Values.stunService.labels | nindent 4 }} + {{- end }} + {{- with .Values.stunService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{ toYaml . | indent 4 }} + {{- end }} spec: {{- if (or (eq .Values.stunService.type "ClusterIP") (empty .Values.stunService.type)) }} type: ClusterIP {{- if .Values.stunService.clusterIP }} clusterIP: {{ .Values.stunService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.stunService.type "LoadBalancer" }} type: {{ .Values.stunService.type }} {{- if .Values.stunService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.stunService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.stunService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.stunService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.stunService.type }} {{- end }} -{{- if .Values.stunService.externalIPs }} + {{- if .Values.stunService.externalIPs }} externalIPs: -{{ toYaml .Values.stunService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.stunService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.stunService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.stunService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: targetPort: stun protocol: UDP name: stun -{{ if (and (eq .Values.stunService.type "NodePort") (not (empty .Values.stunService.nodePort))) }} + {{- if (and (eq .Values.stunService.type "NodePort") (not (empty .Values.stunService.nodePort))) }} nodePort: {{.Values.stunService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/syslog-svc.yaml b/charts/unifi/templates/syslog-svc.yaml index 460d7fe..d53a906 100644 --- a/charts/unifi/templates/syslog-svc.yaml +++ b/charts/unifi/templates/syslog-svc.yaml @@ -1,26 +1,23 @@ -{{ if not .Values.unifiedService.enabled }} +{{- if and .Values.syslogService.enabled (not .Values.unifiedService.enabled) }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }}-syslog labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.syslogService.labels }} -{{ toYaml .Values.syslogService.labels | indent 4 }} -{{- end }} -{{- with .Values.syslogService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.syslogService.labels }} + {{- toYaml .Values.syslogService.labels | nindent 4 }} + {{- end }} + {{- with .Values.syslogService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.syslogService.type "ClusterIP") (empty .Values.syslogService.type)) }} type: ClusterIP {{- if .Values.syslogService.clusterIP }} clusterIP: {{ .Values.syslogService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.syslogService.type "LoadBalancer" }} type: {{ .Values.syslogService.type }} {{- if .Values.syslogService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.syslogService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.syslogService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.syslogService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.syslogService.type }} {{- end }} -{{- if .Values.syslogService.externalIPs }} + {{- if .Values.syslogService.externalIPs }} externalIPs: -{{ toYaml .Values.syslogService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.syslogService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.syslogService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.syslogService.externalTrafficPolicy }} {{- end }} @@ -45,9 +42,9 @@ spec: targetPort: syslog protocol: UDP name: syslog -{{ if (and (eq .Values.syslogService.type "NodePort") (not (empty .Values.syslogService.nodePort))) }} + {{- if (and (eq .Values.syslogService.type "NodePort") (not (empty .Values.syslogService.nodePort))) }} nodePort: {{.Values.syslogService.nodePort}} -{{ end }} + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/templates/unified-svc.yaml b/charts/unifi/templates/unified-svc.yaml index aab4c4e..029d737 100644 --- a/charts/unifi/templates/unified-svc.yaml +++ b/charts/unifi/templates/unified-svc.yaml @@ -1,26 +1,23 @@ -{{ if .Values.unifiedService.enabled }} +{{- if .Values.unifiedService.enabled }} apiVersion: v1 kind: Service metadata: name: {{ template "unifi.fullname" . }} labels: - app.kubernetes.io/name: {{ include "unifi.name" . }} - helm.sh/chart: {{ include "unifi.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.unifiedService.labels }} -{{ toYaml .Values.unifiedService.labels | indent 4 }} -{{- end }} -{{- with .Values.unifiedService.annotations }} + {{- include "unifi.labels" . | nindent 4 }} + {{- if .Values.unifiedService.labels }} + {{- toYaml .Values.unifiedService.labels | nindent 4 }} + {{- end }} + {{- with .Values.unifiedService.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if (or (eq .Values.unifiedService.type "ClusterIP") (empty .Values.unifiedService.type)) }} type: ClusterIP {{- if .Values.unifiedService.clusterIP }} clusterIP: {{ .Values.unifiedService.clusterIP }} - {{end}} + {{- end }} {{- else if eq .Values.unifiedService.type "LoadBalancer" }} type: {{ .Values.unifiedService.type }} {{- if .Values.unifiedService.loadBalancerIP }} @@ -28,15 +25,15 @@ spec: {{- end }} {{- if .Values.unifiedService.loadBalancerSourceRanges }} loadBalancerSourceRanges: -{{ toYaml .Values.unifiedService.loadBalancerSourceRanges | indent 4 }} + {{- toYaml .Values.unifiedService.loadBalancerSourceRanges | nindent 4 }} {{- end -}} {{- else }} type: {{ .Values.unifiedService.type }} {{- end }} -{{- if .Values.unifiedService.externalIPs }} + {{- if .Values.unifiedService.externalIPs }} externalIPs: -{{ toYaml .Values.unifiedService.externalIPs | indent 4 }} -{{- end }} + {{- toYaml .Values.unifiedService.externalIPs | nindent 4 }} + {{- end }} {{- if .Values.unifiedService.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.unifiedService.externalTrafficPolicy }} {{- end }} @@ -45,62 +42,61 @@ spec: targetPort: controller protocol: TCP name: controller -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.controllerService.nodePort))) }} nodePort: {{.Values.controllerService.nodePort}} -{{ end }} + {{- end }} - port: {{ .Values.discoveryService.port }} targetPort: discovery protocol: UDP name: discovery -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.discoveryService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.discoveryService.nodePort))) }} nodePort: {{.Values.discoveryService.nodePort}} -{{ end }} + {{- end }} - port: {{ .Values.stunService.port }} targetPort: stun protocol: UDP name: stun -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.stunService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.stunService.nodePort))) }} nodePort: {{.Values.stunService.nodePort}} -{{ end }} + {{- end }} - port: {{ .Values.syslogService.port }} targetPort: syslog protocol: UDP name: syslog -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.syslogService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.syslogService.nodePort))) }} nodePort: {{.Values.syslogService.nodePort}} -{{ end }} + {{- end }} - name: https-gui port: {{ .Values.guiService.port }} protocol: TCP targetPort: https-gui -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.guiService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.guiService.nodePort))) }} nodePort: {{.Values.guiService.nodePort}} -{{ end }} -{{ if .Values.captivePortalService.enabled }} + {{- end }} + {{- if .Values.captivePortalService.enabled }} - name: captive-http port: {{ .Values.captivePortalService.http }} protocol: TCP targetPort: captive-http -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.http))) }} nodePort: {{.Values.captivePortalService.http}} -{{ end }} + {{- end }} - name: captive-https port: {{ .Values.captivePortalService.https }} protocol: TCP targetPort: captive-https -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.captivePortalService.https))) }} nodePort: {{.Values.captivePortalService.https}} -{{ end }} + {{- end }} + {{- end }} - port: {{ .Values.speedtestService.port }} targetPort: speedtest protocol: TCP name: speedtest -{{ if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }} + {{- if (and (eq .Values.unifiedService.type "NodePort") (not (empty .Values.speedtestService.nodePort))) }} nodePort: {{.Values.speedtestService.nodePort}} -{{ end }} -{{ end }} - + {{- end }} selector: {{- include "unifi.selectorLabels" . | nindent 4 }} -{{ end }} +{{- end }} diff --git a/charts/unifi/values.yaml b/charts/unifi/values.yaml index 7ff000c..a69e484 100644 --- a/charts/unifi/values.yaml +++ b/charts/unifi/values.yaml @@ -47,7 +47,7 @@ unifiedService: guiService: # -- Enable service for the main web UI - enabled: false + enabled: true # -- Kubernetes service type type: ClusterIP # -- Kubernetes port where the service is exposed @@ -72,7 +72,7 @@ guiService: captivePortalService: # -- Enable service for the captive portal webpage - enabled: false + enabled: true # -- Kubernetes service type type: ClusterIP # -- Kubernetes port where the http service is exposed @@ -109,7 +109,7 @@ captivePortalService: controllerService: # -- Enable service for the controller - enabled: false + enabled: true # -- Kubernetes service type type: NodePort # -- Kubernetes port where the service is exposed @@ -144,7 +144,7 @@ controllerService: stunService: # -- Enable service the STUN feature - enabled: false + enabled: true # -- Kubernetes service type type: NodePort # -- Kubernetes port where the service is exposed @@ -165,7 +165,7 @@ stunService: discoveryService: # -- Enable service for the discovery feature - enabled: false + enabled: true # -- Kubernetes service type type: NodePort # -- Kubernetes port where the service is exposed @@ -202,7 +202,7 @@ discoveryService: syslogService: # -- Enable service for the syslog server. # Used to capture syslog from Unifi devices if the feature is enabled in the site configuration. - enabled: false + enabled: true # -- Kubernetes service type type: NodePort # -- Kubernetes port where the service is exposed @@ -223,7 +223,7 @@ syslogService: speedtestService: # -- Enable service for mobile speedtest inside the UniFi Mobile app - enabled: false + enabled: true # -- Kubernetes service type type: ClusterIP # -- Kubernetes port where the service is exposed @@ -246,7 +246,7 @@ speedtestService: ## Ingress settings ingress: # -- Enable Ingress resource - enabled: false + enabled: true # -- Annotations for Ingress resource annotations: {} # -- Ingress path @@ -256,6 +256,9 @@ ingress: - chart-example.local # -- Ingress TLS configuration tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local # -- Timezone for UniFi controller timezone: UTC @@ -314,10 +317,10 @@ mongodb: persistence: # -- Use persistent volume to store data enabled: false - # -- (string) Type of persistent volume claim - storageClass: - # -- (string) Use an existing PVC to persist data - existingClaim: + # -- Storage Class to use for the PVC + storageClass: "" + # -- Use an existing PVC to persist data + existingClaim: "" # -- Persistence access modes accessMode: ReadWriteOnce # -- Size of persistent volume claim