From f6a4beb2638985d6479e0c671e8bb275c63229a7 Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Tue, 18 Feb 2025 16:27:23 -0500 Subject: [PATCH] Add analytics --- .../monitoring/umami/kustomization.yaml | 97 +++++++++++++++++++ .../monitoring/umami/patches/delete-pvc.yaml | 5 + .../monitoring/umami/patches/deployment.yaml | 42 ++++++++ 3 files changed, 144 insertions(+) create mode 100644 namespaces/monitoring/umami/kustomization.yaml create mode 100644 namespaces/monitoring/umami/patches/delete-pvc.yaml create mode 100644 namespaces/monitoring/umami/patches/deployment.yaml diff --git a/namespaces/monitoring/umami/kustomization.yaml b/namespaces/monitoring/umami/kustomization.yaml new file mode 100644 index 0000000..d1588f8 --- /dev/null +++ b/namespaces/monitoring/umami/kustomization.yaml @@ -0,0 +1,97 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +transformers: + - |- + apiVersion: builtin + kind: NamespaceTransformer + metadata: + name: notImportantHere + namespace: monitoring + unsetOnly: true + +namePrefix: umami- +resources: + - ../../../kustomize/public-oidc/ + +replacements: + - source: + kind: Service + name: svc + targets: + - select: + kind: HTTPRoute + options: + create: true + fieldPaths: + - spec.rules.0.backendRefs.0.name + - source: + kind: Deployment + name: app + fieldPath: metadata.labels.[app.kubernetes.io/appName] + targets: + - select: + kind: HTTPRoute + options: + create: true + delimiter: "." + index: 0 + fieldPaths: + - spec.hostnames.0 + - select: + kind: InfisicalSecret + options: + delimiter: "-" + index: 0 + fieldPaths: + - spec.managedSecretReference.secretName + - select: + kind: InfisicalSecret + options: + delimiter: "/" + index: 2 + fieldPaths: + - spec.authentication.universalAuth.secretsScope.secretsPath + - select: + kind: Service + fieldPaths: + - spec.ports.0.name + - spec.ports.0.targetPort + - source: + kind: Deployment + name: app + fieldPath: metadata.labels.[app.kubernetes.io/appNamespace] + targets: + - select: + kind: InfisicalSecret + fieldPaths: + - spec.managedSecretReference.secretNamespace + - select: + kind: InfisicalSecret + options: + delimiter: "/" + index: 1 + fieldPaths: + - spec.authentication.universalAuth.secretsScope.secretsPath + +patches: + - path: patches/deployment.yaml + target: + kind: Deployment + name: app + - path: patches/delete-pvc.yaml + target: + kind: PersistentVolumeClaim + name: pvc + +labels: + - includeSelectors: true + pairs: + app.kubernetes.io/appName: umami + - pairs: + app.kubernetes.io/appNamespace: monitoring + +configMapGenerator: + - name: config + literals: + - DATABASE_TYPE=postgresql diff --git a/namespaces/monitoring/umami/patches/delete-pvc.yaml b/namespaces/monitoring/umami/patches/delete-pvc.yaml new file mode 100644 index 0000000..54ecf59 --- /dev/null +++ b/namespaces/monitoring/umami/patches/delete-pvc.yaml @@ -0,0 +1,5 @@ +$patch: delete +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc diff --git a/namespaces/monitoring/umami/patches/deployment.yaml b/namespaces/monitoring/umami/patches/deployment.yaml new file mode 100644 index 0000000..a916bd1 --- /dev/null +++ b/namespaces/monitoring/umami/patches/deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: app +spec: + template: + spec: + tolerations: + - key: "public" + operator: "Equal" + value: "true" + effect: "NoSchedule" + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + preference: + matchExpressions: + - key: public + operator: In + values: + - "true" + containers: + - name: umami + image: ghcr.io/umami-software/umami:postgresql-latest + envFrom: + - configMapRef: + name: umami-config + env: + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: umami-secrets + key: UMAMI_APP_SECRET + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: umami-secrets + key: UMAMI_POSTGRESQL_CONNECTION + ports: + - containerPort: 3000 + name: umami