Repository navigation
feat(chart): add optional NetworkPolicy for high availability - #486
DsThakurRawat wants to merge 1 commit into
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DsThakurRawat The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for node-readiness-controller canceled.
|
|
Hi @DsThakurRawat. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
5c7ebff to
18af0d7
Compare
|
waiting for feedback on this one |
18af0d7 to
d35d92d
Compare
|
Hi @DsThakurRawat, thanks for adding this. I tried it on a k3s cluster, and the default egress rule blocks the controller from reaching the API server. The rule only allows 443. On k3s and kubeadm that endpoint is on 6443, so the traffic gets dropped. What I tested (k3d, k3s v1.33.6+k3s1, Calico enforcing policies): Installed the chart from this PR with networkPolicy.enabled=true, everything else default. "Error retrieving lease lock" err="Get "https://10.43.0.1:443/apis/coordination.k8s.io/v1/namespaces/nrr-netpol-test/leases/ba65f13e.readiness.node.x-k8s.io?timeout=5s\": context deadline exceeded" Note that the pod showed 1/1 Ready the whole time despite the readiness check failing which is normal behaviour Suggestions: Allow both 443 and 6443 by default, or make the API server ports a value, something like networkPolicy.apiServerPorts: [443, 6443]. I think the value is better, so people can match whatever their API server uses. Also please update the unit test. Right now it only checks for 443. |
Adds a networkPolicy section to values.yaml that templates into a NetworkPolicy resource, disabled by default. When enabled it allows kubelet probes, the webhook and metrics ports when those servers are on, plus configurable API server (defaulting to 443 and 6443 for k3s/kubeadm compatibility) and DNS egress, with extra ingress/egress rules appendable verbatim. Covered by helm-unittest like the other templates. Signed-off-by: Divyansh Rawat <divyanshrawatofficial@gmail.com>
d35d92d to
d2646aa
Compare
|
Good catch @sairamreddybhavanam, thanks for verifying on k3s with Calico. Added |
Adds an optional NetworkPolicy to the Helm chart, disabled by default.
When
networkPolicy.enabledis true, the policy selects the controller pods and allows kubelet probes (8081), the webhook port whenwebhook.enabled, the metrics port whenmetrics.enabled, plus API server (443) and DNS (53) egress. Extra ingress/egress rules can be appended verbatim via values for clusters that need more.Verified locally:
helm lintclean,helm templaterenders byte-identical output across runs, the podSelector matches the deployment selector exactly, all 46 helm-unittest tests pass (5 new), andhack/verify-chart-drift.shis clean.Fixes #480