networkpolicy-allow-traffic-to-kubelet
Allow egress traffic to kubelet on port 10250 within 10.0.0.0/8.
A reference manifest to copy and adapt, not a rule cenroq enforces for you. It carries no severity, belongs to no bundle, and nothing on your cluster changes until you apply it yourself.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-traffic-to-kubelet
annotations:
cenroq.io/displayName: "Allow Egress to Kubelet"
cenroq.io/description: "Allow egress traffic to kubelet on port 10250 within 10.0.0.0/8."
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 10.0.0.0/8
ports:
- protocol: TCP
port: 10250Save it as networkpolicy-allow-traffic-to-kubelet.yaml — the commands below assume that name.
This is a manifest, not an admission policy, so there is nothing for kubeapt validate to check it against. Adapt the selectors and namespace first, then:
$ kubectl apply -f ./networkpolicy-allow-traffic-to-kubelet.yaml