From e517cfa24a03f1c040bf8d16322c0cc9ffc561c1 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Mon, 17 Jan 2022 16:17:28 +0100 Subject: [PATCH] element-web: Update to 1.9.9 --- charts/element-web/Chart.yaml | 4 +- charts/matrix-media-repo/Chart.yaml | 4 ++ .../matrix-media-repo/templates/_helpers.tpl | 64 +++++++++++++++++++ .../matrix-media-repo/templates/secrets.yaml | 36 +++++++++++ charts/matrix-media-repo/values.yaml | 38 +++++++++++ charts/netbox/Chart.yaml | 4 +- charts/netbox/templates/configuration.yaml | 14 ++++ .../templates/deployment-housekeeping.yaml | 16 ++++- .../netbox/templates/deployment-worker.yaml | 16 ++++- charts/netbox/templates/deployment.yaml | 10 +++ charts/netbox/values.yaml | 3 + 11 files changed, 201 insertions(+), 8 deletions(-) diff --git a/charts/element-web/Chart.yaml b/charts/element-web/Chart.yaml index 68420b8..421cd19 100644 --- a/charts/element-web/Chart.yaml +++ b/charts/element-web/Chart.yaml @@ -7,10 +7,10 @@ description: | Talk to everyone through the open global Matrix network, protected by proper end-to-end encryption. icon: https://element.io/images/element-logo.svg -appVersion: 1.9.8 +appVersion: 1.9.9 type: application -version: 1.0.43 +version: 1.0.44 maintainers: - name: Alexander Olofsson diff --git a/charts/matrix-media-repo/Chart.yaml b/charts/matrix-media-repo/Chart.yaml index fed3cb2..95fec44 100644 --- a/charts/matrix-media-repo/Chart.yaml +++ b/charts/matrix-media-repo/Chart.yaml @@ -15,3 +15,7 @@ dependencies: version: ~8.9.4 repository: https://charts.bitnami.com/bitnami condition: postgresql.enabled + - name: redis + version: ~10.6.10 + repository: https://charts.bitnami.com/bitnami + condition: redis.enabled diff --git a/charts/matrix-media-repo/templates/_helpers.tpl b/charts/matrix-media-repo/templates/_helpers.tpl index a348ab3..f72b395 100644 --- a/charts/matrix-media-repo/templates/_helpers.tpl +++ b/charts/matrix-media-repo/templates/_helpers.tpl @@ -146,3 +146,67 @@ Set postgresql database {{ required "A valid externalPostgresql.database is required" .Values.externalPostgresql.database }} {{- end -}} {{- end -}} + + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "matrix-media-repo.redis.fullname" -}} +{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Set redis host +*/}} +{{- define "matrix-media-repo.redis.host" -}} +{{- if .Values.redis.enabled -}} +{{- template "matrix-media-repo.redis.fullname" . -}}-master +{{- else -}} +{{ required "A valid externalRedis.host is required" .Values.externalRedis.host }} +{{- end -}} +{{- end -}} + +{{/* +Set redis secret +*/}} +{{- define "matrix-media-repo.redis.secret" -}} +{{- if .Values.redis.enabled -}} +{{- template "matrix-media-repo.redis.fullname" . -}} +{{- else -}} +{{- template "matrix-media-repo.fullname" . -}} +{{- end -}} +{{- end -}} + +{{/* +Set redis port +*/}} +{{- define "matrix-media-repo.redis.port" -}} +{{- if .Values.redis.enabled -}} +{{- default 6379 .Values.redis.redisPort }} +{{- else -}} +{{ required "A valid externalRedis.port is required" .Values.externalRedis.port }} +{{- end -}} +{{- end -}} + +{{/* +Set redis password +*/}} +{{- define "matrix-media-repo.redis.user" -}} +{{- if .Values.redis.enabled -}} +{{ .Values.redis.user }} +{{- else if .Values.externalRedis.user -}} +{{ .Values.externalRedis.user }} +{{- end -}} +{{- end -}} + +{{/* +Set redis password +*/}} +{{- define "matrix-media-repo.redis.password" -}} +{{- if .Values.redis.enabled -}} +{{ .Values.redis.password }} +{{- else if .Values.externalRedis.password -}} +{{ .Values.externalRedis.password }} +{{- end -}} +{{- end -}} diff --git a/charts/matrix-media-repo/templates/secrets.yaml b/charts/matrix-media-repo/templates/secrets.yaml index f3378db..b955646 100644 --- a/charts/matrix-media-repo/templates/secrets.yaml +++ b/charts/matrix-media-repo/templates/secrets.yaml @@ -13,3 +13,39 @@ stringData: {{- end }} postgres: "postgres://{{ include "matrix-media-repo.postgresql.username" . }}:{{ required "A password must be provided for Postgres" (include "matrix-media-repo.postgresql.password" .) }}@{{ include "matrix-media-repo.postgresql.host" . }}/{{ include "matrix-media-repo.postgresql.database" . }}{{ $sslmode }}" + 00-redis.yaml: | + redis: +{{- if .Values.redis.enabled }} + enabled: true + databaseNumber: 0 + shards: + {{- $redisHost := include "matrix-media-repo.redis.host" . }} + {{- $redisPort := include "matrix-media-repo.redis.port" . }} + {{- if .Values.redis.usePassword }} + {{- $redisUser := include "matrix-media-repo.redis.usr" . }} + {{- $redisPass := include "matrix-media-repo.redis.password" . }} + - name: k8s + addr: "redis://{{ $redisUser }}:{{ $redisPass}}@{{ $redisHost }}:{{ $redisPort }}/0" + {{- else }} + - name: k8s + addr: "{{ $redisHost }}:{{ $redisPass }}" + {{- end }} +{{- else if .Values.externalRedis.host }} + enabled: {{ .Values.externalRedis.host }} + databaseNumber: {{ .Values.externalRedis.database | default 0 }} + shards: +{{- $redisHost := include "matrix-media-repo.redis.host" . }} +{{- $redisPort := include "matrix-media-repo.redis.port" . }} +{{- $redisUser := include "matrix-media-repo.redis.usr" . }} +{{- $redisPass := include "matrix-media-repo.redis.password" . }} + - name: external + {{- if (or $redisUser $redisPass) }} + addr: "redis://{{ $redisUser }}:{{ $redisPass}}@{{ $redisHost }}:{{ $redisPort }}/0" + {{- else }} + addr: {{ .Values.externalRedis.host }}:{{ .Values.externalRedis.port }} + {{- end }} +{{- else }} + enabled: false + databaseNumber: 0 + shards: [] +{{- end }} diff --git a/charts/matrix-media-repo/values.yaml b/charts/matrix-media-repo/values.yaml index 1a9447f..251271b 100644 --- a/charts/matrix-media-repo/values.yaml +++ b/charts/matrix-media-repo/values.yaml @@ -100,6 +100,44 @@ externalPostgresql: database: matrix_media_repo # sslMode: require +redis: + enabled: false + + usePassword: true + # XXX Change me! + password: media-repo + + ## Or use existing secret with "redis-password" key + ## instead of static password + ## + # existingSecret: redis-secret + + cluster: + enabled: false + master: + persistence: + ## Note that Synapse only uses redis as a synchronization utility, so no + ## data will ever need to be persisted. + ## + enabled: false + statefulset: + updateStrategy: RollingUpdate + +## An externally configured Redis server to use for workers/sharding. +## +externalRedis: + # host: redis + port: 6379 + # user: media-repo + # password: media-repo + # database: 0 + + ## The name of an existing secret with redis credentials + #existingSecret: redis-secrets + + ## Password key to be retrieved from existing secret + #existingSecretPasswordKey: redis-password + ## Configures an application-specific service account. ## serviceAccount: diff --git a/charts/netbox/Chart.yaml b/charts/netbox/Chart.yaml index f612793..0c16c7d 100644 --- a/charts/netbox/Chart.yaml +++ b/charts/netbox/Chart.yaml @@ -7,10 +7,10 @@ description: | Important; With chart version 4.0.0 there are major upgrades to the packaged Redis and Postgres, as well as a major version bump of Netbox that introduces housekeeping. Take care when upgrading. icon: https://raw.githubusercontent.com/digitalocean/netbox/develop/netbox/project-static/img/netbox.ico -appVersion: 3.0.8 +appVersion: 3.1.0 type: application -version: 4.0.1 +version: 4.1.0 maintainers: - name: Alexander Olofsson email: ace@haxalot.com diff --git a/charts/netbox/templates/configuration.yaml b/charts/netbox/templates/configuration.yaml index 62cdd7a..f04df54 100644 --- a/charts/netbox/templates/configuration.yaml +++ b/charts/netbox/templates/configuration.yaml @@ -1,3 +1,17 @@ +{{- if .Values.extraConfiguration }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-extra + labels: + app.kubernetes.io/name: {{ include "netbox.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "netbox.chart" . }} +data: + extra.py: {{ .Values.extraConfiguration | toYaml | indent 2 }} +{{- end }} --- apiVersion: v1 kind: ConfigMap diff --git a/charts/netbox/templates/deployment-housekeeping.yaml b/charts/netbox/templates/deployment-housekeeping.yaml index d0c3424..f317a82 100644 --- a/charts/netbox/templates/deployment-housekeeping.yaml +++ b/charts/netbox/templates/deployment-housekeeping.yaml @@ -57,10 +57,22 @@ spec: name: {{ include "netbox.fullname" . }} resources: {{- toYaml .Values.housekeeping.resources | nindent 12 }} - {{- with .Values.housekeeping.nodeSelector }} + {{- if .Values.extraConfiguration }} + volumeMounts: + - name: netbox-extra-config + mountPath: /etc/netbox/config/extra.py + subPath: extra.py + {{- end }} + {{- with .Values.housekeeping.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- if .Values.extraConfiguration }} + volumes: + - name: netbox-extra-config + configMap: + name: {{ .Chart.Name }}-extra + {{- end }} {{- with .Values.housekeeping.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/netbox/templates/deployment-worker.yaml b/charts/netbox/templates/deployment-worker.yaml index 882aa9d..68bb6de 100644 --- a/charts/netbox/templates/deployment-worker.yaml +++ b/charts/netbox/templates/deployment-worker.yaml @@ -59,10 +59,22 @@ spec: name: {{ include "netbox.fullname" . }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} - {{- with .Values.worker.nodeSelector }} + {{- if .Values.extraConfiguration }} + volumeMounts: + - name: netbox-extra-config + mountPath: /etc/netbox/config/extra.py + subPath: extra.py + {{- end }} + {{- with .Values.worker.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + {{- if .Values.extraConfiguration }} + volumes: + - name: netbox-extra-config + configMap: + name: {{ .Chart.Name }}-extra + {{- end }} {{- with .Values.worker.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/netbox/templates/deployment.yaml b/charts/netbox/templates/deployment.yaml index ff4a4b0..f8742de 100644 --- a/charts/netbox/templates/deployment.yaml +++ b/charts/netbox/templates/deployment.yaml @@ -89,6 +89,11 @@ spec: volumeMounts: - name: data mountPath: /etc/netbox/media + {{- if .Values.extraConfiguration }} + - name: netbox-extra-config + mountPath: /etc/netbox/config/extra.py + subPath: extra.py + {{- end }} {{- with .Values.extraVolumeMounts }} {{ toYaml . | nindent 12 }} {{- end }} @@ -100,6 +105,11 @@ spec: - name: netbox-config-files configMap: name: {{ .Chart.Name }}-config-files + {{- if .Values.extraConfiguration }} + - name: netbox-extra-config + configMap: + name: {{ .Chart.Name }}-extra + {{- end }} - name: data {{- if .Values.persistence.enabled }} persistentVolumeClaim: diff --git a/charts/netbox/values.yaml b/charts/netbox/values.yaml index acd9c62..fbe95a3 100644 --- a/charts/netbox/values.yaml +++ b/charts/netbox/values.yaml @@ -88,6 +88,9 @@ extraSecrets: {} # EMAIL_PASSWORD: netbox # NAPALM_PASSWORD: '' +# Ends up stored as extra.py in the netbox configuration +extraConfiguration: '' + superuser: name: '' email: ''