Skip to content

Latest commit

 

History

History
107 lines (88 loc) · 7.27 KB

File metadata and controls

107 lines (88 loc) · 7.27 KB

Preparing GitOps repository

Repository layout

This guide describes the Git repository content required by the O‑Cloud Manager to deploy and configure a cluster. We recommend organizing the repo as follows. For concrete examples, see the sample content under git-setup.

Recommended layout:

git-root/
  clustertemplates/
    hardwareprofiles/                   # HardwareProfile CRs for hardware provisioning
    hardwaretemplates/                  # HardwareTemplate CRs for hardware provisioning
    inventory/                          # BareMetalHost inventory for sites
    version_4.Y.Z/                      # Version matches the OCP version to be installed
      sno-ran-du/
        clusterinstance-defaults-*.yaml # Defaults in ConfigMap for Cluster installation
        policytemplates-defaults-*.yaml # Defaults in ConfigMap for ACM policy configuration
        pull-secret.yaml                # Pull secret used for spoke installation
        extra-manifest/                 # Extra manifests installed on day0
        ns.yaml                         # Namespace where the ClusterTemplate is created
        sno-ran-du-v4-Y-Z-*.yaml        # ClusterTemplate(s) for this OCP version
    version_4.Y.Z+1/                    # Optional upgrade content
  policytemplates/
    version_4.Y.Z/                      # Version matches the OCP version to be installed
      sno-ran-du/
        ns.yaml                         # Namespace where policies are created
        msc-binding.yaml                # ManagedClusterSetBinding for policy placement
        sno-ran-du-pg-v4-Y-Z-*.yaml     # ACM PolicyGenerator(s) for this OCP version
      source-crs/                       # ZTP source CRs; keep in sync with OCP version
    version_4.Y.Z+1/                    # Optional upgrade content

Notes

  • Keep content versioned by OCP release using the version_4.Y.Z/ folders so templates and policies align with the target OCP.
  • The content of the extra-manifest directory should be copied over from the cnf-features-deploy extra-manifest repo or extracted from the ztp-site-generate container.
    • ArgoCD will assemble all the extra-manifests into a ConfigMap.
  • The content of the source-crs directory should be copied over from the cnf-features-deploy source-crs repo or extracted from the ztp-site-generate container.
    • The ACM PGs will reference the source CRs to generate the ACM Policies that will be applied on the spoke cluster(s).
  • Make sure to bring over the extra-manifest and source-crs corresponding to the OCP release provided in the ClusterTemplate CR.
  • ACM policies must be created under the namespace ztp-<cluster-template-namespace>. See the example.
  • In the ACM PGs, set policyAnnotations to include the annotation clustertemplates.clcm.openshift.io/templates with a comma-separated list of ClusterTemplates that PG is associated with. Use the ClusterTemplate metadata.name for each entry. This annotation is propagated to each generated root Policy. It enables the O‑Cloud Manager to identify which root policies are associated with the ClusterTemplate used by a ProvisioningRequest, determine the expected child policies, and accurately detect when configuration is complete - ensuring correct provisioning status reporting during Day-2 policy configuration changes. See the example.

Full DU profile

For configuring an SNO with a full DU profile according to the 4.19 RAN RDS, the following main samples can be used as a starting example:

Preparation of ArgoCD applications

Preparing the ArgoCD applications for provisioning clusters through the O-Cloud Manager is similar to the ZTP apporach, with the following distinctions:

  • The source path for the ArgoCD Application clusters should point to the clustertemplates directory. Additionally, configure spec.ignoreDifferences for the BareMetalHost kind to ignore the following fields:
spec:
  ignoreDifferences:
  - group: metal3.io
    jsonPointers:
    - /spec/preprovisioningNetworkDataName
    - /spec/online
    kind: BareMetalHost
  • The source path for the ArgoCD Application policies should point to the policytemplates directory.

  • The following additional CRDs should be added to the AppProject, under spec.clusterResourceWhitelist:

  - group: clcm.openshift.io
    kind: ClusterTemplate
  - group: clcm.openshift.io
    kind: HardwareProfile
  - group: clcm.openshift.io
    kind: HardwareTemplate