Skip to content

Commit 417fcc1

Browse files
author
Per Goncalves da Silva
committed
<carry>: update network policy configuration for metrics and dns on openshift
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 179ee2b commit 417fcc1

File tree

3 files changed

+101
-20
lines changed

3 files changed

+101
-20
lines changed

manifests/0000_50_olm_01-networkpolicies.yaml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,29 @@ spec:
2929
matchLabels:
3030
app: olm-operator
3131
ingress:
32-
- ports:
33-
- port: metrics
32+
- from:
33+
- namespaceSelector:
34+
matchLabels:
35+
name: openshift-monitoring
36+
ports:
37+
- port: 8443
3438
protocol: TCP
3539
egress:
3640
- ports:
3741
- port: 6443
3842
protocol: TCP
3943
- ports:
40-
- port: 53
44+
- port: dns-tcp
4145
protocol: TCP
42-
- port: 53
46+
- port: dns
4347
protocol: UDP
48+
to:
49+
- namespaceSelector:
50+
matchLabels:
51+
kubernetes.io/metadata.name: openshift-dns
52+
- podSelector:
53+
matchLabels:
54+
dns.operator.openshift.io/daemonset-dns: default
4455
policyTypes:
4556
- Ingress
4657
- Egress
@@ -60,18 +71,29 @@ spec:
6071
matchLabels:
6172
app: catalog-operator
6273
ingress:
63-
- ports:
64-
- port: metrics
74+
- from:
75+
- namespaceSelector:
76+
matchLabels:
77+
name: openshift-monitoring
78+
ports:
79+
- port: 8443
6580
protocol: TCP
6681
egress:
6782
- ports:
6883
- port: 6443
6984
protocol: TCP
7085
- ports:
71-
- port: 53
86+
- port: dns-tcp
7287
protocol: TCP
73-
- port: 53
88+
- port: dns
7489
protocol: UDP
90+
to:
91+
- namespaceSelector:
92+
matchLabels:
93+
kubernetes.io/metadata.name: openshift-dns
94+
- podSelector:
95+
matchLabels:
96+
dns.operator.openshift.io/daemonset-dns: default
7597
- ports: # This is another distinct rule in the egress list
7698
- protocol: TCP
7799
port: 50051
@@ -99,10 +121,17 @@ spec:
99121
port: 5443
100122
egress:
101123
- ports:
102-
- port: 53
124+
- port: dns-tcp
103125
protocol: TCP
104-
- port: 53
126+
- port: dns
105127
protocol: UDP
128+
to:
129+
- namespaceSelector:
130+
matchLabels:
131+
kubernetes.io/metadata.name: openshift-dns
132+
- podSelector:
133+
matchLabels:
134+
dns.operator.openshift.io/daemonset-dns: default
106135
- ports:
107136
- protocol: TCP
108137
port: 50051

microshift-manifests/0000_50_olm_01-networkpolicies.yaml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,29 @@ spec:
2929
matchLabels:
3030
app: olm-operator
3131
ingress:
32-
- ports:
33-
- port: metrics
32+
- from:
33+
- namespaceSelector:
34+
matchLabels:
35+
name: openshift-monitoring
36+
ports:
37+
- port: 8443
3438
protocol: TCP
3539
egress:
3640
- ports:
3741
- port: 6443
3842
protocol: TCP
3943
- ports:
40-
- port: 53
44+
- port: dns-tcp
4145
protocol: TCP
42-
- port: 53
46+
- port: dns
4347
protocol: UDP
48+
to:
49+
- namespaceSelector:
50+
matchLabels:
51+
kubernetes.io/metadata.name: openshift-dns
52+
- podSelector:
53+
matchLabels:
54+
dns.operator.openshift.io/daemonset-dns: default
4455
policyTypes:
4556
- Ingress
4657
- Egress
@@ -60,18 +71,29 @@ spec:
6071
matchLabels:
6172
app: catalog-operator
6273
ingress:
63-
- ports:
64-
- port: metrics
74+
- from:
75+
- namespaceSelector:
76+
matchLabels:
77+
name: openshift-monitoring
78+
ports:
79+
- port: 8443
6580
protocol: TCP
6681
egress:
6782
- ports:
6883
- port: 6443
6984
protocol: TCP
7085
- ports:
71-
- port: 53
86+
- port: dns-tcp
7287
protocol: TCP
73-
- port: 53
88+
- port: dns
7489
protocol: UDP
90+
to:
91+
- namespaceSelector:
92+
matchLabels:
93+
kubernetes.io/metadata.name: openshift-dns
94+
- podSelector:
95+
matchLabels:
96+
dns.operator.openshift.io/daemonset-dns: default
7597
- ports: # This is another distinct rule in the egress list
7698
- protocol: TCP
7799
port: 50051
@@ -99,10 +121,17 @@ spec:
99121
port: 5443
100122
egress:
101123
- ports:
102-
- port: 53
124+
- port: dns-tcp
103125
protocol: TCP
104-
- port: 53
126+
- port: dns
105127
protocol: UDP
128+
to:
129+
- namespaceSelector:
130+
matchLabels:
131+
kubernetes.io/metadata.name: openshift-dns
132+
- podSelector:
133+
matchLabels:
134+
dns.operator.openshift.io/daemonset-dns: default
106135
- ports:
107136
- protocol: TCP
108137
port: 50051

values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,26 @@ package:
104104
monitoring:
105105
enabled: true
106106
namespace: openshift-monitoring
107+
108+
networkPolicy:
109+
dns:
110+
ports:
111+
- protocol: TCP
112+
port: dns-tcp
113+
- protocol: UDP
114+
port: dns
115+
to:
116+
- namespaceSelector:
117+
matchLabels:
118+
kubernetes.io/metadata.name: openshift-dns
119+
- podSelector:
120+
matchLabels:
121+
dns.operator.openshift.io/daemonset-dns: default
122+
metrics:
123+
ports:
124+
- port: 8443
125+
protocol: TCP
126+
from:
127+
- namespaceSelector:
128+
matchLabels:
129+
name: openshift-monitoring

0 commit comments

Comments
 (0)