diff --git a/deploy/deploy.schema.json b/deploy/deploy.schema.json index 541305bd..3000128a 100644 --- a/deploy/deploy.schema.json +++ b/deploy/deploy.schema.json @@ -384,6 +384,7 @@ "postgresRuntimeStore": { "type": "object", "properties": { + "image": { "type": "string", "minLength": 1 }, "poolMax": { "type": "integer", "minimum": 1 } }, "additionalProperties": false diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index c3f47832..a3d7d089 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -301,6 +301,7 @@ lanes: port: 5432 runtimeStore: postgres: + image: postgres:16-alpine poolMax: 4 connectionTimeoutMs: 5000 queryRetryMaxAttempts: 5 diff --git a/scripts/gitops-render.mjs b/scripts/gitops-render.mjs index fae9e9b3..8e92e66d 100644 --- a/scripts/gitops-render.mjs +++ b/scripts/gitops-render.mjs @@ -5006,7 +5006,13 @@ function deviceAgent71FreqManifest({ profile = "dev", source, registryPrefix, ca }; } -function v02PostgresManifest({ profile = "v02", migrationSql, source }) { +function runtimePostgresImageForProfile(deploy, profile) { + const postgres = runtimeLaneConfig(deploy, profile)?.runtimeStore?.postgres; + const image = postgres && typeof postgres === "object" && !Array.isArray(postgres) ? postgres.image : null; + return typeof image === "string" && image.trim().length > 0 ? image.trim() : "postgres:16-alpine"; +} + +function v02PostgresManifest({ profile = "v02", migrationSql, source, image = "postgres:16-alpine" }) { const namespace = namespaceNameForProfile(profile); const name = `${namespace}-postgres`; const dbName = `hwlab_${profile}`; @@ -5057,7 +5063,7 @@ function v02PostgresManifest({ profile = "v02", migrationSql, source }) { spec: { containers: [{ name: "postgres", - image: "127.0.0.1:5000/hwlab/postgres:16-alpine", + image, imagePullPolicy: "IfNotPresent", env: [ { name: "POSTGRES_DB", value: dbName }, @@ -5466,7 +5472,7 @@ async function plannedFiles(args) { putJson(`${runtimePath}/workloads.yaml`, transformWorkloads({ workloads, deploy, catalog: artifactCatalog, source, sourceBranch: args.sourceBranch, gitReadUrl: args.gitReadUrl, registryPrefix: args.registryPrefix, runtimeEndpoint: endpoints.runtimeEndpoint, webEndpoint: endpoints.webEndpoint, profile, useDeployImages: args.useDeployImages, metricsSidecarSha256 })); putJson(`${runtimePath}/deepseek-proxy.yaml`, deepSeekProxyManifest({ profile, source, sourceBranch: args.sourceBranch, sourceRepo: args.sourceRepo, gitReadUrl: args.gitReadUrl, deploy, registryPrefix: args.registryPrefix, catalog: artifactCatalog, useDeployImages: args.useDeployImages, metricsSidecarSha256 })); if (isRuntimeLane(profile) && externalPostgres) putJson(`${runtimePath}/external-postgres.yaml`, externalPostgresManifest({ profile, config: externalPostgres, source })); - if (isRuntimeLane(profile) && !externalPostgres) putJson(`${runtimePath}/postgres.yaml`, v02PostgresManifest({ profile, migrationSql, source })); + if (isRuntimeLane(profile) && !externalPostgres) putJson(`${runtimePath}/postgres.yaml`, v02PostgresManifest({ profile, migrationSql, source, image: runtimePostgresImageForProfile(deploy, profile) })); if (workbenchRedis) putJson(`${runtimePath}/workbench-redis.yaml`, workbenchRuntimeRedisManifest({ profile, config: workbenchRedis, source })); if (isRuntimeLane(profile)) putJson(`${runtimePath}/openfga.yaml`, v02OpenFgaManifest({ profile, source })); if (isRuntimeLane(profile)) putJson(`${runtimePath}/observability.yaml`, observabilityManifest({ deploy, profile, namespace, labels: profileLabels, annotations, metricsSidecarScript }));