diff --git a/apps/charts/umami/Chart.yaml b/apps/charts/umami/Chart.yaml new file mode 100644 index 0000000..99ec772 --- /dev/null +++ b/apps/charts/umami/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +version: 1.0.0 +name: umami diff --git a/apps/charts/umami/templates/database.yaml b/apps/charts/umami/templates/database.yaml new file mode 100644 index 0000000..6a30b53 --- /dev/null +++ b/apps/charts/umami/templates/database.yaml @@ -0,0 +1,6 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: PostgresDatabase +metadata: + name: '{{ .Release.Name }}' +spec: + environment: '{{ .Values.globals.environment }}' diff --git a/apps/charts/umami/templates/deployment.yaml b/apps/charts/umami/templates/deployment.yaml new file mode 100644 index 0000000..ca43fb6 --- /dev/null +++ b/apps/charts/umami/templates/deployment.yaml @@ -0,0 +1,52 @@ +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 diff --git a/apps/charts/umami/templates/external-http-service.yaml b/apps/charts/umami/templates/external-http-service.yaml new file mode 100644 index 0000000..e28916d --- /dev/null +++ b/apps/charts/umami/templates/external-http-service.yaml @@ -0,0 +1,11 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: ExternalHttpService +metadata: + name: '{{ .Release.Name }}' +spec: + environment: '{{ .Values.globals.environment }}' + subdomain: '{{ .Values.subdomain }}' + destination: + host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local' + port: + number: 80 diff --git a/apps/charts/umami/templates/secret.yaml b/apps/charts/umami/templates/secret.yaml new file mode 100644 index 0000000..d086249 --- /dev/null +++ b/apps/charts/umami/templates/secret.yaml @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..b759568 --- /dev/null +++ b/apps/charts/umami/templates/service.yaml @@ -0,0 +1,15 @@ +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 }}" diff --git a/apps/charts/umami/templates/virtual-service.yaml b/apps/charts/umami/templates/virtual-service.yaml new file mode 100644 index 0000000..0af9b24 --- /dev/null +++ b/apps/charts/umami/templates/virtual-service.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.istio.io/v1 +kind: VirtualService +metadata: + name: "{{ .Release.Name }}" + namespace: "{{ .Release.Namespace }}" +spec: + gateways: + - "{{ .Values.globals.istio.gateway }}" + - mesh + hosts: + - "{{ .Values.subdomain }}.{{ .Values.globals.domain }}" + - mesh + http: + - route: + - destination: + host: "{{ .Release.Name }}" + port: + number: 80 diff --git a/apps/charts/umami/values.yaml b/apps/charts/umami/values.yaml new file mode 100644 index 0000000..ef4854d --- /dev/null +++ b/apps/charts/umami/values.yaml @@ -0,0 +1,5 @@ +image: + repository: docker.umami.is/umami-software/umami + tag: postgresql-latest + pullPolicy: IfNotPresent +subdomain: umami