apiVersion: policy.networking.k8s.io/v1alpha1
kind: AdminNetworkPolicy
metadata:
name: egress-security-allow
spec:
egress:
- action: Deny
to:
- nodes:
matchExpressions:
- key: node-role.kubernetes.io/worker
operator: Exists
- action: Allow
name: allow-to-kubernetes-api-server-and-engr-dept-pods
ports:
- portNumber:
port: 6443
protocol: TCP
to:
- nodes: (1)
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
- pods: (2)
namespaceSelector:
matchLabels:
dept: engr
podSelector: {}
priority: 55
subject: (3)
namespaces:
matchExpressions:
- key: security (4)
operator: In
values:
- restricted
- confidential
- internal