Skip to main content

Kubernetes Sync

After a successful deployment, RDT activates an automatic file synchronization system. It watches your local configuration and property files, detects changes, and lets you push updates to the running Kubernetes pod without a full redeployment.

How It Works

Two Watch Zones

RDT creates two file watchers after deployment:

Watch ZonePathTracks
Metadataconfiguration/packages/**/*All files recursively — SAMO config packages
Propertiesproject/environments/<env>/*Top-level files — property files for the deployed environment

Changes are tracked separately so you can sync just metadata, just ConfigMaps, or both.

The Status Bar

The sync status bar appears in the bottom bar of VS Code after a deployment. It shows the current sync state and is your primary interaction point.

Screenshot needed

All 4 status bar states side by side: idle, pending, syncing, failed

Status Bar States

Hidden

No active sync context. The status bar is not visible.

Idle

Sync is active, no pending changes.

PropertyValue
Icon$(sync-ignored)
TextSync: <namespace>
Tooltip"No pending changes"
BackgroundDefault

Screenshot needed

The idle status bar

Pending

File changes have been detected. The status bar turns yellow to draw attention.

PropertyValue
Icon$(sync)
TextSync (<count>)
Tooltip"N metadata, M property files changed. Click to act."
BackgroundWarning (yellow/orange)

Screenshot needed

The pending status bar with change count

Syncing

A sync operation is in progress.

PropertyValue
Icon$(sync~spin) (animated)
TextSyncing <phase>...
Tooltip"Click to open Output"
BackgroundDefault

The <phase> indicates what's being synced: metadata, ConfigMaps, or rollback.

GIF needed

The syncing status bar with spinning icon

Failed

The last sync operation failed.

PropertyValue
Icon$(error)
TextSync failed
TooltipError message + "Click to open Output"
BackgroundError (red)

Screenshot needed

The failed status bar

Sync Actions

Click the status bar to open a Quick Pick menu with available actions. The menu options change based on the current state.

When Idle

ActionDescription
Stop SyncDeactivate file watchers and hide the status bar

When Changes Are Pending

ActionDescription
Sync allSync both metadata and ConfigMaps (shown only when both types have changes)
Sync metadata onlyCopy configuration packages to the pod and restart
Sync ConfigMaps onlyUpdate ConfigMaps from property files and restart affected services
Show changed filesDisplay a list of all pending file changes
Ignore all changesClear all pending changes without syncing
Stop SyncDeactivate file watchers and hide the status bar

Screenshot needed

The sync action Quick Pick menu showing all options

Sync Operations in Detail

Metadata Sync

When you sync metadata changes:

  1. Clear remote config directory on the pod
  2. Copy entire configuration/packages/ directory to the pod
  3. Restart the lids-as-master StatefulSet
  4. Wait for the pod to be ready

ConfigMap Sync

When you sync property file changes:

  1. Recreate affected ConfigMaps from the updated property files
  2. Restart only the services that depend on the changed ConfigMaps

Service Restart Map

Not all property file changes require restarting every service. RDT uses a targeted restart strategy:

Changed ConfigMapServices Restarted
lidsas-propertiesstatefulset/lids-as-master
lidsas-master-propertiesstatefulset/lids-as-master
samogateway-propertiesdeployment/samo-gateway
securityserver-propertiesdeployment/security-server
userservice-propertiesdeployment/user-service
licenseserver-propertiesAll services
datasource-propertiesAll services
info

licenseserver-properties and datasource-properties trigger a full restart because these configurations are shared across all services.

Commands

RDT registers the following commands for sync management:

CommandDescription
SAMO RDT: Trigger Kubernetes SyncOpen the sync action menu (same as clicking status bar)
SAMO RDT: Stop Kubernetes SyncDeactivate file watchers and stop sync
SAMO RDT: Ignore Pending Sync ChangesClear all pending changes
SAMO RDT: Show Pending Sync ChangesDisplay list of changed files

Access these from the Command Palette (Ctrl+Shift+P).

Persistence

The sync context (active deployment info, watched paths) is persisted in VS Code's workspace state. This means:

  • Survives window reload — if you close and reopen VS Code, sync resumes automatically
  • Per-workspace — each workspace has its own sync context
  • Auto-cleanup — stale contexts from older extension versions are automatically discarded

Troubleshooting

ProblemSolution
Status bar not appearing after deployCheck the Output panel for deployment errors. Sync only activates after a fully successful deploy.
Changes not detectedVerify the file is in one of the two watched directories. Property file changes are only detected for top-level files in the environment directory.
Sync fails repeatedlyClick the red status bar to open the Output channel and check the error details. Common causes: pod restarted, namespace deleted, network issues.
Want to restart from scratchStop sync, then redeploy. This creates a fresh sync context.