Skip to content

feat!: run each connector with the live-sync CLI - #10

Merged
arajkumar merged 12 commits into
mainfrom
arajkumar/live-sync-entrypoint
Dec 1, 2026
Merged

arajkumar merged 12 commits into
mainfrom
arajkumar/live-sync-entrypoint

Conversation

@arajkumar

@arajkumar arajkumar commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Problem

The chart runs connector-src-postgres, the config-file gRPC service. All connectors share one pod, so a change to one connector restarts all of them. We want each connector to run the live-sync CLI, like the managed connectors. The values.yaml contract must stay the same.

Change

For each entry in config.connectors:

  • A Deployment with one pod runs live-sync run (Recreate strategy, replicas: 0 when enabled: false). A change to one connector restarts only that connector's pod. A change to target.tables restarts nothing.
  • A post-install and post-upgrade hook Job pipes target.tables to live-sync refresh-publication --table-config=-. When the refresh fails, for example for an entry that matches no published table, the release fails, and the Job pod shows the error.
  • The containers get the connection strings in LIVE_SYNC_SOURCE and LIVE_SYNC_TARGET, not in the process arguments.
  • Drops run in Jobs that call live-sync drop:
    • drop: true: after each install and upgrade.
    • An entry that you remove: after the upgrade that removes it. The chart finds it with lookup, and the Job copies the pod spec of the old Deployment.
    • helm uninstall: every connector, after Helm deletes the run pods. helm uninstall --no-hooks keeps the connectors.
  • A $VAR database_url comes from env through Kubernetes expansion. A literal database_url and an SSH private key go into a chart Secret. ssh_config becomes sshtunnel_* DSN parameters.
  • Telemetry is on by default. Set telemetry.enabled: false to send --disable-telemetry. This key is not in values.yaml.
  • Set vpa.enabled: true to create a VerticalPodAutoscaler for each connector. The default updateMode is "Off", so VPA only writes recommendations. This key is not in values.yaml.

The keys of values.yaml do not change. The default resources change from 500m CPU and 512Mi memory to 250m CPU and 750Mi memory, for each connector pod. service.grpcPort is not used any more, because live-sync has no gRPC endpoint.

Breaking changes

The subscription name is the connector id in both charts, so an upgrade keeps the slots, origins, and catalog rows. The new pods continue CDC, and no data is copied again. These changes break something for users:

  • target.tables is not a filter. The old config.yaml path synced only the listed tables, and no tables for an empty list (ExcludeAllMapper in pkg/catalog/refresh.go). refresh-publication --table-config syncs every published table (IncludeUnmatched). After the upgrade, each published table that is not in the list starts its initial copy. To prevent that, make each publication contain only the listed tables before the upgrade.
  • helm uninstall drops the slots, origins, and catalog rows. Before, a new install continued from the slots. The synced tables stay.
  • The Service has no grpc port. service.grpcPort has no effect.

The README has a new "Upgrade from a chart that runs connector-src-postgres" section with these steps.

Risks

  • Resources: each connector gets its own pod, so total resource requests grow with the number of connectors (250m CPU and 750Mi memory for each connector by default).
  • No lookup in GitOps tools: helm template and Argo CD do not drop a removed connector. With these tools, use drop: true first, as before.

Checks

  • kind with real Postgres 17 and TimescaleDB: upgrade from the old chart, add a table, remove a table, an unpublished table, a literal URL connector, a paused connector, drop: true, connector removal, and uninstall. Details are below.
  • Static checks: helm lint passes for both CI values files. kubeconform 0.6.7 in strict mode passes on Kubernetes 1.30 and 1.31. actionlint 1.7.7 passes.
  • CI: the kind-install workflow installs with --no-hooks and applies the hook Jobs directly, because the CI databases do not exist. It checks that restricted PodSecurity admits the run, refresh, and drop pods.
kind test results
  • Upgrade from the old chart: the old chart replicated 100 rows. After the upgrade, the new pod took over the slot with 0 restarts, and 120 of 120 rows arrived.
  • Add a table: adding events copied 50 rows, and the run pod stayed the same.
  • Unpublished table: the upgrade failed with BackoffLimitExceeded. The Job's termination message showed tables not in publication: public.missing.
  • Literal URL connector: with initial_data_copy: false and a table rename, only new rows streamed.
  • drop: true: two upgrades in a row both succeeded.
  • Connector removal:
    • I removed a literal URL connector and a paused connector. Both drop Jobs succeeded on their first pod.
    • The slot, origin, and catalog row of the literal URL connector are gone. The paused connector had no catalog row, so its Job exited with 0.
    • The remaining connector kept its pod, with 0 restarts.
    • The next upgrade removed the kept Secret keys and ran no drop Job.
  • Uninstall: 0 slots, 0 origins, and 0 subscriptions remained, and no chart resources were left.
  • Fresh install: 3 connectors installed, with and without --wait.
  • Restricted PodSecurity: the namespace admitted the run, refresh, and drop pods.
