From f203b6e4cdae6f42f5ba10f8be46086130290762 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 2 Jan 2026 13:35:09 +0100 Subject: [PATCH] migrate umami --- apps/charts/umami/Chart.yaml | 4 ++ apps/charts/umami/templates/database.yaml | 7 +-- apps/charts/umami/templates/deployment.yaml | 53 +----------------- .../templates/secret-external-secrets.yaml | 1 + .../templates/secret-password-generators.yaml | 1 + apps/charts/umami/templates/secret.yaml | 9 --- apps/charts/umami/templates/service.yaml | 16 +----- .../umami/templates/virtual-service.yaml | 40 +------------ apps/charts/umami/values.yaml | 56 +++++++++++++++++++ 9 files changed, 66 insertions(+), 121 deletions(-) create mode 100644 apps/charts/umami/templates/secret-external-secrets.yaml create mode 100644 apps/charts/umami/templates/secret-password-generators.yaml delete mode 100644 apps/charts/umami/templates/secret.yaml diff --git a/apps/charts/umami/Chart.yaml b/apps/charts/umami/Chart.yaml index 99ec772..d639976 100644 --- a/apps/charts/umami/Chart.yaml +++ b/apps/charts/umami/Chart.yaml @@ -1,3 +1,7 @@ apiVersion: v2 version: 1.0.0 name: umami +dependencies: + - name: common + version: 1.0.0 + repository: file://../../common diff --git a/apps/charts/umami/templates/database.yaml b/apps/charts/umami/templates/database.yaml index 6a30b53..8a7fad4 100644 --- a/apps/charts/umami/templates/database.yaml +++ b/apps/charts/umami/templates/database.yaml @@ -1,6 +1 @@ -apiVersion: homelab.mortenolsen.pro/v1 -kind: PostgresDatabase -metadata: - name: '{{ .Release.Name }}' -spec: - environment: '{{ .Values.globals.environment }}' +{{ include "common.database" . }} diff --git a/apps/charts/umami/templates/deployment.yaml b/apps/charts/umami/templates/deployment.yaml index ca43fb6..4508e33 100644 --- a/apps/charts/umami/templates/deployment.yaml +++ b/apps/charts/umami/templates/deployment.yaml @@ -1,52 +1 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: "{{ .Release.Name }}" -spec: - strategy: - type: RollingUpdate - replicas: 1 - revisionHistoryLimit: 0 - selector: - matchLabels: - app: "{{ .Release.Name }}" - template: - metadata: - labels: - app: "{{ .Release.Name }}" - spec: - containers: - - name: "{{ .Release.Name }}" - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: "{{ .Values.image.pullPolicy }}" - ports: - - name: http - containerPort: 3000 - protocol: TCP - livenessProbe: - tcpSocket: - port: http - readinessProbe: - tcpSocket: - port: http - env: - - name: TZ - value: "{{ .Values.globals.timezone }}" - - # - name: DISABLE_LOGIN - # value: "1" - - - name: DISABLE_TELEMETRY - value: "1" - - - name: APP_SECRET - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-secrets" - key: encryptionkey - - - name: DATABASE_URL - valueFrom: - secretKeyRef: - name: "{{ .Release.Name }}-pg-connection" - key: url +{{ include "common.deployment" . }} diff --git a/apps/charts/umami/templates/secret-external-secrets.yaml b/apps/charts/umami/templates/secret-external-secrets.yaml new file mode 100644 index 0000000..de340c4 --- /dev/null +++ b/apps/charts/umami/templates/secret-external-secrets.yaml @@ -0,0 +1 @@ +{{ include "common.externalSecrets.externalSecrets" . }} diff --git a/apps/charts/umami/templates/secret-password-generators.yaml b/apps/charts/umami/templates/secret-password-generators.yaml new file mode 100644 index 0000000..2183e0a --- /dev/null +++ b/apps/charts/umami/templates/secret-password-generators.yaml @@ -0,0 +1 @@ +{{ include "common.externalSecrets.passwordGenerators" . }} diff --git a/apps/charts/umami/templates/secret.yaml b/apps/charts/umami/templates/secret.yaml deleted file mode 100644 index d086249..0000000 --- a/apps/charts/umami/templates/secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: homelab.mortenolsen.pro/v1 -kind: GenerateSecret -metadata: - name: "{{ .Release.Name }}-secrets" -spec: - fields: - - name: encryptionkey - encoding: hex - length: 64 diff --git a/apps/charts/umami/templates/service.yaml b/apps/charts/umami/templates/service.yaml index b759568..f024c64 100644 --- a/apps/charts/umami/templates/service.yaml +++ b/apps/charts/umami/templates/service.yaml @@ -1,15 +1 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{ .Release.Name }}" - labels: - app: "{{ .Release.Name }}" -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: 3000 - protocol: TCP - name: http - selector: - app: "{{ .Release.Name }}" +{{ include "common.service" . }} diff --git a/apps/charts/umami/templates/virtual-service.yaml b/apps/charts/umami/templates/virtual-service.yaml index 36e9d43..766f6b9 100644 --- a/apps/charts/umami/templates/virtual-service.yaml +++ b/apps/charts/umami/templates/virtual-service.yaml @@ -1,39 +1 @@ -apiVersion: networking.istio.io/v1 -kind: VirtualService -metadata: - name: "{{ .Release.Name }}-public" - namespace: "{{ .Release.Namespace }}" -spec: - gateways: - - "{{ .Values.globals.istio.gateways.public }}" - - mesh - hosts: - - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - mesh - http: - - route: - - destination: - host: "{{ .Release.Name }}" - port: - number: 80 - ---- -apiVersion: networking.istio.io/v1 -kind: VirtualService -metadata: - name: "{{ .Release.Name }}-private" - namespace: "{{ .Release.Namespace }}" -spec: - gateways: - - "{{ .Values.globals.istio.gateways.private }}" - - mesh - hosts: - - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" - - mesh - http: - - route: - - destination: - host: "{{ .Release.Name }}" - port: - number: 80 - +{{ include "common.virtualService" . }} diff --git a/apps/charts/umami/values.yaml b/apps/charts/umami/values.yaml index ad493bc..7bc52ac 100644 --- a/apps/charts/umami/values.yaml +++ b/apps/charts/umami/values.yaml @@ -2,4 +2,60 @@ image: repository: docker.umami.is/umami-software/umami tag: postgresql-latest@sha256:28f263fe06f79ebffa5a6a6e9bd33b7a278e9342a88e0bdac812416c9f9e4361 pullPolicy: IfNotPresent + subdomain: umami + +# Deployment configuration +deployment: + strategy: RollingUpdate + replicas: 1 + +# Container configuration +container: + port: 3000 + healthProbe: + type: tcpSocket + port: http # Use named port + +# Service configuration +service: + port: 80 + type: ClusterIP + +# VirtualService configuration +virtualService: + enabled: true + gateways: + public: true + private: true + +# Database configuration +database: + enabled: true + +# External Secrets configuration +externalSecrets: + - name: "{release}-secrets" + passwords: + - name: encryptionkey + length: 64 + allowRepeat: true + encoding: hex + secretKeys: + - encryptionkey + +# Environment variables +env: + TZ: + value: "{timezone}" + DISABLE_TELEMETRY: "1" + APP_SECRET: + valueFrom: + secretKeyRef: + name: "{release}-secrets" + key: encryptionkey + DATABASE_URL: + valueFrom: + secretKeyRef: + name: "{release}-connection" + key: url