feat(netpols): ship the ESO webhook allow-rule - #3470
Open
aweingarten wants to merge 5 commits into
Open
Conversation
apl-core ships default-deny NetworkPolicies for the namespaces it manages but not the allow-rules its own components need, so under default-deny those components fail in ways that give no hint a NetworkPolicy is the cause. External Secrets is the clearest case: the apiserver cannot reach the validating / conversion webhook on 10250, so every ClusterSecretStore / ExternalSecret create or update times out against the webhook and the secrets stack never converges. Add an opt-in policy for the external-secrets webhook, following the existing per-app pattern in this chart: - `netpols.externalSecrets`, driven by `apps.external-secrets.networkPolicies.enabled` (default false) - ingress on 10250 scoped by port rather than by source: the apiserver is off the pod network on a managed control plane and has no address a namespaceSelector or ipBlock can pin down - ingress on 8080 from po-prometheus, so enabling the policy doesn't silently cut metrics scraping Default false because the policy is pod-scoped and ingress-typed: creating it makes the webhook pods deny any ingress not listed here, which is only the intent on a cluster already running default-deny. Refs linode#3387
This was referenced Jul 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in allow-rule to apl-network-policies so External Secrets’ webhook continues to work on clusters with default-deny NetworkPolicies, by permitting API server ingress to the webhook port and preserving Prometheus metrics scraping.
Changes:
- Introduces
apps.external-secrets.networkPolicies.enabled(schema + defaults) and wires it intonetpols.externalSecrets. - Adds a dedicated NetworkPolicy for the external-secrets webhook pods allowing ingress on 10250 (any source) and 8080 (Prometheus).
- Documents the new behavior in the
apl-network-policieschart values commentary.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| values/apl-network-policies/apl-network-policies.gotmpl | Maps apps.external-secrets.networkPolicies.enabled to netpols.externalSecrets. |
| values-schema.yaml | Adds networkPolicies to the apps.external-secrets schema via appNetworkPolicyConfig. |
| helmfile.d/snippets/defaults.yaml | Sets default apps.external-secrets.networkPolicies.enabled: false. |
| charts/apl-network-policies/values.yaml | Documents the new external-secrets webhook policy behavior and intent. |
| charts/apl-network-policies/templates/networkpolicies/external-secrets.yaml | Implements the webhook-scoped NetworkPolicy allowing apiserver ingress on 10250 and Prometheus scraping on 8080. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
charts/apl-network-policies/templates/networkpolicies/external-secrets.yaml:6
- NetworkPolicy names in this chart consistently use the
*-platform-policysuffix (e.g.,gitea-platform-policy,otomi-api-platform-policy). For consistency and easier grepping, consider renaming this resource to follow the same pattern.
name: external-secrets-webhook-policy
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
First of #3387 — and the specific rule @j-zimnowoda asked for in #3389 ("Could you provide an netpol spec that is missing to support ESO's webhook?").
apl-core ships default-deny NetworkPolicies for the namespaces it manages, but not the allow-rules its own bundled components need. Under default-deny those components fail with symptoms that give no hint a NetworkPolicy is the cause. External Secrets is the clearest case: the apiserver can't reach the validating/conversion webhook on 10250, so every
ClusterSecretStore/ExternalSecretcreate or update times out against the webhook and the secrets stack never converges.This adds an opt-in policy for the ESO webhook, following the per-app pattern already in
apl-network-policies:netpols.externalSecrets, driven byapps.external-secrets.networkPolicies.enabled(new, via the existingappNetworkPolicyConfigdefinition)po-prometheus, so turning the policy on doesn't silently cut metrics scraping🔍 Reviewer Notes
from. The apiserver is off the pod network on a managed control plane (LKE/LKE-E) and has no address anamespaceSelectororipBlockcan pin down, so an ingress rule withportsonly is the portable way to express "let the apiserver in". If you'd rather pin it to the LKE control-plane range, say which and I'll switch — I didn't want to bake an assumption about the address space into the chart.false, deliberately. The policy is pod-scoped andIngress-typed, so creating it makes the webhook pods deny any ingress not listed. That's only the intent on a cluster already running default-deny; on a cluster without it, enabling this tightens rather than loosens.appNetworkPolicyConfigalready defaultsenabledto false.helm template charts/external-secretsproduces pod labelsapp.kubernetes.io/name: external-secrets-webhookand container ports 10250 (webhook), 8080 (metrics), 8081 (ready) in namespaceexternal-secrets.helm templaterenders the policy with the flag on and nothing with it off, andhelm lintpasses both ways.Remaining #3387 gaps
Keeping this to one component so it's reviewable. The other rules from the issue are each their own PR, and I'd rather land them one at a time than in a batch:
app=cert-manager-webhook-linodewith noapp.kubernetes.io/name, so the chart's generic webhook policy (charts/cert-manager/templates/networkpolicy-webhooks.yaml) doesn't match it at all.kubernetesService maps 443→targetPort 6443 and Cilium evaluates policy after kube-proxy-replacement DNAT, so every policy that talks to the apiserver must allow 6443 or all API calls hang.🧹 Checklist
helm lint/helm templateand verified against the rendered ESO chart