|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// scalability_and_performance/ztp-deploying-disconnected.adoc |
| 4 | + |
| 5 | +:_module-type: PROCEDURE |
| 6 | +[id="ztp-filtering-ai-crs-using-siteconfig_{context}"] |
| 7 | += Filtering custom resources using SiteConfig filters |
| 8 | + |
| 9 | +By using filters, you can easily customize `SiteConfig` custom resources (CRs) to include or exclude other CRs for use in the installation phase of the zero touch provisioning (ZTP) GitOps pipeline. |
| 10 | + |
| 11 | +You can specify an `inclusionDefault` value of `include` or `exclude` for the `SiteConfig` CR, along with a list of the specific `extraManifest` RAN CRs that you want to include or exclude. Setting `inclusionDefault` to `include` makes the ZTP pipeline apply all the files in `/source-crs/extra-manifest` during installation. Setting `inclusionDefault` to `exclude` does the opposite. |
| 12 | + |
| 13 | +You can exclude individual CRs from the `/source-crs/extra-manifest` folder that are otherwise included by default. The following example configures a custom {sno} `SiteConfig` CR to exclude the `/source-crs/extra-manifest/03-sctp-machine-config-worker.yaml` CR at installation time. |
| 14 | + |
| 15 | +Some additional optional filtering scenarios are also described. |
| 16 | + |
| 17 | +.Prerequisites |
| 18 | + |
| 19 | +* You configured the hub cluster for generating the required installation and policy CRs. |
| 20 | +
|
| 21 | +* You created a Git repository where you manage your custom site configuration data. The repository must be accessible from the hub cluster and be defined as a source repository for the Argo CD application. |
| 22 | +
|
| 23 | +.Procedure |
| 24 | + |
| 25 | +. To prevent the ZTP pipeline from applying the `03-sctp-machine-config-worker.yaml` CR file, apply the following YAML in the `SiteConfig` CR: |
| 26 | ++ |
| 27 | +[source,yaml,subs="attributes+"] |
| 28 | +---- |
| 29 | +apiVersion: ran.openshift.io/v1 |
| 30 | +kind: SiteConfig |
| 31 | +metadata: |
| 32 | + name: "site1-sno-du" |
| 33 | + namespace: "site1-sno-du" |
| 34 | +spec: |
| 35 | + baseDomain: "example.com" |
| 36 | + pullSecretRef: |
| 37 | + name: "assisted-deployment-pull-secret" |
| 38 | + clusterImageSetNameRef: "openshift-{product-version}" |
| 39 | + sshPublicKey: "<ssh_public_key>" |
| 40 | + clusters: |
| 41 | +- clusterName: "site1-sno-du" |
| 42 | + extraManifests: |
| 43 | + filter: |
| 44 | + exclude: |
| 45 | + - 03-sctp-machine-config-worker.yaml |
| 46 | +---- |
| 47 | ++ |
| 48 | +The ZTP pipeline skips the `03-sctp-machine-config-worker.yaml` CR during installation. All other CRs in `/source-crs/extra-manifest` are applied. |
| 49 | + |
| 50 | +. Save the `SiteConfig` CR and and push the changes to the site configuration repository. |
| 51 | ++ |
| 52 | +The ZTP pipeline monitors and adjusts what CRs it applies based on the `SiteConfig` filter instructions. |
| 53 | + |
| 54 | +. Optional: To prevent the ZTP pipeline from applying all the `/source-crs/extra-manifest` CRs during cluster installation, apply the following YAML in the `SiteConfig` CR: |
| 55 | ++ |
| 56 | +[source,yaml] |
| 57 | +---- |
| 58 | +- clusterName: "site1-sno-du" |
| 59 | + extraManifests: |
| 60 | + filter: |
| 61 | + inclusionDefault: exclude |
| 62 | +---- |
| 63 | +
|
| 64 | +. Optional: To exclude all the `/source-crs/extra-manifest` RAN CRs and instead include a custom CR file during installation, edit the custom `SiteConfig` CR to set the custom manifests folder and the `include` file, for example: |
| 65 | ++ |
| 66 | +[source,yaml,subs="attributes+"] |
| 67 | +---- |
| 68 | +clusters: |
| 69 | +- clusterName: "site1-sno-du" |
| 70 | + extraManifestPath: "<custom_manifest_folder>" <1> |
| 71 | + extraManifests: |
| 72 | + filter: |
| 73 | + inclusionDefault: exclude <2> |
| 74 | + include: |
| 75 | + - custom-sctp-machine-config-worker.yaml |
| 76 | +---- |
| 77 | +<1> Replace `<custom_manifest_folder>` with the name of the folder that contains the custom installation CRs, for example, `user-custom-manifest/`. |
| 78 | +<2> Set `inclusionDefault` to `exclude` to prevent the ZTP pipeline from applying the files in `/source-crs/extra-manifest` during installation. |
| 79 | ++ |
| 80 | +The following example illustrates the custom folder structure: |
| 81 | ++ |
| 82 | +[source,text] |
| 83 | +---- |
| 84 | +siteconfig |
| 85 | + ├── site1-sno-du.yaml |
| 86 | + └── user-custom-manifest |
| 87 | + └── custom-sctp-machine-config-worker.yaml |
| 88 | +---- |
0 commit comments