Skip to content

OPRUN-3923,OPRUN-3906,OPRUN-3903,OPRUN-3926: Add NetworkPolicy support to OLMv0 components #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 22, 2025
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
146 changes: 146 additions & 0 deletions manifests/0000_50_olm_01-networkpolicies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all-traffic
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: olm-operator
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: olm-operator
ingress:
- ports:
- port: metrics
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: catalog-operator
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: catalog-operator
ingress:
- ports:
- port: metrics
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports: # This is another distinct rule in the egress list
- protocol: TCP
port: 50051
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: packageserver
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: packageserver
ingress:
- ports:
- protocol: TCP
port: 5443
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports:
- protocol: TCP
port: 50051
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-allow-all
namespace: openshift-operators
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
ingress:
- {}
egress:
- {}
34 changes: 34 additions & 0 deletions manifests/0000_50_olm_06-psm-operator.networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: package-server-manager
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: package-server-manager
ingress:
- ports:
- port: 8443
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
4 changes: 4 additions & 0 deletions manifests/0000_50_olm_07-collect-profiles.cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
name: collect-profiles
labels:
app: olm-collect-profiles
namespace: openshift-operator-lifecycle-manager
spec:
schedule: "*/15 * * * *"
Expand All @@ -18,6 +20,8 @@ spec:
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: restricted-v2
labels:
app: olm-collect-profiles
spec:
securityContext:
runAsNonRoot: true
Expand Down
43 changes: 43 additions & 0 deletions manifests/0000_50_olm_07-collect-profiles.networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: collect-profiles
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: olm-collect-profiles
egress:
- ports:
- port: 8443
protocol: TCP
to:
- namespaceSelector:
matchLabels:
name: openshift-operator-lifecycle-manager
- podSelector:
matchLabels:
app: olm-operator
- podSelector:
matchLabels:
app: catalog-operator
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Egress
- Ingress
89 changes: 89 additions & 0 deletions microshift-manifests/0000_50_olm_01-networkpolicies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all-traffic
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: olm-operator
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: olm-operator
ingress:
- ports:
- port: metrics
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: catalog-operator
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: catalog-operator
ingress:
- ports:
- port: metrics
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
- ports: # This is another distinct rule in the egress list
- protocol: TCP
port: 50051
policyTypes:
- Ingress
- Egress
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: package-server-manager
namespace: openshift-operator-lifecycle-manager
annotations:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
include.release.openshift.io/hypershift: "true"
spec:
podSelector:
matchLabels:
app: package-server-manager
ingress:
- ports:
- port: 8443
protocol: TCP
egress:
- ports:
- port: 6443
protocol: TCP
- ports:
- port: dns-tcp
protocol: TCP
- port: dns
protocol: UDP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-dns
policyTypes:
- Ingress
- Egress
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
include.release.openshift.io/self-managed-high-availability: "true"
capability.openshift.io/name: "OperatorLifecycleManager"
name: collect-profiles
labels:
app: olm-collect-profiles
namespace: openshift-operator-lifecycle-manager
spec:
schedule: "*/15 * * * *"
Expand All @@ -18,6 +20,8 @@ spec:
annotations:
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: restricted-v2
labels:
app: olm-collect-profiles
spec:
securityContext:
runAsNonRoot: true
Expand Down
Loading