Skip to content

Commit

Permalink
[stable/unifi] unifi chart enhancements (helm#12047)
Browse files Browse the repository at this point in the history
* switching unifi chart to SatefulSet

* based on the persistent nature of this chart as well as [this
discussion](helm#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 <jeff@billimek.com>

* using volumeClaimTemplates for statefulSet

* also updating label syntax to current helm standards (e.g.
`app.kubernetes.io/name`)

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* fixing indenting

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* using Parallel podManagementPolicy

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* revert to Deployment and leverage strategy types

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* include readme entry for strategyType

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* hard-code replica count and add mcronce to Chart maintainers

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* fixing linting error

Signed-off-by: Jeff Billimek <jeff@billimek.com>
Signed-off-by: Kevin Duane <duank001@apps.disney.com>
  • Loading branch information
billimek authored and Kevin Duane committed Mar 29, 2019
1 parent 2449d4b commit 35fdceb
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 47 deletions.
6 changes: 4 additions & 2 deletions stable/unifi/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,3 +15,5 @@ sources:
maintainers:
- name: billimek
email: jeff@billimek.com
- name: mcronce
email: mike@quadra-tec.net
2 changes: 2 additions & 0 deletions stable/unifi/OWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
approvers:
- billimek
- mcronce
reviewers:
- billimek
- mcronce
1 change: 1 addition & 0 deletions stable/unifi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down
12 changes: 6 additions & 6 deletions stable/unifi/templates/controller-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
20 changes: 11 additions & 9 deletions stable/unifi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 6 additions & 6 deletions stable/unifi/templates/discovery-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
12 changes: 6 additions & 6 deletions stable/unifi/templates/gui-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
8 changes: 4 additions & 4 deletions stable/unifi/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 6 additions & 6 deletions stable/unifi/templates/stun-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
12 changes: 6 additions & 6 deletions stable/unifi/templates/unified-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}

5 changes: 3 additions & 2 deletions stable/unifi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35fdceb

Please sign in to comment.