diff --git a/applications/gotify/gotify-statefulset.yaml b/applications/gotify/gotify-statefulset.yaml deleted file mode 100644 index e7ad23b..0000000 --- a/applications/gotify/gotify-statefulset.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: gotify - namespace: gotify -spec: - replicas: 1 - selector: - matchLabels: - app: gotify - serviceName: gotify - template: - metadata: - labels: - app: gotify - spec: - restartPolicy: Always - terminationGracePeriodSeconds: 10 - containers: - - name: gotify - image: gotify/server:2.9.1 - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: 200m - memory: 256Mi - ports: - - containerPort: 80 - name: http - env: - - name: GOTIFY_DEFAULTUSER_PASS - valueFrom: - secretKeyRef: - name: gotify-secrets - key: default_user_pass - - name: GOTIFY_DATABASE_DIALECT - value: postgres - - name: DB_USER - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_user - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_password - - name: DB_NAME - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_name - - name: GOTIFY_DATABASE_CONNECTION - value: "host=gotify-postgresql port=5432 user=$(DB_USER) dbname=$(DB_NAME) password=$(DB_PASSWORD) sslmode=disable" - volumeMounts: - - name: data - mountPath: /app/data - volumes: - - name: data - persistentVolumeClaim: - claimName: gotify-data-pvc diff --git a/applications/infisical/Infisical-secrets/gotify-infisicalsecret.yaml b/applications/gotify/gotify/infisicalsecret.yaml similarity index 72% rename from applications/infisical/Infisical-secrets/gotify-infisicalsecret.yaml rename to applications/gotify/gotify/infisicalsecret.yaml index 0cf62ce..93e1526 100644 --- a/applications/infisical/Infisical-secrets/gotify-infisicalsecret.yaml +++ b/applications/gotify/gotify/infisicalsecret.yaml @@ -1,7 +1,7 @@ apiVersion: secrets.infisical.com/v1alpha1 kind: InfisicalSecret metadata: - name: gotify-secrets + name: gotify-app-secrets namespace: infisical spec: hostAPI: https://infisical.jsme.be @@ -16,9 +16,10 @@ spec: secretsScope: projectSlug: "kubernetes" envSlug: "prod" - secretsPath: "/gotify" - recursive: true + secretsPath: "/gotify/gotify" + # Non-recursive: keys are already named as the container expects. + recursive: false managedSecretReference: - secretName: gotify-secrets + secretName: gotify-app-secrets secretNamespace: gotify secretType: Opaque diff --git a/applications/gotify/gotify-persistentvolumeclaim.yaml b/applications/gotify/gotify/persistentvolumeclaim.yaml similarity index 100% rename from applications/gotify/gotify-persistentvolumeclaim.yaml rename to applications/gotify/gotify/persistentvolumeclaim.yaml diff --git a/applications/gotify/gotify-service.yaml b/applications/gotify/gotify/service.yaml similarity index 100% rename from applications/gotify/gotify-service.yaml rename to applications/gotify/gotify/service.yaml diff --git a/applications/gotify/gotify/statefulset.yaml b/applications/gotify/gotify/statefulset.yaml new file mode 100644 index 0000000..43d8fc0 --- /dev/null +++ b/applications/gotify/gotify/statefulset.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: gotify + namespace: gotify +spec: + replicas: 1 + selector: + matchLabels: + app: gotify + serviceName: gotify + template: + metadata: + labels: + app: gotify + spec: + restartPolicy: Always + terminationGracePeriodSeconds: 10 + containers: + - name: gotify + image: gotify/server:2.9.1 + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 200m + memory: 256Mi + ports: + - containerPort: 80 + name: http + envFrom: + - secretRef: + name: gotify-app-secrets + volumeMounts: + - name: data + mountPath: /app/data + volumes: + - name: data + persistentVolumeClaim: + claimName: gotify-data-pvc diff --git a/applications/gotify/postgres/gotify-postgres-statefulset.yaml b/applications/gotify/postgres/gotify-postgres-statefulset.yaml index 54fd1a0..affc657 100644 --- a/applications/gotify/postgres/gotify-postgres-statefulset.yaml +++ b/applications/gotify/postgres/gotify-postgres-statefulset.yaml @@ -31,24 +31,9 @@ spec: volumeMounts: - name: gotify-postgresql-database mountPath: /var/lib/postgresql/pgdata - env: - - name: PGDATA - value: /var/lib/postgresql/pgdata/data - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_password - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_user - - name: POSTGRES_DB - valueFrom: - secretKeyRef: - name: gotify-secrets - key: db_name + envFrom: + - secretRef: + name: gotify-postgres-secrets volumes: - name: gotify-postgresql-database persistentVolumeClaim: diff --git a/applications/gotify/postgres/infisicalsecret.yaml b/applications/gotify/postgres/infisicalsecret.yaml new file mode 100644 index 0000000..2d50be9 --- /dev/null +++ b/applications/gotify/postgres/infisicalsecret.yaml @@ -0,0 +1,25 @@ +apiVersion: secrets.infisical.com/v1alpha1 +kind: InfisicalSecret +metadata: + name: gotify-postgres-secrets + namespace: infisical +spec: + hostAPI: https://infisical.jsme.be + resyncInterval: 30 + authentication: + kubernetesAuth: + identityId: "5458def7-7c63-40d2-95da-41c614d0933a" + serviceAccountRef: + name: infisical-auth + namespace: infisical + autoCreateServiceAccountToken: true + secretsScope: + projectSlug: "kubernetes" + envSlug: "prod" + secretsPath: "/gotify/postgres" + # Non-recursive: keys are already named as the container expects. + recursive: false + managedSecretReference: + secretName: gotify-postgres-secrets + secretNamespace: gotify + secretType: Opaque