Preparing the GitOps ZTP site configuration repository
Before you can use the GitOps Zero Touch Provisioning (ZTP) pipeline, you need to prepare the Git repository to host the site configuration data.
-
You have configured the hub cluster GitOps applications for generating the required installation and policy custom resources (CRs).
-
You have deployed the managed clusters using GitOps ZTP.
-
Create a directory structure with separate paths for the
ClusterInstanceandPolicyGeneratororPolicyGentemplateCRs.Keep
ClusterInstanceandPolicyGeneratororPolicyGentemplateCRs in separate directories. Both theClusterInstanceandPolicyGeneratororPolicyGentemplatedirectories must contain akustomization.yamlfile that explicitly includes the files in that directory. -
Export the
argocddirectory from theztp-site-generatecontainer image using the following commands:$ podman pull registry.redhat.io/openshift4/ztp-site-generate-rhel8:v{product-version}$ mkdir -p ./out$ podman run --log-driver=none --rm registry.redhat.io/openshift4/ztp-site-generate-rhel8:v{product-version} extract /home/ztp --tar | tar x -C ./out -
Check that the
outdirectory contains the following subdirectories:-
out/extra-manifestcontains the source CR files that you use to create extra manifestConfigMapresources through theconfigMapGeneratorin thekustomization.yamlfile. TheClusterInstanceCR references theseConfigMapresources using theextraManifestsRefsfield. -
out/source-crscontains the source CR files thatPolicyGeneratoruses to generate the Red Hat Advanced Cluster Management (RHACM) policies. -
out/argocd/deploymentcontains patches and YAML files to apply on the hub cluster for use in the next step of this procedure. -
out/argocd/example/clusterinstancecontains the examples forClusterInstanceandPolicyGeneratororPolicyGentemplatefiles that represent the recommended configuration.
-
-
Copy the
out/source-crsfolder and contents to thePolicyGeneratororPolicyGentemplatedirectory. -
The out/extra-manifests directory contains the reference manifests for a RAN DU cluster. Copy the
out/extra-manifestsdirectory into theClusterInstancefolder. This directory should contain CRs from theztp-site-generatecontainer only. Do not add user-provided CRs here. If you want to work with user-provided CRs you must create another directory for that content. For example:example/ ├── acmpolicygenerator │ ├── kustomization.yaml │ └── source-crs/ ├── policygentemplates │ ├── kustomization.yaml │ └── source-crs/ └── clusterinstance ├── extra-manifests └── kustomization.yamlUsing
PolicyGenTemplateCRs to manage and deploy policies to manage clusters will be deprecated in a future OpenShift Container Platform release. Equivalent and improved functionality is available by using Red Hat Advanced Cluster Management (RHACM) andPolicyGeneratorCRs. -
Commit the directory structure and the
kustomization.yamlfiles and push to your Git repository. The initial push to Git should include thekustomization.yamlfiles.You can use the directory structure under
out/argocd/exampleas a reference for the structure and content of your Git repository. That structure includesClusterInstanceandPolicyGeneratororPolicyGentemplatereference CRs for single-node, three-node, and standard clusters. Remove references to cluster types that you are not using.For all cluster types, you must:
-
Add the
source-crssubdirectory to theacmpolicygeneratororpolicygentemplatesdirectory. -
Add the
extra-manifestsdirectory to theclusterinstancedirectory.The following example describes a set of CRs for a network of single-node clusters:
example/ ├── acmpolicygenerator │ ├── acm-common-ranGen.yaml │ ├── acm-example-sno-site.yaml │ ├── acm-group-du-sno-ranGen.yaml │ ├── group-du-sno-validator-ranGen.yaml │ ├── kustomization.yaml │ ├── source-crs/ │ └── ns.yaml └── clusterinstance ├── example-sno.yaml ├── extra-manifests/ ├── custom-manifests/ ├── KlusterletAddonConfigOverride.yaml └── kustomization.yamlwhere:
extra-manifests/-
Contains reference manifests from the
ztp-container. custom-manifests/-
Contains custom manifests.
-