Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions apps/infra/src/k8s/serviceDefinitions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { jsonStringify } from '@pulumi/pulumi';
import { type core } from '@pulumi/kubernetes/types/input';
import { envVarSources } from './secrets';
import { getConnectionDetails, keycloakPg, airtableSyncPg } from './postgres';
import {
getConnectionDetails, keycloakPg, airtableSyncPg, appPgConnectionDetails,
} from './postgres';
import {
minioPvc, mcpAggregatorDataPvc, mcpAshbyDataPvc, mcpGoogleDataPvc,
} from './pvc';
Expand Down Expand Up @@ -292,20 +294,6 @@ export const services: ServiceDefinition[] = [
},
hosts: ['speed-review.k8s.bluedot.org'],
},
// {
// name: 'bluedot-backend',
// spec: {
// containers: [{
// name: 'bluedot-backend',
// image: 'ghcr.io/bluedotimpact/bluedot-backend:latest',
// env: [{
// name: 'DATABASE_CONNECTION_STRING',
// value: pulumi.all([databaseInstance.publicIpAddress, cloudSqlPassword]).apply(([ip, password]) => `postgresql://postgres:${password}@${ip}:5432/postgres?sslmode=no-verify`),
// }],
// }],
// },
// hosts: ['backend.bluedot.org'],
// },
{
name: 'bluedot-login',
spec: {
Expand Down Expand Up @@ -351,6 +339,36 @@ export const services: ServiceDefinition[] = [
}],
},
},
// Shadow instance: populates the new managed Postgres (appPg) so we can cut over
// the website from the in-cluster `airtableSyncPg` to the managed DB without a
// sync gap. Shares Airtable webhooks with the primary pg-sync-service — each
// instance keeps its own in-memory cursor.
//
// Differences from the primary above:
// - APP_NAME override
// - PG_URL points at the managed DB secret
// - PROD_ONLY_WEBHOOK_DELETION omitted for safety. Unclear if it could cause issues but one
// could imagine the two instances fighting each other over webhook deletion
//
// Delete once the website has been cut over to the managed DB and the primary
// `bluedot-pg-sync-service` is pointed at the managed DB.
{
name: 'bluedot-pg-sync-shadow',
spec: {
containers: [{
name: 'bluedot-pg-sync-shadow',
image: 'ghcr.io/bluedotimpact/bluedot-pg-sync-service:latest',
env: [
{ name: 'APP_NAME', value: 'pg-sync-service-shadow' },
Comment thread
Will-Howard marked this conversation as resolved.
{ name: 'AIRTABLE_PERSONAL_ACCESS_TOKEN', valueFrom: envVarSources.airtablePat },
{ name: 'PG_URL', valueFrom: appPgConnectionDetails.uri },
{ name: 'ALERTS_SLACK_CHANNEL_ID', value: ALERTS_SLACK_CHANNEL_ID },
{ name: 'INFO_SLACK_CHANNEL_ID', value: INFO_SLACK_CHANNEL_ID },
{ name: 'ALERTS_SLACK_BOT_TOKEN', valueFrom: envVarSources.alertsSlackBotToken },
],
}],
},
},
{
name: 'minio',
spec: {
Expand Down