Skip to content

chore: sync component image versions from upstream Supabase - #17

Merged
STRRL merged 4 commits into
masterfrom
chore/sync-upstream-images
Jul 25, 2026
Merged

chore: sync component image versions from upstream Supabase#17
STRRL merged 4 commits into
masterfrom
chore/sync-upstream-images

Conversation

@STRRL

@STRRL STRRL commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Problem

Default component images were far behind the upstream Supabase compose file. The version gap includes several major upgrades (Kong 2.8 -> 3.9, Realtime v2.51 -> v2.102, storage-api v1.32 -> v1.60, PostgREST v13 -> v14) whose runtime contracts changed, so simply bumping image tags left components unable to start (Kong crashlooped on a renamed entrypoint, Realtime aborted on missing required env vars).

Solution

Sync default images from upstream and align each component builder with the corresponding upstream compose configuration, treating incompatibilities with previously persisted old images as breaking changes instead of maintaining dual compatibility.

Major Changes

  • Default images
    • Synced all component defaults to the current upstream compose file (Kong kong/kong:3.9.1, GoTrue v2.189.0, PostgREST v14.12, Realtime v2.102.3, storage-api v1.60.4, postgres-meta v0.96.6, Studio 2026.07.07).
  • Kong (2.8 -> 3.9)
    • Replaced the inline eval/echo startup command with an entrypoint script shipped in the ConfigMap, mirroring upstream kong-entrypoint.sh: awk-based env substitution and the renamed /entrypoint.sh (the old /docker-entrypoint.sh no longer exists in 3.x images and caused the crashloop).
    • Rendered config now written to /usr/local/kong/kong.yml, writable by the kong user (uid 1001).
    • Declarative config aligned with upstream kong.yml: jwks / SAML / OAuth well-known routes, admin-only OpenAPI root (expressions router), realtime REST routes with openapi/tenants blocking, /api/mcp blocker, $LUA_AUTH_EXPR Authorization injection, storage post-function empty-header cleanup.
    • Env aligned with upstream (KONG_ROUTER_FLAVOR=expressions, DNS/buffer settings, full plugin list) and added kong health readiness/liveness probes.
  • Realtime (v2.51 -> v2.102)
    • Switched JWT_SECRET to API_JWT_SECRET, added now-required METRICS_JWT_SECRET, and wired self-host tenant seeding (SEED_SELF_HOST, SELF_HOST_TENANT_NAME matching the Service name, DB_AFTER_CONNECT_QUERY, DB_ENC_KEY, ERL_AFLAGS, DNS_NODES, RUN_JANITOR). Removed the deleted SECURE_CHANNELS.
  • Other components
    • storage-api: PGRST_JWT_SECRET -> AUTH_JWT_SECRET; PostgREST: PGRST_DB_SCHEMA -> PGRST_DB_SCHEMAS; GoTrue: added GOTRUE_API_HOST, GOTRUE_JWT_ADMIN_ROLES, GOTRUE_JWT_AUD; Studio: added POSTGRES_HOST/PORT/DB and POSTGRES_USER_READ_WRITE sourced from the database secret.
  • Controller
    • Kong ConfigMap is now reconciled with create-or-update (previously only created when absent, so template changes never propagated to existing projects).
  • E2E
    • T107 waits for the Kong Deployment rollout to settle before picking a pod, avoiding a port-forward against an old-generation pod terminated by the rolling update triggered in T106.

Breaking Changes

The defaulting webhook persists image values into the spec, so SupabaseProjects created before this release keep the old defaults (kong:2.8.1, supabase/realtime:v2.51.11, supabase/storage-api:v1.32.0, ...). The component builders now target the new versions only:

  • Kong images below 3.x are no longer supported (the generated Deployment uses the 3.x entrypoint and expressions router).
  • Realtime v2.51 no longer receives JWT_SECRET; storage-api v1.32 no longer receives PGRST_JWT_SECRET.

Existing projects must update spec.<component>.image to the new defaults (or recreate the CR) after upgrading the operator.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd7dfb8550

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

DefaultKongImage = "kong/kong:3.9.1"
DefaultAuthImage = "supabase/gotrue:v2.189.0"
DefaultPostgRESTImage = "postgrest/postgrest:v14.12"
DefaultRealtimeImage = "supabase/realtime:v2.102.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add v2.102 Realtime self-host seeding before defaulting it