kind test results for the CLI changes
  • Process arguments: /proc/1/cmdline of the run pods has no connection strings.
  • Migration: two connectors started at the same time on a new target, with 0 restarts.
  • Tables: the unlisted table logs synced 30 rows, and metrics went to metrics_env. CDC added 120 rows to metrics_env and 10 rows to events_literal.
  • Identity check: the run and refresh commands accepted --skip-identity-check. helm template shows that skip_identity_check: true sends it.
  • Unpublished table: the refresh Job failed with tables not in publication: "public"."missing" in its termination message.
  • Drop and uninstall: the drop Jobs ran with only the environment variables, and uninstall dropped all slots, origins, and subscriptions.

The chart now runs the live-sync CLI of the image instead of
connector-src-postgres. The values.yaml contract does not change.

- Each connector gets its own Deployment that runs `live-sync run`. A
  `$VAR` database_url comes from `env` through Kubernetes expansion. The
  chart Secret holds a literal database_url, with the SSH tunnel
  parameters, and the SSH private key.
- A post-install and post-upgrade hook Job runs `refresh-publication`
  with the table list. A table list change does not restart the pod, and
  a refresh error, for example a table not in the publication, fails the
  release.
- `drop: true` drops the connector on the next upgrade. `helm uninstall`
  drops every connector after Helm deletes its pod.
- The Service and the PDB select only the run pods. The gRPC port is
  gone, and the probes use the metrics endpoint.

BREAKING CHANGE: `helm uninstall` now drops the replication slots,
origins, and catalog rows of each connector. Use `--no-hooks` to keep
them. Each connector now has its own pod with the `resources` of the
values file.
The CI databases do not exist, so the refresh and drop hooks cannot
succeed. The install skips the hooks, applies the hook Jobs directly,
and checks that the run, refresh, and drop pods pass the restricted
PodSecurity admission. The wait loop handles pods that the controllers
did not create yet.
The connector pods now send the live-sync usage telemetry.
`telemetry.enabled: false` passes `--disable-telemetry` to each live-sync
command. The value is not in values.yaml, so that its contract stays the
same. The README documents it and what the telemetry sends.
Users delete a connector by removing its entry, not by setting drop: true
for one upgrade and then removing it. A forgotten drop leaves a slot that
keeps WAL on the source.

On upgrade, the chart finds the run Deployments of the release whose
connector ID is not in the config, and runs a post-upgrade drop Job for
each. The values of a removed connector are gone, so the Job copies the
pod spec of the old Deployment. The chart Secret keeps the keys of the
removed connector for that one upgrade.

lookup does not work in helm template or in GitOps tools, so drop: true
stays for them.

Tested in kind: removing a literal-URL connector and a paused connector
dropped the slot, origin, and catalog row, and the other connector kept
replicating without a restart. The next upgrade removed the kept Secret
keys and ran no drop Job.
live-sync 0.36.0 reads the connection strings from LIVE_SYNC_SOURCE and
LIVE_SYNC_TARGET. The chart already sets them, so the commands drop
--source and --target, and the connection strings are not in the
process arguments any more.

0.36.0 also replaces refresh-publication --tables with --table-config,
which reads a file or stdin. The refresh Job pipes the table list to
--table-config=-. --table-config sets the target name and settings of a
table, but it is not a filter: every table of the publications syncs,
and a table that leaves the list keeps its sync. To stop the sync of a
table, remove it from the publication.

The identity check flag is now --skip-identity-check. The chart reads
the new skip_identity_check key and the old skip_always_identity_check
key.

The chart needs image v0.36.0 or later.

Tested in kind with live-sync built from the 0.36.0 release commit: the
run pods have no connection strings in /proc/1/cmdline, two connectors
on a new target started with no restart, a published table without an
entry synced, the identity flag reached the run and refresh commands, a
removed connector was dropped with only the env vars, an entry for an
unpublished table failed the refresh Job with the error in its
termination message, and uninstall dropped everything.
live-sync reads only skip_identity_check, and the chart assumes a current image.
Each connector now runs in its own pod, so a smaller CPU share is enough. live-sync needs more memory than 512Mi.
Set vpa.enabled to create one for each run Deployment. The default updateMode is Off, so VPA only writes recommendations.
- connectorLabels merges the chart labels with connectorSelectorLabels, so the connector labels are written once.
- podSpec takes run and uninstall, and derives the restart policy, the Secret, and the ServiceAccount from them.
- A secretName helper replaces five copies of the Secret name.
- One drop Job body serves the drop, uninstall, and removed connector cases.
- The Secret reads the old Secret only when a connector was removed.

The rendered manifests do not change.
Args, env, and replicas are in the pod spec, so a change to them already restarts the pod. The checksum now covers only the connection strings and the SSH key, which live in the chart Secret. A change to a field that only the refresh Job reads, such as target.skip_replica_identity_index, no longer restarts the pod.
@arajkumar
arajkumar merged commit 77a2676 into main Dec 1, 2026
7 checks passed
@arajkumar
arajkumar deleted the arajkumar/live-sync-entrypoint branch December 1, 2026 09:31
arajkumar pushed a commit that referenced this pull request Dec 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.2.0](v0.1.2...v0.2.0)
(2026-12-01)


### ⚠ BREAKING CHANGES

* run each connector with the live-sync CLI
([#10](#10))

### Features

* run each connector with the live-sync CLI
([#10](#10))
([77a2676](77a2676))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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