From 1ec66724f07e9bb1a1f64c7dc24380cae69492da Mon Sep 17 00:00:00 2001 From: Jeff Billimek Date: Thu, 28 Mar 2019 12:32:42 -0400 Subject: [PATCH] [stable/unifi] unifi chart enhancements (#12047) * switching unifi chart to SatefulSet * based on the persistent nature of this chart as well as [this discussion](https://github.com/helm/charts/issues/1863), migrating the chart to a StatefulSet instead of a deployment. As a result bumping the major version * bumping unifi controller to the latest stable version (5.10.19) * adding @mcronce to the OWNERS file Signed-off-by: Jeff Billimek * using volumeClaimTemplates for statefulSet * also updating label syntax to current helm standards (e.g. `app.kubernetes.io/name`) Signed-off-by: Jeff Billimek * fixing indenting Signed-off-by: Jeff Billimek * using Parallel podManagementPolicy Signed-off-by: Jeff Billimek * revert to Deployment and leverage strategy types Signed-off-by: Jeff Billimek * include readme entry for strategyType Signed-off-by: Jeff Billimek * hard-code replica count and add mcronce to Chart maintainers Signed-off-by: Jeff Billimek * fixing linting error Signed-off-by: Jeff Billimek --- stable/unifi/Chart.yaml | 6 ++++-- stable/unifi/OWNERS | 2 ++ stable/unifi/README.md | 1 + stable/unifi/templates/controller-svc.yaml | 12 ++++++------ stable/unifi/templates/deployment.yaml | 20 +++++++++++--------- stable/unifi/templates/discovery-svc.yaml | 12 ++++++------ stable/unifi/templates/gui-svc.yaml | 12 ++++++------ stable/unifi/templates/ingress.yaml | 8 ++++---- stable/unifi/templates/stun-svc.yaml | 12 ++++++------ stable/unifi/templates/unified-svc.yaml | 12 ++++++------ stable/unifi/values.yaml | 5 +++-- 11 files changed, 55 insertions(+), 47 deletions(-) diff --git a/stable/unifi/Chart.yaml b/stable/unifi/Chart.yaml index cc41de540111..9c288992544c 100644 --- a/stable/unifi/Chart.yaml +++ b/stable/unifi/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: 5.9.29 +appVersion: 5.10.19 description: Ubiquiti Network's Unifi Controller name: unifi -version: 0.3.3 +version: 0.4.0 keywords: - ubiquiti - unifi @@ -15,3 +15,5 @@ sources: maintainers: - name: billimek email: jeff@billimek.com + - name: mcronce + email: mike@quadra-tec.net diff --git a/stable/unifi/OWNERS b/stable/unifi/OWNERS index b90909f487d8..023d223bf31d 100644 --- a/stable/unifi/OWNERS +++ b/stable/unifi/OWNERS @@ -1,4 +1,6 @@ approvers: - billimek +- mcronce reviewers: - billimek +- mcronce \ No newline at end of file diff --git a/stable/unifi/README.md b/stable/unifi/README.md index d86eb431c753..b9034be496b4 100644 --- a/stable/unifi/README.md +++ b/stable/unifi/README.md @@ -39,6 +39,7 @@ The following tables lists the configurable parameters of the Unifi chart and th | `image.repository` | Image repository | `jacobalberty/unifi` | | `image.tag` | Image tag. Possible values listed [here][docker]. | `5.9.29` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` | | `guiService.type` | Kubernetes service type for the Unifi GUI | `ClusterIP` | | `guiService.port` | Kubernetes port where the Unifi GUI is exposed | `8443` | | `guiService.annotations` | Service annotations for the Unifi GUI | `{}` | diff --git a/stable/unifi/templates/controller-svc.yaml b/stable/unifi/templates/controller-svc.yaml index 37333fb2dd0f..2fe7076a45bd 100644 --- a/stable/unifi/templates/controller-svc.yaml +++ b/stable/unifi/templates/controller-svc.yaml @@ -4,10 +4,10 @@ kind: Service metadata: name: {{ template "unifi.fullname" . }}-controller labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} @@ -49,6 +49,6 @@ spec: nodePort: {{.Values.controllerService.nodePort}} {{ end }} selector: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{ end }} diff --git a/stable/unifi/templates/deployment.yaml b/stable/unifi/templates/deployment.yaml index 1b1fc2eb7645..ca84fd015c49 100644 --- a/stable/unifi/templates/deployment.yaml +++ b/stable/unifi/templates/deployment.yaml @@ -3,21 +3,23 @@ kind: Deployment metadata: name: {{ template "unifi.fullname" . }} labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} spec: - replicas: {{ .Values.replicaCount }} + replicas: 1 + strategy: + type: {{ .Values.strategyType }} selector: matchLabels: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: labels: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Values.podAnnotations }} annotations: {{- range $key, $value := .Values.podAnnotations }} diff --git a/stable/unifi/templates/discovery-svc.yaml b/stable/unifi/templates/discovery-svc.yaml index 953b74b603a8..870748cd02b6 100644 --- a/stable/unifi/templates/discovery-svc.yaml +++ b/stable/unifi/templates/discovery-svc.yaml @@ -4,10 +4,10 @@ kind: Service metadata: name: {{ template "unifi.fullname" . }}-discovery labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} @@ -49,6 +49,6 @@ spec: nodePort: {{.Values.discoveryService.nodePort}} {{ end }} selector: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{ end }} diff --git a/stable/unifi/templates/gui-svc.yaml b/stable/unifi/templates/gui-svc.yaml index e57415c34a61..9f14531843be 100644 --- a/stable/unifi/templates/gui-svc.yaml +++ b/stable/unifi/templates/gui-svc.yaml @@ -4,10 +4,10 @@ kind: Service metadata: name: {{ template "unifi.fullname" . }}-gui labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} @@ -49,6 +49,6 @@ spec: nodePort: {{.Values.guiService.nodePort}} {{ end }} selector: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{ end }} diff --git a/stable/unifi/templates/ingress.yaml b/stable/unifi/templates/ingress.yaml index 6adc28dc2223..43a1d64ffb05 100644 --- a/stable/unifi/templates/ingress.yaml +++ b/stable/unifi/templates/ingress.yaml @@ -7,10 +7,10 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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.ingress.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/unifi/templates/stun-svc.yaml b/stable/unifi/templates/stun-svc.yaml index 6cff1746cef2..45819bc3f6d4 100644 --- a/stable/unifi/templates/stun-svc.yaml +++ b/stable/unifi/templates/stun-svc.yaml @@ -4,10 +4,10 @@ kind: Service metadata: name: {{ template "unifi.fullname" . }}-stun labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} @@ -49,6 +49,6 @@ spec: nodePort: {{.Values.stunService.nodePort}} {{ end }} selector: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{ end }} diff --git a/stable/unifi/templates/unified-svc.yaml b/stable/unifi/templates/unified-svc.yaml index 82a6951155e1..125c3580aff7 100644 --- a/stable/unifi/templates/unified-svc.yaml +++ b/stable/unifi/templates/unified-svc.yaml @@ -4,10 +4,10 @@ kind: Service metadata: name: {{ template "unifi.fullname" . }} labels: - app: {{ template "unifi.name" . }} - chart: {{ template "unifi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + 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 }} @@ -70,7 +70,7 @@ spec: nodePort: {{.Values.guiService.nodePort}} {{ end }} selector: - app: {{ template "unifi.name" . }} - release: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "unifi.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} {{ end }} diff --git a/stable/unifi/values.yaml b/stable/unifi/values.yaml index 64e69390dfd9..64adda2c2de5 100644 --- a/stable/unifi/values.yaml +++ b/stable/unifi/values.yaml @@ -2,11 +2,12 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -replicaCount: 1 +# upgrade strategy type (e.g. Recreate or RollingUpdate) +strategyType: Recreate image: repository: jacobalberty/unifi - tag: 5.9.29 + tag: 5.10.19 pullPolicy: IfNotPresent # If enabled, the controller, discovery, GUI, and STUN services will not be