From 3c04266d589456980cae4b3b790082791661ee8a Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Tue, 16 Jul 2024 23:27:23 -0800 Subject: [PATCH] use postgres-primary url --- Tiltfile | 4 ++-- charts/fp/templates/strapi.yaml | 2 +- flux/apps/base/temporal/release.yaml | 4 ++-- scripts/k8s-secrets.sh | 4 +++- scripts/pgadmin-connection-profile.json | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tiltfile b/Tiltfile index 83ecbd0..ee57cfa 100644 --- a/Tiltfile +++ b/Tiltfile @@ -447,12 +447,12 @@ helm_remote( 'server.config.persistence.default.sql.existingSecret=postgres', 'server.config.persistence.default.sql.secretName=postgres', 'server.config.persistence.default.sql.secretKey=password', - 'server.config.persistence.default.sql.host=postgres.futureporn.svc.cluster.local', + 'server.config.persistence.default.sql.host=postgresql-primary.futureporn.svc.cluster.local', 'server.config.persistence.default.sql.port=5432', 'server.config.persistence.default.sql.user=postgres', 'server.config.persistence.visibility.driver=sql', 'server.config.persistence.visibility.sql.driver=postgres12', - 'server.config.persistence.visibility.sql.host=postgres.futureporn.svc.cluster.local', + 'server.config.persistence.visibility.sql.host=postgresql-primary.futureporn.svc.cluster.local', 'server.config.persistence.visibility.sql.port=5432', 'server.config.persistence.visibility.sql.user=postgres', 'server.config.persistence.visibility.sql.existingSecret=postgres', diff --git a/charts/fp/templates/strapi.yaml b/charts/fp/templates/strapi.yaml index 55730ec..c4538c0 100644 --- a/charts/fp/templates/strapi.yaml +++ b/charts/fp/templates/strapi.yaml @@ -61,7 +61,7 @@ spec: - name: DATABASE_CLIENT value: postgres - name: DATABASE_HOST - value: postgres.futureporn.svc.cluster.local + value: postgresql-primary.futureporn.svc.cluster.local - name: DATABASE_NAME value: futureporn-strapi - name: JWT_SECRET diff --git a/flux/apps/base/temporal/release.yaml b/flux/apps/base/temporal/release.yaml index 9664330..6a84b93 100644 --- a/flux/apps/base/temporal/release.yaml +++ b/flux/apps/base/temporal/release.yaml @@ -43,14 +43,14 @@ spec: driver: sql sql: driver: postgres12 - host: postgres.futureporn.svc.cluster.local + host: postgresql-primary.futureporn.svc.cluster.local port: 5432 user: postgres visibility: driver: sql sql: driver: postgres12 - host: postgres.futureporn.svc.cluster.local + host: postgresql-primary.futureporn.svc.cluster.local port: 5432 user: postgres valuesFrom: diff --git a/scripts/k8s-secrets.sh b/scripts/k8s-secrets.sh index c885118..414a0d6 100755 --- a/scripts/k8s-secrets.sh +++ b/scripts/k8s-secrets.sh @@ -125,6 +125,8 @@ kubectl --namespace futureporn create secret generic vultr \ kubectl --namespace futureporn delete secret postgres --ignore-not-found kubectl --namespace futureporn create secret generic postgres \ +--from-literal=replication-password=${POSTGRES_PASSWORD} \ +--from-literal=postgres-password=${POSTGRES_PASSWORD} \ --from-literal=password=${POSTGRES_PASSWORD} kubectl --namespace futureporn delete secret pgadmin --ignore-not-found @@ -137,7 +139,7 @@ kubectl --namespace futureporn create secret generic strapi \ --from-literal=adminJwtSecret=${STRAPI_ADMIN_JWT_SECRET} \ --from-literal=apiTokenSalt=${STRAPI_API_TOKEN_SALT} \ --from-literal=appKeys=${STRAPI_APP_KEYS} \ ---from-literal=databaseUrl=postgres.futureporn.svc.cluster.local://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} \ +--from-literal=databaseUrl=postgresql-primary.futureporn.svc.cluster.local://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} \ --from-literal=jwtSecret=${STRAPI_JWT_SECRET} \ --from-literal=muxPlaybackRestrictionId=${MUX_PLAYBACK_RESTRICTION_ID} \ --from-literal=muxSigningKeyPrivateKey=${MUX_SIGNING_KEY_PRIVATE_KEY} \ diff --git a/scripts/pgadmin-connection-profile.json b/scripts/pgadmin-connection-profile.json index 4bcff2b..1d84f14 100644 --- a/scripts/pgadmin-connection-profile.json +++ b/scripts/pgadmin-connection-profile.json @@ -3,7 +3,7 @@ "1": { "Name": "futureporn", "Group": "Servers", - "Host": "postgres.futureporn.svc.cluster.local", + "Host": "postgresql-primary.futureporn.svc.cluster.local", "Port": 5432, "MaintenanceDB": "postgres", "Username": "postgres",