Merged
Conversation
When policy.hotReload.enabled is true, a kiwigrid/k8s-sidecar runs as a native sidecar (restartable init container) that watches for ConfigMap changes labeled headscale-policy=true, syncing policy updates into the pod without requiring a restart. Disabled by default so users with Stakater Reloader or similar can continue using their existing setup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies: sidecar presence, RBAC resources, ConfigMap label, directory-based policy path, emptyDir volume, and file sync. Also fixes existing policy path check to handle both modes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kiwigrid/k8s-sidecaras a native sidecar (restartable init container) to the headscale server deploymentpolicy.hotReload.enabledis true, ACL policy ConfigMap changes are synced into the pod without requiring a restartInspired by the policy hot-reload concept in #7.
Changes
values.yaml/values.schema.json— newpolicy.hotReloadsection with configurable imagedeployment.yaml— conditional sidecar init container, policy volume switches from ConfigMap to emptyDir when hot-reload is on, policy checksum annotation skipped (sidecar handles updates)policy-configmap.yaml— conditionalheadscale-policy: "true"label for sidecar discoveryserviceaccount.yaml— conditional Role/RoleBinding granting ConfigMap list/get/watchconfigmap.yaml— policy path adjusts to/etc/headscale/policy/policy.jsonwhen hot-reload is onConfiguration
Test plan
helm lintpasses with default valueshelm lintpasses withpolicy.hotReload.enabled=truepolicy.enabled=trueandclient.advertiseRoutespaths--with-hot-reload): sidecar running, RBAC created, label applied, policy file synced by sidecar🤖 Generated with Claude Code