Skip to content

Preserve translator identity metadata on host pod updates - #3

Merged
max06 merged 1 commit into
mainfrom
fix/preserve-host-pod-identity
Jul 30, 2026
Merged

Preserve translator identity metadata on host pod updates#3
max06 merged 1 commit into
mainfrom
fix/preserve-host-pod-identity

Conversation

@max06

@max06 max06 commented Jul 30, 2026

Copy link
Copy Markdown

Problem

updatePod copies the virtual pod's labels and annotations verbatim onto the host pod. The virtual pod never carries the translator-added k3k.io/clusterName label or the k3k.io/name / k3k.io/namespace annotations, so any pod update (image bump, label/annotation change, kubelet restart re-sync) strips them from the host pod.

Observed impact on a live shared-mode cluster: after a k3k-kubelet restart, every synced workload pod lost k3k.io/clusterName. The synced k3k-<cluster>-kube-dns service (selector includes that label) lost all endpoints — DNS inside the virtual cluster went completely dark (operation not permitted on every lookup, external-dns and anything else needing DNS dead). Any NetworkPolicy/CiliumNetworkPolicy selecting on the label silently stops matching, too.

Fix

After the label/annotation copy in the host-pod update path, re-assert the translator-owned identity keys. Virtual label changes still propagate; host-side identity survives.

Testing

  • go test ./k3k-kubelet/provider/ passes
  • Verified live: with the patch, pod updates keep k3k.io/clusterName; kube-dns endpoints stay populated across kubelet restarts

🤖 Generated with Claude Code

updatePod copies the virtual pod's labels and annotations verbatim onto
the host pod. The virtual pod never carries the translator-added
k3k.io/clusterName label or the k3k.io/name and k3k.io/namespace
annotations, so any pod update (image bump, label/annotation change,
kubelet restart re-sync) strips them from the host pod. That breaks
every label-selector consumer on the host side: synced services such as
k3k-<cluster>-kube-dns lose all endpoints (virtual-cluster DNS goes
dark), and network policies selecting on the cluster label silently
stop matching the pod.

Re-assert the translator-owned keys after the copy so updates propagate
virtual label changes without destroying host-side identity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@max06
max06 merged commit 193b701 into main Jul 30, 2026
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