|
| 1 | +--- |
| 2 | +apiVersion: ran.openshift.io/v1 |
| 3 | +kind: PolicyGenTemplate |
| 4 | +metadata: |
| 5 | + name: "common-latest" |
| 6 | + namespace: "ztp-common" |
| 7 | +spec: |
| 8 | + bindingRules: |
| 9 | + # These policies will correspond to all clusters with this label: |
| 10 | + common: "true" |
| 11 | + # du-profile: "latest" |
| 12 | + sourceFiles: |
| 13 | + # Create operators policies that will be installed in all clusters |
| 14 | + - fileName: SriovSubscriptionNS.yaml |
| 15 | + policyName: "{{ 'sriov-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 16 | + - fileName: SriovSubscriptionOperGroup.yaml |
| 17 | + policyName: "{{ 'sriov-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 18 | + - fileName: SriovSubscription.yaml |
| 19 | + policyName: "{{ 'sriov-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 20 | +{% if extraHubCommonTemplates %} |
| 21 | + metadata: |
| 22 | + annotations: |
| 23 | + {%- raw %} |
| 24 | + scale-test-label-1: '{{hub fromConfigMap "" "common-template-map" "key1" hub}}' |
| 25 | + scale-test-label-2: '{{hub fromConfigMap "" "common-template-map" "key2" hub}}' |
| 26 | + {%- endraw +%} |
| 27 | +{% endif %} |
| 28 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 29 | + spec: |
| 30 | + source: {{ common_catalogsource_name }} |
| 31 | +{% endif %} |
| 32 | + - fileName: SriovOperatorStatus.yaml |
| 33 | + policyName: "{{ 'sriov-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 34 | + - fileName: PtpSubscriptionNS.yaml |
| 35 | + policyName: "{{ 'ptp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 36 | + - fileName: PtpSubscriptionOperGroup.yaml |
| 37 | + policyName: "{{ 'ptp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 38 | + - fileName: PtpSubscription.yaml |
| 39 | + policyName: "{{ 'ptp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 40 | +{% if extraHubCommonTemplates %} |
| 41 | + metadata: |
| 42 | + annotations: |
| 43 | + {%- raw %} |
| 44 | + scale-test-label-1: '{{hub fromConfigMap "" "common-template-map" "key3" hub}}' |
| 45 | + scale-test-label-2: '{{hub fromConfigMap "" "common-template-map" "key4" hub}}' |
| 46 | + {%- endraw +%} |
| 47 | +{% endif %} |
| 48 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 49 | + spec: |
| 50 | + source: {{ common_catalogsource_name }} |
| 51 | +{% endif %} |
| 52 | + - fileName: PtpOperatorStatus.yaml |
| 53 | + policyName: "{{ 'ptp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 54 | + - fileName: ClusterLogNS.yaml |
| 55 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 56 | + - fileName: ClusterLogOperGroup.yaml |
| 57 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 58 | + - fileName: ClusterLogSubscription.yaml |
| 59 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 60 | +{% if extraHubCommonTemplates %} |
| 61 | + metadata: |
| 62 | + annotations: |
| 63 | + {%- raw %} |
| 64 | + scale-test-label-1: '{{hub fromConfigMap "" "common-template-map" "key3" hub}}' |
| 65 | + scale-test-label-2: '{{hub fromConfigMap "" "common-template-map" "key4" hub}}' |
| 66 | + {%- endraw +%} |
| 67 | +{% endif %} |
| 68 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 69 | + spec: |
| 70 | + source: {{ common_catalogsource_name }} |
| 71 | +{% endif %} |
| 72 | + - fileName: ClusterLogOperatorStatus.yaml |
| 73 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 74 | + - fileName: ClusterLogServiceAccount.yaml |
| 75 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 76 | + - fileName: ClusterLogServiceAccountAuditBinding.yaml |
| 77 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 78 | + - fileName: ClusterLogServiceAccountInfrastructureBinding.yaml |
| 79 | + policyName: "{{ 'log-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 80 | + - fileName: StorageNS.yaml |
| 81 | + policyName: "{{ 'storage-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 82 | + - fileName: StorageOperGroup.yaml |
| 83 | + policyName: "{{ 'storage-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 84 | + - fileName: StorageSubscription.yaml |
| 85 | + policyName: "{{ 'storage-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 86 | +{% if extraHubCommonTemplates %} |
| 87 | + metadata: |
| 88 | + annotations: |
| 89 | + {%- raw %} |
| 90 | + scale-test-label-1: '{{hub fromConfigMap "" "common-template-map" "key1" hub}}' |
| 91 | + scale-test-label-2: '{{hub fromConfigMap "" "common-template-map" "key2" hub}}' |
| 92 | + {%- endraw +%} |
| 93 | +{% endif %} |
| 94 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 95 | + spec: |
| 96 | + source: {{ common_catalogsource_name }} |
| 97 | +{% endif %} |
| 98 | + - fileName: StorageOperatorStatus.yaml |
| 99 | + policyName: "{{ 'storage-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 100 | + # - fileName: AmqSubscriptionNS.yaml |
| 101 | + # policyName: "subscriptions-policy" |
| 102 | + # - fileName: AmqSubscriptionOperGroup.yaml |
| 103 | + # policyName: "subscriptions-policy" |
| 104 | + # - fileName: AmqSubscription.yaml |
| 105 | + # policyName: "subscriptions-policy" |
| 106 | + # |
| 107 | + # LCA operator is used for orchestrating Image Based Upgrade for SNO |
| 108 | +{% if include_lca_operator %} |
| 109 | + - fileName: LcaSubscriptionNS.yaml |
| 110 | + policyName: "{{ 'lca-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 111 | + - fileName: LcaSubscriptionOperGroup.yaml |
| 112 | + policyName: "{{ 'lca-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 113 | + - fileName: LcaSubscription.yaml |
| 114 | + policyName: "{{ 'lca-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 115 | + spec: |
| 116 | + channel: {{ lifecycle_agent_channel }} |
| 117 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 118 | + source: {{ common_catalogsource_name }} |
| 119 | +{% endif %} |
| 120 | + - fileName: LcaOperatorStatus.yaml |
| 121 | + policyName: "{{ 'lca-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 122 | + |
| 123 | +{% else %} |
| 124 | + # - fileName: LcaSubscriptionNS.yaml |
| 125 | + # policyName: "subscriptions-policy" |
| 126 | + # - fileName: LcaSubscriptionOperGroup.yaml |
| 127 | + # policyName: "subscriptions-policy" |
| 128 | + # - fileName: LcaSubscription.yaml |
| 129 | + # policyName: "subscriptions-policy" |
| 130 | + # - fileName: LcaOperatorStatus.yaml |
| 131 | + # policyName: "subscriptions-policy" |
| 132 | + # |
| 133 | +{% endif %} |
| 134 | + # OADP operator is used for backing up and restoring application during Image Based Upgrade |
| 135 | +{% if include_oadp_operator %} |
| 136 | + - fileName: OadpSubscriptionNS.yaml |
| 137 | + policyName: "{{ 'oadp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 138 | + - fileName: OadpSubscriptionOperGroup.yaml |
| 139 | + policyName: "{{ 'oadp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 140 | + - fileName: OadpSubscription.yaml |
| 141 | + policyName: "{{ 'oadp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 142 | + spec: |
| 143 | + channel: stable-1.4 |
| 144 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 145 | + source: {{ common_catalogsource_name }} |
| 146 | +{% endif %} |
| 147 | + - fileName: OadpOperatorStatus.yaml |
| 148 | + policyName: "{{ 'oadp-subs' if manyPolicies else 'subscriptions' }}-policy" |
| 149 | + |
| 150 | +{% else %} |
| 151 | + # - fileName: OadpSubscriptionNS.yaml |
| 152 | + # policyName: "subscriptions-policy" |
| 153 | + # - fileName: OadpSubscriptionOperGroup.yaml |
| 154 | + # policyName: "subscriptions-policy" |
| 155 | + # - fileName: OadpSubscription.yaml |
| 156 | + # policyName: "subscriptions-policy" |
| 157 | + # - fileName: OadpOperatorStatus.yaml |
| 158 | + # policyName: "subscriptions-policy" |
| 159 | + # |
| 160 | +{% endif %} |
| 161 | + - fileName: ReduceMonitoringFootprint.yaml |
| 162 | + policyName: "{{ 'monitoring-config' if manyPolicies else 'config' }}-policy" |
| 163 | +{% if rhacm_disconnected_registry and rhacm_disconnected_registry|length > 1 %} |
| 164 | + # |
| 165 | + # These CRs are in support of installation from a disconnected registry |
| 166 | + # |
| 167 | + - fileName: DefaultCatsrc.yaml |
| 168 | + policyName: "config-policy" |
| 169 | + # The Subscriptions all point to redhat-operators-disconnected. The OperatorHub CR |
| 170 | + # disables the defaults and this CR replaces redhat-operators-disconnected with a |
| 171 | + # CatalogSource pointing to the disconnected registry. Including both of |
| 172 | + # these in the same policy orders their application to the cluster. |
| 173 | + # Tip: for RH sources `image: registry.redhat.io/redhat/redhat-operator-index:v4.xx` |
| 174 | + metadata: |
| 175 | + name: {{ common_catalogsource_name }} |
| 176 | +{% if extraHubCommonTemplates %} |
| 177 | + annotations: |
| 178 | + {%- raw %} |
| 179 | + scale-test-label-1: '{{hub fromConfigMap "" "common-template-map" "key3" hub}}' |
| 180 | + scale-test-label-2: '{{hub fromConfigMap "" "common-template-map" "key4" hub}}' |
| 181 | + {%- endraw +%} |
| 182 | +{% endif %} |
| 183 | + labels: |
| 184 | + lca.openshift.io/target-ocp-version: "4.18.0" |
| 185 | + spec: |
| 186 | + displayName: disconnected-redhat-operators |
| 187 | + image: {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }}/{{ disconnected_operator_index_name }}:{{ operator_index_tag }} |
| 188 | + status: |
| 189 | + connectionState: |
| 190 | + lastObservedState: READY |
| 191 | + - fileName: DisconnectedICSP.yaml |
| 192 | + policyName: "config-policy" |
| 193 | + spec: |
| 194 | + repositoryDigestMirrors: |
| 195 | + - mirrors: |
| 196 | + - {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }} |
| 197 | + source: registry.redhat.io |
| 198 | + - mirrors: |
| 199 | + - {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }} |
| 200 | + source: brew.registry.redhat.io |
| 201 | + - mirrors: |
| 202 | + - {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }} |
| 203 | + source: registry-proxy.engineering.redhat.com |
| 204 | + - mirrors: |
| 205 | + - {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }}/ocp4/openshift4 |
| 206 | + source: quay.io/openshift-release-dev/ocp-v4.0-art-dev |
| 207 | + - mirrors: |
| 208 | + - {{ rhacm_disconnected_registry }}:{{ rhacm_disconnected_registry_port }}/ocp4/openshift4 |
| 209 | + source: quay.io/openshift-release-dev/ocp-release |
| 210 | +{% endif %} |
0 commit comments