diff --git a/applications/uptime-kuma/mariadb/infisicalsecret.yaml b/applications/uptime-kuma/mariadb/infisicalsecret.yaml new file mode 100644 index 0000000..770648a --- /dev/null +++ b/applications/uptime-kuma/mariadb/infisicalsecret.yaml @@ -0,0 +1,25 @@ +apiVersion: secrets.infisical.com/v1alpha1 +kind: InfisicalSecret +metadata: + name: uptime-kuma-mariadb-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: "/uptime-kuma/mariadb" + # Non-recursive: keys are already named as the container expects. + recursive: false + managedSecretReference: + secretName: uptime-kuma-mariadb-secrets + secretNamespace: uptime-kuma + secretType: Opaque diff --git a/applications/uptime-kuma/mariadb/uptime-kuma-mariadb-persistentvolumeclaim.yaml b/applications/uptime-kuma/mariadb/persistentvolumeclaim.yaml similarity index 100% rename from applications/uptime-kuma/mariadb/uptime-kuma-mariadb-persistentvolumeclaim.yaml rename to applications/uptime-kuma/mariadb/persistentvolumeclaim.yaml diff --git a/applications/uptime-kuma/mariadb/uptime-kuma-mariadb-service.yaml b/applications/uptime-kuma/mariadb/service.yaml similarity index 100% rename from applications/uptime-kuma/mariadb/uptime-kuma-mariadb-service.yaml rename to applications/uptime-kuma/mariadb/service.yaml diff --git a/applications/uptime-kuma/mariadb/uptime-kuma-mariadb-statefulset.yaml b/applications/uptime-kuma/mariadb/statefulset.yaml similarity index 66% rename from applications/uptime-kuma/mariadb/uptime-kuma-mariadb-statefulset.yaml rename to applications/uptime-kuma/mariadb/statefulset.yaml index 6a507b1..33b2a1a 100644 --- a/applications/uptime-kuma/mariadb/uptime-kuma-mariadb-statefulset.yaml +++ b/applications/uptime-kuma/mariadb/statefulset.yaml @@ -31,24 +31,13 @@ spec: volumeMounts: - name: uptime-kuma-mariadb-database mountPath: /var/lib/mysql + # MARIADB_USER/PASSWORD/DATABASE come from the Secret. + envFrom: + - secretRef: + name: uptime-kuma-mariadb-secrets env: - name: MARIADB_RANDOM_ROOT_PASSWORD value: "true" - - name: MARIADB_USER - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_user - - name: MARIADB_PASSWORD - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_password - - name: MARIADB_DATABASE - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_name volumes: - name: uptime-kuma-mariadb-database persistentVolumeClaim: diff --git a/applications/infisical/Infisical-secrets/uptime-kuma-infisicalsecret.yaml b/applications/uptime-kuma/uptime-kuma/infisicalsecret.yaml similarity index 63% rename from applications/infisical/Infisical-secrets/uptime-kuma-infisicalsecret.yaml rename to applications/uptime-kuma/uptime-kuma/infisicalsecret.yaml index a613949..2838be4 100644 --- a/applications/infisical/Infisical-secrets/uptime-kuma-infisicalsecret.yaml +++ b/applications/uptime-kuma/uptime-kuma/infisicalsecret.yaml @@ -1,14 +1,14 @@ apiVersion: secrets.infisical.com/v1alpha1 kind: InfisicalSecret metadata: - name: uptime-kuma-secrets + name: uptime-kuma-app-secrets namespace: infisical spec: hostAPI: https://infisical.jsme.be resyncInterval: 30 authentication: kubernetesAuth: - identityId: "9f65814e-bf4c-42fc-b382-26be15b11416" + identityId: "5458def7-7c63-40d2-95da-41c614d0933a" serviceAccountRef: name: infisical-auth namespace: infisical @@ -16,9 +16,10 @@ spec: secretsScope: projectSlug: "kubernetes" envSlug: "prod" - secretsPath: "/uptime-kuma" - recursive: true + secretsPath: "/uptime-kuma/uptime-kuma" + # Non-recursive: keys are already named as the container expects. + recursive: false managedSecretReference: - secretName: uptime-kuma-secrets + secretName: uptime-kuma-app-secrets secretNamespace: uptime-kuma secretType: Opaque diff --git a/applications/uptime-kuma/uptime-kuma-persistentvolumeclaim.yaml b/applications/uptime-kuma/uptime-kuma/persistentvolumeclaim.yaml similarity index 100% rename from applications/uptime-kuma/uptime-kuma-persistentvolumeclaim.yaml rename to applications/uptime-kuma/uptime-kuma/persistentvolumeclaim.yaml diff --git a/applications/uptime-kuma/uptime-kuma-service.yaml b/applications/uptime-kuma/uptime-kuma/service.yaml similarity index 100% rename from applications/uptime-kuma/uptime-kuma-service.yaml rename to applications/uptime-kuma/uptime-kuma/service.yaml diff --git a/applications/uptime-kuma/uptime-kuma-statefulset.yaml b/applications/uptime-kuma/uptime-kuma/statefulset.yaml similarity index 52% rename from applications/uptime-kuma/uptime-kuma-statefulset.yaml rename to applications/uptime-kuma/uptime-kuma/statefulset.yaml index 503bc23..5d3f4f2 100644 --- a/applications/uptime-kuma/uptime-kuma-statefulset.yaml +++ b/applications/uptime-kuma/uptime-kuma/statefulset.yaml @@ -29,34 +29,13 @@ spec: ports: - containerPort: 3001 name: http + # DATABASE_HOST/PORT/NAME/USERNAME/PASSWORD come from the Secret. + envFrom: + - secretRef: + name: uptime-kuma-app-secrets env: - name: DATABASE_TYPE value: mariadb - - name: DATABASE_HOST - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_host - - name: DATABASE_PORT - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_port - - name: DATABASE_NAME - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_name - - name: DATABASE_USERNAME - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_user - - name: DATABASE_PASSWORD - valueFrom: - secretKeyRef: - name: uptime-kuma-secrets - key: db_password volumeMounts: - name: data mountPath: /app/data diff --git a/applications/uptime-kuma/uptime-kuma-httproute.yaml b/applications/uptime-kuma/uptime-kuma/uptime-kuma-httproute.yaml similarity index 100% rename from applications/uptime-kuma/uptime-kuma-httproute.yaml rename to applications/uptime-kuma/uptime-kuma/uptime-kuma-httproute.yaml