Skip to content

cattleset: add networkPolicy.flavor with cilium support#497

Merged
tamalsaha merged 1 commit into
masterfrom
cattleset-network-policy-flavor
Jul 8, 2026
Merged

cattleset: add networkPolicy.flavor with cilium support#497
tamalsaha merged 1 commit into
masterfrom
cattleset-network-policy-flavor

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

Mirrors #474 (networkPolicy.flavor with cilium support) for the cattleset chart. Adds a networkPolicy.flavor helm value (default kubernetes) plus the helper layer (security.networkPolicyFlavor, security.useCiliumNetworkPolicy, security.useKubernetesNetworkPolicy) that reads both the chart-local value and the global namespaced value, so the toggle propagates when cattleset is pulled in as a subchart.

When flavor=cilium and networkPolicy.enabled=true, cattleset emits CiliumNetworkPolicy resources:

  • ingress from kube-apiserver on 9443 — conversion / mutation / validation webhooks
  • egress to kube-apiserver on 6443
  • egress DNS to kube-dns on 53

Otherwise the default networking.k8s.io/v1 NetworkPolicy resources are emitted, unchanged.

The values.openapiv3_schema.yaml already carried flavor — cattleset was added (#495) after #474 merged, so the shared NetworkPolicySpec.Flavor type was already in the generated schema. No apis/ or codegen changes were needed.

Test plan

  • helm template cs ./charts/cattleset — no policies (default)
  • helm template cs ./charts/cattleset --set networkPolicy.enabled=true — 2 NetworkPolicy (current behavior preserved)
  • helm template cs ./charts/cattleset --set networkPolicy.enabled=true --set networkPolicy.flavor=cilium — 3 CiliumNetworkPolicy
  • --set networkPolicy.enabled=true --set global.networkPolicy.flavor=cilium — flavor propagates (global → local fallback)
  • helm lint ./charts/cattleset

Related

Mirror #474 for the cattleset chart. Adds a
networkPolicy.flavor value (default kubernetes) and helper functions
(security.networkPolicyFlavor, security.useCiliumNetworkPolicy,
security.useKubernetesNetworkPolicy) that read both the chart-local
value and the global namespaced value so the toggle propagates when
cattleset is pulled in as a subchart.

When flavor=cilium and networkPolicy.enabled=true, cattleset emits
CiliumNetworkPolicy resources: ingress from kube-apiserver on 9443 for
the conversion/mutation/validation webhooks, egress to kube-apiserver
on 6443, and DNS egress. Otherwise the default networking.k8s.io/v1
NetworkPolicy resources are emitted as before.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit 0a79c41 into master Jul 8, 2026
3 of 4 checks passed
@tamalsaha tamalsaha deleted the cattleset-network-policy-flavor branch July 8, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant