diff --git a/deploy/chart/templates/0000_50_olm_01-networkpolicies.yaml b/deploy/chart/templates/0000_50_olm_01-networkpolicies.yaml index 6ee410a64a..fb28e05266 100644 --- a/deploy/chart/templates/0000_50_olm_01-networkpolicies.yaml +++ b/deploy/chart/templates/0000_50_olm_01-networkpolicies.yaml @@ -85,3 +85,48 @@ spec: - { } egress: - { } +--- +# Complements per-CatalogSource NPs from the controller; covers the bootstrapping window before reconciliation. +# Effective only when catalog_namespace == namespace (the default). When they differ, no OLM-managed +# deny-all exists in catalog_namespace, so this rule has no effect; adding one there is unsafe since +# OLM does not exclusively own that namespace. +# No 'from:' restriction is intentional, matching current dynamic NP behavior. If the controller ever +# restricts ingress sources, this Helm-owned NP (which the controller cannot delete) will silently +# override that — treat as a permanent design constraint. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: olm-catalog-grpc-ingress + namespace: {{ .Values.catalog_namespace }} +spec: + podSelector: + matchExpressions: + - key: olm.catalogSource + operator: Exists + policyTypes: + - Ingress + ingress: + - ports: + - protocol: TCP + port: {{ .Values.catalogGrpcPodPort }} +--- +# Wildcard egress; API server port omitted intentionally — it is implementation-defined and not statically knowable. +# Carries the same split-namespace limitation as olm-catalog-grpc-ingress above. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: bundle-unpack-egress + namespace: {{ .Values.catalog_namespace }} +spec: + podSelector: + matchExpressions: + - key: operatorframework.io/bundle-unpack-ref + operator: Exists + - key: olm.managed + operator: In + values: + - "true" + policyTypes: + - Egress + egress: + - { }