Skip to content

feat(keda): add k8s networkPolicy#808

Merged
wozniakjan merged 1 commit intokedacore:mainfrom
fty4:feat/k8s-netpol
Feb 2, 2026
Merged

feat(keda): add k8s networkPolicy#808
wozniakjan merged 1 commit intokedacore:mainfrom
fty4:feat/k8s-netpol

Conversation

@fty4
Copy link
Contributor

@fty4 fty4 commented Jan 29, 2026

Currently the Keda helm chart only supports cilium networkpolicies.
This PR adds support for the natively kubernetes networkPolicy.

As already prepared in the values file we then can use different flavors to tell which networkpolicy should be used.
Kubernetes NetworkPolicies for KEDA components can be enabled via .Values.networkPolicy.enabled and .Values.networkPolicy.flavor == "kubernetes".

Configuration

Following network policies are configured:

Component Ingress Ports Egress Targets
Webhooks 9443 (admission), optional metrics/profiling DNS (53), K8s API (443/6443), unrestricted cluster access
Metrics Server HTTPS metrics API, optional metrics/profiling DNS (53), K8s API (443/6443), operator gRPC (9666), unrestricted cluster access
Operator 9666 (gRPC), optional metrics/profiling DNS (53), K8s API (443/6443), unrestricted cluster access

Checklist

  • I have verified that my change is according to the deprecations & breaking changes policy
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • README is updated with new configuration values (if applicable) learn more
  • A PR is opened to update KEDA core (repo) (if applicable, ie. when deployment manifests are modified)

Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds native Kubernetes NetworkPolicy support to the KEDA Helm chart, complementing the existing Cilium NetworkPolicy implementation. Users can now enable standard Kubernetes NetworkPolicies by setting .Values.networkPolicy.enabled=true and .Values.networkPolicy.flavor="kubernetes".

Changes:

  • Added configuration structure in values.yaml for Kubernetes NetworkPolicy with extraEgressRules support for operator, metrics server, and webhooks components
  • Created NetworkPolicy templates for all three KEDA components (operator, metrics-server, webhooks) with appropriate ingress/egress rules
  • Updated README documentation to reflect the new kubernetes flavor option and configuration structure

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
keda/values.yaml Added kubernetes NetworkPolicy configuration structure with extraEgressRules for all components; updated flavor comment to include "kubernetes"; removed trailing empty lines
keda/templates/webhooks/networkpolicy.yaml New NetworkPolicy for webhooks with ingress rules for admission webhooks, metrics, and profiling; egress rules for DNS, K8s API, and cluster-wide validation
keda/templates/metrics-server/networkpolicy.yaml New NetworkPolicy for metrics server with ingress rules for HTTPS API, metrics, and profiling; egress rules for DNS, K8s API, operator gRPC communication, and cluster-wide metric collection
keda/templates/manager/networkpolicy.yaml New NetworkPolicy for operator with ingress rules for gRPC metrics service, Prometheus metrics, and profiling; egress rules for DNS, K8s API, and cluster-wide access for scalers
keda/README.md Updated documentation to reflect the new kubernetes NetworkPolicy flavor option and configuration structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wozniakjan wozniakjan merged commit a2dc365 into kedacore:main Feb 2, 2026
42 checks passed
@fty4 fty4 deleted the feat/k8s-netpol branch February 9, 2026 07:28
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.

5 participants