From 5773f147b1e2d39f1ea057f6d925914e187f2d5a Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Mon, 8 Dec 2025 22:10:01 +0100 Subject: [PATCH] add blinko --- apps.yaml | 2 +- apps/charts/blinko/Chart.yaml | 3 + apps/charts/blinko/templates/client.yaml | 10 ++++ apps/charts/blinko/templates/database.yaml | 6 ++ apps/charts/blinko/templates/deployment.yaml | 57 +++++++++++++++++++ .../templates/external-http-service.yaml | 11 ++++ apps/charts/blinko/templates/pvc.yaml | 11 ++++ apps/charts/blinko/templates/secret.yaml | 9 +++ apps/charts/blinko/templates/service.yaml | 15 +++++ .../blinko/templates/virtual-service.yaml | 18 ++++++ apps/charts/blinko/values.yaml | 5 ++ 11 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 apps/charts/blinko/Chart.yaml create mode 100644 apps/charts/blinko/templates/client.yaml create mode 100644 apps/charts/blinko/templates/database.yaml create mode 100644 apps/charts/blinko/templates/deployment.yaml create mode 100644 apps/charts/blinko/templates/external-http-service.yaml create mode 100644 apps/charts/blinko/templates/pvc.yaml create mode 100644 apps/charts/blinko/templates/secret.yaml create mode 100644 apps/charts/blinko/templates/service.yaml create mode 100644 apps/charts/blinko/templates/virtual-service.yaml create mode 100644 apps/charts/blinko/values.yaml diff --git a/apps.yaml b/apps.yaml index 65d1853..9233fc2 100644 --- a/apps.yaml +++ b/apps.yaml @@ -12,7 +12,7 @@ spec: persistentVolumeReclaimPolicy: Retain # Retain the data even if the PV is deleted storageClassName: "manual-app-data" hostPath: - path: "/data/volumes/apps" # The specific host path for your 'apps' volume + path: "/data/volumes" # The specific host path for your 'apps' volume type: DirectoryOrCreate # Ensures the directory exists on the host --- diff --git a/apps/charts/blinko/Chart.yaml b/apps/charts/blinko/Chart.yaml new file mode 100644 index 0000000..ec3c4b3 --- /dev/null +++ b/apps/charts/blinko/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +version: 1.0.0 +name: blinko diff --git a/apps/charts/blinko/templates/client.yaml b/apps/charts/blinko/templates/client.yaml new file mode 100644 index 0000000..30a99b3 --- /dev/null +++ b/apps/charts/blinko/templates/client.yaml @@ -0,0 +1,10 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: OidcClient +metadata: + name: "{{ .Release.Name }}" +spec: + environment: "{{ .Values.globals.environment }}" + redirectUris: + - path: api/auth/callback/authentik + subdomain: "{{ .Values.subdomain }}" + matchingMode: strict diff --git a/apps/charts/blinko/templates/database.yaml b/apps/charts/blinko/templates/database.yaml new file mode 100644 index 0000000..6a30b53 --- /dev/null +++ b/apps/charts/blinko/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/blinko/templates/deployment.yaml b/apps/charts/blinko/templates/deployment.yaml new file mode 100644 index 0000000..324efbb --- /dev/null +++ b/apps/charts/blinko/templates/deployment.yaml @@ -0,0 +1,57 @@ +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: 1111 + protocol: TCP + livenessProbe: + tcpSocket: + port: http + readinessProbe: + tcpSocket: + port: http + volumeMounts: + - mountPath: /data + name: data + env: + - name: TZ + value: "{{ .Values.globals.timezone }}" + - name: NODE_ENV + value: "production" + - name: NEXTAUTH_URL + value: "https://{{ .Values.subdomain }}.{{ .Values.globals.domain }}" + - name: NEXT_PUBLIC_BASE_URL + value: "https://{{ .Values.subdomain }}.{{ .Values.globals.domain }}" + - name: NEXTAUTH_SECRET + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-secrets" + key: betterauth + - name: DATABASE_URL + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: url + volumes: + - name: data + persistentVolumeClaim: + claimName: "{{ .Release.Name }}-data" diff --git a/apps/charts/blinko/templates/external-http-service.yaml b/apps/charts/blinko/templates/external-http-service.yaml new file mode 100644 index 0000000..e28916d --- /dev/null +++ b/apps/charts/blinko/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/blinko/templates/pvc.yaml b/apps/charts/blinko/templates/pvc.yaml new file mode 100644 index 0000000..bc1d0a6 --- /dev/null +++ b/apps/charts/blinko/templates/pvc.yaml @@ -0,0 +1,11 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: '{{ .Release.Name }}-data' +spec: + accessModes: + - 'ReadWriteOnce' + resources: + requests: + storage: '1Gi' + storageClassName: '{{ .Values.globals.environment }}' diff --git a/apps/charts/blinko/templates/secret.yaml b/apps/charts/blinko/templates/secret.yaml new file mode 100644 index 0000000..9157356 --- /dev/null +++ b/apps/charts/blinko/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: GenerateSecret +metadata: + name: '{{ .Release.Name }}-secrets' +spec: + fields: + - name: betterauth + encoding: base64 + length: 64 diff --git a/apps/charts/blinko/templates/service.yaml b/apps/charts/blinko/templates/service.yaml new file mode 100644 index 0000000..a76f45e --- /dev/null +++ b/apps/charts/blinko/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: 1111 + protocol: TCP + name: http + selector: + app: '{{ .Release.Name }}' diff --git a/apps/charts/blinko/templates/virtual-service.yaml b/apps/charts/blinko/templates/virtual-service.yaml new file mode 100644 index 0000000..0af9b24 --- /dev/null +++ b/apps/charts/blinko/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/blinko/values.yaml b/apps/charts/blinko/values.yaml new file mode 100644 index 0000000..b2035c5 --- /dev/null +++ b/apps/charts/blinko/values.yaml @@ -0,0 +1,5 @@ +image: + repository: blinkospace/blinko + tag: latest + pullPolicy: IfNotPresent +subdomain: blinko