Skip to content

Commit a02b2d0

Browse files
committed
Add NetworkPolicies for operator
Sriov Network Operator pod needs egress traffic to the API server. No other traffic is supposed to go in/out the pod. Signed-off-by: Andrea Panattoni <[email protected]>
1 parent df1c36d commit a02b2d0

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

config/default/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ bases:
1616
- ../crd
1717
- ../rbac
1818
- ../manager
19+
- ../networkpolicies
1920
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
2021
# crd/kustomization.yaml
2122
#- ../webhook
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: NetworkPolicy
3+
metadata:
4+
name: operator-allow-egress-to-api-server
5+
spec:
6+
podSelector:
7+
matchLabels:
8+
name: sriov-network-operator
9+
egress:
10+
- ports:
11+
- protocol: TCP
12+
port: 6443
13+
policyTypes:
14+
- Egress
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
resources:
2+
- allow_egress_api_server.yaml

0 commit comments

Comments
 (0)