Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions manifests/0000_50_olm_01-networkpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,16 @@ spec:
- port: metrics
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
Expand All @@ -68,18 +66,16 @@ spec:
- port: metrics
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports:
- protocol: TCP
port: 50051
Expand All @@ -106,18 +102,16 @@ spec:
- protocol: TCP
port: 5443
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports:
- protocol: TCP
port: 50051
Expand Down
14 changes: 6 additions & 8 deletions manifests/0000_50_olm_06-psm-operator.networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ spec:
- port: 8443
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
14 changes: 6 additions & 8 deletions manifests/0000_50_olm_07-collect-profiles.networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ spec:
- podSelector:
matchLabels:
app: catalog-operator
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Egress
- Ingress
28 changes: 12 additions & 16 deletions microshift-manifests/0000_50_olm_01-networkpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@ spec:
- port: metrics
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
Expand All @@ -69,18 +67,16 @@ spec:
- port: metrics
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports:
- protocol: TCP
port: 50051
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ spec:
- port: 8443
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
28 changes: 12 additions & 16 deletions scripts/generate_crds_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,16 @@ spec:
- port: 8443
protocol: TCP
egress:
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
Expand Down Expand Up @@ -444,18 +442,16 @@ spec:
- podSelector:
matchLabels:
app: catalog-operator
- {}
- ports:
- port: 6443
- port: 53
protocol: TCP
- ports:
- port: dns-tcp
- port: 53
protocol: UDP
- port: 5353
protocol: TCP
- port: dns
- port: 5353
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Egress
- Ingress
Expand Down
7 changes: 4 additions & 3 deletions staging/operator-lifecycle-manager/deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ networkPolicy:
port: 53
- protocol: UDP
port: 53
kubeAPIServer:
ports:
- protocol: TCP
port: 6443
port: 5353
- protocol: UDP
port: 5353
kubeAPIServer: {}
metrics:
ports:
- protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,29 @@ func DesiredGRPCServerNetworkPolicy(catalogSource *v1alpha1.CatalogSource, match
},
}

// Allow egress to kube-apiserver from configmap backed catalog sources
// Allow egress to kube-apiserver and DNS from configmap backed catalog sources
if catalogSource.Spec.SourceType == v1alpha1.SourceTypeConfigmap || catalogSource.Spec.SourceType == v1alpha1.SourceTypeInternal {
np.Spec.Egress = []networkingv1.NetworkPolicyEgressRule{
// Wildcard allow all IPs/Ports for kube-apiserver
{},
// Wildcard allow all IPs with DNS ports
{
Ports: []networkingv1.NetworkPolicyPort{
{
Protocol: ptr.To(corev1.ProtocolTCP),
Port: ptr.To(intstr.FromInt32(6443)),
Port: ptr.To(intstr.FromInt32(53)),
},
{
Protocol: ptr.To(corev1.ProtocolUDP),
Port: ptr.To(intstr.FromInt32(53)),
},
{
Protocol: ptr.To(corev1.ProtocolTCP),
Port: ptr.To(intstr.FromInt32(5353)),
},
{
Protocol: ptr.To(corev1.ProtocolUDP),
Port: ptr.To(intstr.FromInt32(5353)),
},
},
},
Expand Down Expand Up @@ -90,11 +105,26 @@ func DesiredUnpackBundlesNetworkPolicy(catalogSource client.Object) *networkingv
},
PolicyTypes: []networkingv1.PolicyType{networkingv1.PolicyTypeIngress, networkingv1.PolicyTypeEgress},
Egress: []networkingv1.NetworkPolicyEgressRule{
// Wildcard allow all IPs/Ports for kube-apiserver
{},
// Wildcard allow all IPs with DNS ports
{
Ports: []networkingv1.NetworkPolicyPort{
{
Protocol: ptr.To(corev1.ProtocolTCP),
Port: ptr.To(intstr.FromInt32(6443)),
Port: ptr.To(intstr.FromInt32(53)),
},
{
Protocol: ptr.To(corev1.ProtocolUDP),
Port: ptr.To(intstr.FromInt32(53)),
},
{
Protocol: ptr.To(corev1.ProtocolTCP),
Port: ptr.To(intstr.FromInt32(5353)),
},
{
Protocol: ptr.To(corev1.ProtocolUDP),
Port: ptr.To(intstr.FromInt32(5353)),
},
},
},
Expand Down
12 changes: 6 additions & 6 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ networkPolicy:
dns:
ports:
- protocol: TCP
port: dns-tcp
port: 53
- protocol: UDP
port: dns
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
port: 53
- protocol: TCP
port: 5353
- protocol: UDP
port: 5353
Loading