|
| 1 | +# Copyright 2026 The Tekton Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# NetworkPolicy resources for the operator's own namespace (openshift-operators). Unlike the |
| 16 | +# NetworkPolicies documented in docs/NetworkPolicy.md (reconciled dynamically by the operator for |
| 17 | +# operand namespaces such as openshift-pipelines), no CR watches the operator's own namespace, so |
| 18 | +# these ship statically with the install manifests/OLM bundle instead. podSelectors are scoped to |
| 19 | +# this operator's own pod labels only — never an empty/namespace-wide selector, per the OLM bundle |
| 20 | +# guidance — so installing this bundle never affects other operators that may share the namespace |
| 21 | +# (openshift-operators is typically shared across many cluster-scoped operators). |
| 22 | +apiVersion: networking.k8s.io/v1 |
| 23 | +kind: NetworkPolicy |
| 24 | +metadata: |
| 25 | + name: openshift-pipelines-operator |
| 26 | +spec: |
| 27 | + podSelector: |
| 28 | + matchLabels: |
| 29 | + name: openshift-pipelines-operator |
| 30 | + policyTypes: |
| 31 | + - Ingress |
| 32 | + - Egress |
| 33 | + ingress: |
| 34 | + - from: |
| 35 | + - namespaceSelector: |
| 36 | + matchLabels: |
| 37 | + openshift.io/cluster-monitoring: "true" |
| 38 | + ports: |
| 39 | + - protocol: TCP |
| 40 | + port: 9090 |
| 41 | + egress: |
| 42 | + - to: |
| 43 | + - namespaceSelector: |
| 44 | + matchLabels: |
| 45 | + kubernetes.io/metadata.name: openshift-dns |
| 46 | + podSelector: |
| 47 | + matchLabels: |
| 48 | + dns.operator.openshift.io/daemonset-dns: default |
| 49 | + ports: |
| 50 | + - protocol: UDP |
| 51 | + port: 5353 |
| 52 | + - protocol: TCP |
| 53 | + port: 5353 |
| 54 | + - ports: |
| 55 | + - protocol: TCP |
| 56 | + port: 6443 |
| 57 | +--- |
| 58 | +apiVersion: networking.k8s.io/v1 |
| 59 | +kind: NetworkPolicy |
| 60 | +metadata: |
| 61 | + name: tekton-operator-webhook |
| 62 | +spec: |
| 63 | + podSelector: |
| 64 | + matchLabels: |
| 65 | + name: tekton-operator-webhook |
| 66 | + policyTypes: |
| 67 | + - Ingress |
| 68 | + - Egress |
| 69 | + ingress: |
| 70 | + # Admission webhook callbacks originate from the API server; source IPs vary by cluster |
| 71 | + # network plugin, so no ingress "from" restriction is applied here. |
| 72 | + - ports: |
| 73 | + - protocol: TCP |
| 74 | + port: 8443 |
| 75 | + egress: |
| 76 | + - to: |
| 77 | + - namespaceSelector: |
| 78 | + matchLabels: |
| 79 | + kubernetes.io/metadata.name: openshift-dns |
| 80 | + podSelector: |
| 81 | + matchLabels: |
| 82 | + dns.operator.openshift.io/daemonset-dns: default |
| 83 | + ports: |
| 84 | + - protocol: UDP |
| 85 | + port: 5353 |
| 86 | + - protocol: TCP |
| 87 | + port: 5353 |
| 88 | + - ports: |
| 89 | + - protocol: TCP |
| 90 | + port: 6443 |
0 commit comments