From a8e86c3e745b81f2deaee73ed80b2c86c106dacd Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Wed, 3 Dec 2025 22:04:47 +0100 Subject: [PATCH] feat: add vikunja --- .../charts/vikunja}/Chart.yaml | 2 +- apps/charts/vikunja/templates/client.yaml | 10 ++ apps/charts/vikunja/templates/database.yaml | 6 + apps/charts/vikunja/templates/deployment.yaml | 110 ++++++++++++++++++ .../templates/external-http-service.yaml | 11 ++ .../vikunja/templates/http-service.yaml | 11 ++ apps/charts/vikunja/templates/pvc.yaml | 11 ++ apps/charts/vikunja/templates/secret.yaml | 9 ++ apps/charts/vikunja/templates/service.yaml | 15 +++ apps/charts/vikunja/values.yaml | 5 + .../charts/cloudnative-pg/templates/app.yaml | 29 ----- .../root/charts/{redis => data}/Chart.yaml | 0 .../templates/redis-operator.yaml | 0 shared/charts/postgres-cluster/Chart.yaml | 3 - .../postgres-cluster/templates/cluster.yaml | 10 -- shared/charts/postgres-cluster/values.yaml | 1 - 16 files changed, 189 insertions(+), 44 deletions(-) rename {foundation/root/charts/cloudnative-pg => apps/charts/vikunja}/Chart.yaml (58%) create mode 100644 apps/charts/vikunja/templates/client.yaml create mode 100644 apps/charts/vikunja/templates/database.yaml create mode 100644 apps/charts/vikunja/templates/deployment.yaml create mode 100644 apps/charts/vikunja/templates/external-http-service.yaml create mode 100644 apps/charts/vikunja/templates/http-service.yaml create mode 100644 apps/charts/vikunja/templates/pvc.yaml create mode 100644 apps/charts/vikunja/templates/secret.yaml create mode 100644 apps/charts/vikunja/templates/service.yaml create mode 100644 apps/charts/vikunja/values.yaml delete mode 100644 foundation/root/charts/cloudnative-pg/templates/app.yaml rename foundation/root/charts/{redis => data}/Chart.yaml (100%) rename foundation/root/charts/{redis => data}/templates/redis-operator.yaml (100%) delete mode 100644 shared/charts/postgres-cluster/Chart.yaml delete mode 100644 shared/charts/postgres-cluster/templates/cluster.yaml delete mode 100644 shared/charts/postgres-cluster/values.yaml diff --git a/foundation/root/charts/cloudnative-pg/Chart.yaml b/apps/charts/vikunja/Chart.yaml similarity index 58% rename from foundation/root/charts/cloudnative-pg/Chart.yaml rename to apps/charts/vikunja/Chart.yaml index b2b2921..8c0e9b9 100644 --- a/foundation/root/charts/cloudnative-pg/Chart.yaml +++ b/apps/charts/vikunja/Chart.yaml @@ -1,3 +1,3 @@ apiVersion: v2 version: 1.0.0 -name: cloudnative-pg +name: vikunja diff --git a/apps/charts/vikunja/templates/client.yaml b/apps/charts/vikunja/templates/client.yaml new file mode 100644 index 0000000..63a317d --- /dev/null +++ b/apps/charts/vikunja/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: /auth/openid/oidc + subdomain: "{{ .Values.subdomain }}" + matchingMode: strict diff --git a/apps/charts/vikunja/templates/database.yaml b/apps/charts/vikunja/templates/database.yaml new file mode 100644 index 0000000..6a30b53 --- /dev/null +++ b/apps/charts/vikunja/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/vikunja/templates/deployment.yaml b/apps/charts/vikunja/templates/deployment.yaml new file mode 100644 index 0000000..59120d8 --- /dev/null +++ b/apps/charts/vikunja/templates/deployment.yaml @@ -0,0 +1,110 @@ +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: 3456 + protocol: TCP + livenessProbe: + tcpSocket: + port: http + readinessProbe: + tcpSocket: + port: http + volumeMounts: + - mountPath: /app/vikunja/files + name: data + env: + - name: VIKUNJA_SERVICE_TIMEZONE + value: "{{ .Values.globals.timezone }}" + + - name: VIKUNJA_SERVICE_ENABLEREGISTRATION + value: "false" + + - name: VIKUNJA_AUTH_OPENID_ENABLED + value: "true" + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_NAME + value: Authentik + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_AUTHURL + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-client" + key: configurationIssuer + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_USERNAMEFALLBACK + value: "true" + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_EMAILFALLBACK + value: "true" + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_CLIENTID + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-client" + key: clientId + + - name: VIKUNJA_AUTH_OPENID_PROVIDERS_OIDC_CLIENTSECRET + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-client" + key: clientSecret + + - name: VIKUNJA_SERVICE_PUBLICURL + value: https://{{ .Values.subdomain }}.{{ .Values.globals.domain }} + + - name: VIKUNJA_SERVICE_JWTSECRET + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-secrets" + key: encryptionkey + + - name: VIKUNJA_DATABASE_TYPE + value: postgres + + - name: VIKUNJA_DATABASE_DATABASE + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: database + + - name: VIKUNJA_DATABASE_HOST + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: host + + - name: VIKUNJA_DATABASE_USER + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: user + - name: VIKUNJA_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: password + + volumes: + - name: data + persistentVolumeClaim: + claimName: "{{ .Release.Name }}-data" diff --git a/apps/charts/vikunja/templates/external-http-service.yaml b/apps/charts/vikunja/templates/external-http-service.yaml new file mode 100644 index 0000000..e28916d --- /dev/null +++ b/apps/charts/vikunja/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/vikunja/templates/http-service.yaml b/apps/charts/vikunja/templates/http-service.yaml new file mode 100644 index 0000000..89df8bf --- /dev/null +++ b/apps/charts/vikunja/templates/http-service.yaml @@ -0,0 +1,11 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: HttpService +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/vikunja/templates/pvc.yaml b/apps/charts/vikunja/templates/pvc.yaml new file mode 100644 index 0000000..bc1d0a6 --- /dev/null +++ b/apps/charts/vikunja/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/vikunja/templates/secret.yaml b/apps/charts/vikunja/templates/secret.yaml new file mode 100644 index 0000000..d086249 --- /dev/null +++ b/apps/charts/vikunja/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/vikunja/templates/service.yaml b/apps/charts/vikunja/templates/service.yaml new file mode 100644 index 0000000..6434fb7 --- /dev/null +++ b/apps/charts/vikunja/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: 3456 + protocol: TCP + name: http + selector: + app: "{{ .Release.Name }}" diff --git a/apps/charts/vikunja/values.yaml b/apps/charts/vikunja/values.yaml new file mode 100644 index 0000000..f393240 --- /dev/null +++ b/apps/charts/vikunja/values.yaml @@ -0,0 +1,5 @@ +image: + repository: vikunja/vikunja + tag: latest + pullPolicy: IfNotPresent +subdomain: vikunja diff --git a/foundation/root/charts/cloudnative-pg/templates/app.yaml b/foundation/root/charts/cloudnative-pg/templates/app.yaml deleted file mode 100644 index 284e549..0000000 --- a/foundation/root/charts/cloudnative-pg/templates/app.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cloudnative-pg-operator - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: foundation - server: https://kubernetes.default.svc - project: foundation - source: - repoURL: https://cloudnative-pg.github.io/charts - targetRevision: 0.26.1 - chart: cloudnative-pg - helm: {} - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - ServerSideApply=true - - ApplyOutOfSyncOnly=true - - CreateNamespace=true - info: - - name: "Documentation: " - value: "https://cloudnative-pg.io/documentation/current/" diff --git a/foundation/root/charts/redis/Chart.yaml b/foundation/root/charts/data/Chart.yaml similarity index 100% rename from foundation/root/charts/redis/Chart.yaml rename to foundation/root/charts/data/Chart.yaml diff --git a/foundation/root/charts/redis/templates/redis-operator.yaml b/foundation/root/charts/data/templates/redis-operator.yaml similarity index 100% rename from foundation/root/charts/redis/templates/redis-operator.yaml rename to foundation/root/charts/data/templates/redis-operator.yaml diff --git a/shared/charts/postgres-cluster/Chart.yaml b/shared/charts/postgres-cluster/Chart.yaml deleted file mode 100644 index 019aae1..0000000 --- a/shared/charts/postgres-cluster/Chart.yaml +++ /dev/null @@ -1,3 +0,0 @@ -apiVersion: v2 -version: 1.0.0 -name: postgres-cluster diff --git a/shared/charts/postgres-cluster/templates/cluster.yaml b/shared/charts/postgres-cluster/templates/cluster.yaml deleted file mode 100644 index 6f8e4d1..0000000 --- a/shared/charts/postgres-cluster/templates/cluster.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: postgresql.cnpg.io/v1 -kind: Cluster -metadata: - name: "{{ .Release.Name }}" - namespace: "{{ .Release.Namespace }}" -spec: - instances: 1 - storage: - storageClass: "{{ .Values.globals.storageClass }}" - size: 2Gi diff --git a/shared/charts/postgres-cluster/values.yaml b/shared/charts/postgres-cluster/values.yaml deleted file mode 100644 index 9e26dfe..0000000 --- a/shared/charts/postgres-cluster/values.yaml +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file