When users rely on the defaults, this image bump moves Realtime to the current self-hosted tenant model, but RealtimeBuilder still only sets the older env set (JWT_SECRET, SECRET_KEY_BASE, APP_NAME, PORT, RLIMIT_NOFILE, SECURE_CHANNELS) and never enables SEED_SELF_HOST or otherwise creates the default tenant. With supabase/realtime:v2.102.3, the /socket and tenant health/API paths require that tenant to exist, so a default SupabaseProject will deploy a Realtime pod that cannot serve /realtime/v1/* traffic through Kong. Please add the new self-host tenant seeding/env wiring before making this image the default, or keep the previous default until the builder is updated.

Useful? React with 👍 / 👎.

…rades

Kong 2.8 -> 3.9: the kong/kong image renamed /docker-entrypoint.sh to
/entrypoint.sh, causing the container to crashloop. Replace the inline
eval/echo command with an entrypoint script shipped in the ConfigMap that
mirrors upstream kong-entrypoint.sh (awk-based env substitution), write
the rendered config to /usr/local/kong/kong.yml (writable by the kong
user), align the declarative config and env vars with upstream kong.yml,
and add kong health probes.

Realtime v2.51 -> v2.102: JWT_SECRET is no longer read and
METRICS_JWT_SECRET is now required at boot. Switch to API_JWT_SECRET,
add METRICS_JWT_SECRET, and add self-host tenant seeding
(SEED_SELF_HOST, SELF_HOST_TENANT_NAME matching the Service name,
DB_AFTER_CONNECT_QUERY, DB_ENC_KEY, ERL_AFLAGS, DNS_NODES, RUN_JANITOR).
Drop the removed SECURE_CHANNELS.

storage-api v1.60: rename PGRST_JWT_SECRET to AUTH_JWT_SECRET.
PostgREST v14: use PGRST_DB_SCHEMAS (plural).
GoTrue v2.189: add GOTRUE_API_HOST, GOTRUE_JWT_ADMIN_ROLES,
GOTRUE_JWT_AUD.
Studio 2026.07: add POSTGRES_HOST/PORT/DB and feature toggles.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98bf09e418

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +572 to +575
Command: []string{
"/bin/sh",
"/etc/kong/kong-entrypoint.sh",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reconcile the Kong ConfigMap before requiring its script

Update existing Kong ConfigMaps before making the Deployment invoke this file. For projects created by the previous operator version, internal/controller/supabaseproject_controller.go:203-209 only fetches the existing ConfigMap and never updates its data, so it contains kong.yml but not kong-entrypoint.sh; reconciliation nevertheless rolls out this Deployment, and /bin/sh exits because /etc/kong/kong-entrypoint.sh does not exist.

Useful? React with 👍 / 👎.

Comment on lines +447 to +448
Name: "KONG_ROUTER_FLAVOR",
Value: "expressions",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve compatibility with persisted Kong 2.8 images

Gate the Kong 3.x-specific configuration on the selected image or explicitly migrate existing specs. The webhook persists its default image, so projects created before this change retain kong:2.8.1, while this builder now unconditionally supplies the expressions router and a 3.9-oriented configuration/startup path; after an operator upgrade, those existing or explicitly configured 2.8 pods cannot start with the newly generated Deployment.

Useful? React with 👍 / 👎.

Comment thread internal/component/studio.go Outdated
{Name: "NEXT_PUBLIC_ENABLE_LOGS", Value: "false"},
{Name: "NEXT_ANALYTICS_BACKEND_PROVIDER", Value: "postgres"},
{Name: "ENABLED_FEATURES_LOGS_ALL", Value: "false"},
{Name: "POSTGRES_USER_READ_WRITE", Value: "postgres"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read Studio's write user from the database secret

Use the database secret's username for this value instead of hard-coding postgres. The API explicitly supports and recommends credentials such as supabase_admin (and dev/dev-secrets.yaml uses that user), but Studio receives that user's password alongside POSTGRES_USER_READ_WRITE=postgres; when the two roles do not share a password, Studio's direct database operations authenticate with a mismatched username/password pair and fail.

Useful? React with 👍 / 👎.

Comment on lines +68 to +69
username: '$DASHBOARD_USERNAME'
password: '$DASHBOARD_PASSWORD'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape dashboard credentials before inserting them into YAML

Encode or YAML-escape the substituted credentials rather than placing arbitrary Secret values inside single quotes. A valid basic-auth password such as it's-secret renders as password: 'it's-secret', producing invalid declarative YAML and preventing Kong from starting; the webhook validates only that the Secret keys are present, so it does not exclude apostrophes or other YAML-significant content.

Useful? React with 👍 / 👎.

T106 patches the Kong image, and T107 re-applying the CR reverts it to
the default, triggering a rolling update. T107 could pick a Ready pod
from the old ReplicaSet that gets terminated mid-test, killing the
port-forward. Wait for the deployment rollout to complete first.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dd5add248

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Value: "supabaserealtime",
},
{
Name: "API_JWT_SECRET",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve JWT_SECRET for persisted Realtime images

Preserve the legacy JWT_SECRET variable when the selected image is supabase/realtime:v2.51.11, or gate the environment set by image version. The defaulting webhook persists image values, so projects created before this upgrade retain v2.51.11; reconciliation then replaces that pod's required JWT_SECRET with the newer API_JWT_SECRET, leaving the old Realtime server unable to validate client JWTs even though the user never opted into the image upgrade.

Useful? React with 👍 / 👎.

},
{
Name: "PGRST_JWT_SECRET",
Name: "AUTH_JWT_SECRET",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve PGRST_JWT_SECRET for persisted Storage images

Keep PGRST_JWT_SECRET for the previously defaulted supabase/storage-api:v1.32.0, or select the variable name according to the configured image. Since the webhook stores the old default in existing specs, an operator upgrade reconciles those deployments with v1.32.0 but supplies only the v1.60-era AUTH_JWT_SECRET; the old Storage API consequently loses its JWT verification secret and can fail startup or authentication without any user image change.

Useful? React with 👍 / 👎.

…secret

The Kong ConfigMap was only created when absent, so template changes
(including the new kong-entrypoint.sh) never propagated to existing
projects. Reconcile it with create-or-update and stop swallowing
non-NotFound Get errors.

Studio's POSTGRES_USER_READ_WRITE was hard-coded to postgres while its
password comes from the database secret; use the secret's username so
the credential pair stays consistent.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0458d5defd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +213 to +214
existingKongConfigMap.Data = kongConfigMap.Data
if err := r.Update(ctx, existingKongConfigMap); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip no-op Kong ConfigMap updates

After the ConfigMap has converged, every steady-state reconciliation still calls Update, which bumps its resource version even when Data is unchanged. Because SetupWithManager watches owned ConfigMaps, that write emits another reconciliation event and causes repeated unnecessary API-server writes; compare the existing data before updating (or patch only when it differs).

Useful? React with 👍 / 👎.

@STRRL
STRRL merged commit fe79227 into master Jul 25, 2026
5 checks passed
@STRRL
STRRL deleted the chore/sync-upstream-images branch July 25, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant