Skip to content

Configure Network Policies

The chart can apply default-deny ingress and egress policies to the Varroa release namespace. The feature is disabled by default and requires a CNI that enforces Kubernetes NetworkPolicy.

The chart does not isolate controller namespaces. Apply separate policies there for Jenkins and agent workloads.

SourceDestinationPortPurpose
Controller namespacesGateway9090, 9092/TCPmite and key checks
Control planeNATS4222/TCPBus
Control planeKubernetes API443, 6443/TCPResources
Ingress controllerDashboard, BFF8080/TCPHTTP
Ingress controllerOperator8082/TCPWake
Operator, BFFJenkins8080/TCPOperations

External egress depends on enabled features:

SourceDestinationPortsPurpose
Operator, BFFGit443, 22/TCPBundles
OperatorOCI registry443/TCPArtifacts
Dex or BFFIdentity providerProvider portsLogin
ComponentsOTLP collector4317, 4318/TCPTelemetry
Jenkins, control planeUpdate center8080/TCPPlugins

Cluster DNS is also required. Add any build-time destinations used by Jenkins or agents to tenant policies.

Start with selectors and API server addresses for your cluster:

networkPolicy:
enabled: true
ingressControllerNamespaceSelector:
kubernetes.io/metadata.name: ingress-nginx
tenantNamespaceSelector:
varroa.dev/tenant: "true"
apiServerEgress:
cidrs: ["10.0.0.2/32"]
ports: [443, 6443]
metricsIngress: []

Label every controller namespace selected by the policy:

Terminal window
kubectl label namespace jenkins-platform varroa.dev/tenant=true
helm upgrade varroa oci://ghcr.io/varroaci/charts/varroa \
--version <version> -n varroa-system -f values.yaml

An empty tenantNamespaceSelector permits every namespace to reach the gateway. A non-empty selector is safer on shared clusters.

Git egress defaults to ports 443 and 22 for any destination. OCI and update-center rules default to HTTPS for any IPv4 address. Narrow them to known registry or proxy CIDRs:

networkPolicy:
ociRegistryEgress:
enabled: true
cidrs: ["10.20.0.0/16"]
ports: [443]
pullThroughEgress:
enabled: false
updateCenterRegistryEgress:
enabled: true
cidrs: ["10.20.0.0/16"]
ports: [443]

Kubernetes NetworkPolicy matches IP addresses, not DNS names. Include every address returned by load-balanced endpoints. Update-center pull-through can contact both the configured update service and its checksum archive. Allow both or disable the archive fallback and pre-seed every required plugin.

Apply policies in a maintenance window and test actual flows:

Terminal window
kubectl get networkpolicy -n varroa-system
kubectl get pods -n varroa-system
kubectl get controller -A

Every running controller should return to Connected. Confirm dashboard login, bundle refresh, controller wake, metrics collection, and update-center readiness.

SymptomLikely cause
Controller remains RunningTenant selector mismatch or TCP 9090 blocked.
Dashboard is unreachableIngress-controller selector mismatch.
Bundle fetch times outGit or OCI egress blocked.
Login failsIdentity-provider egress blocked.
Update center is degradedRegistry or pull-through egress blocked.

See Air-gapped installation for an offline allowlist.