1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/ztp-customizing-the-install-extra-manifests.adoc
2026-01-28 14:11:54 +00:00

81 lines
3.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * scalability_and_performance/ztp_far_edge/ztp-advanced-install-ztp.adoc
:_module-type: PROCEDURE
[id="ztp-customizing-the-install-extra-manifests_{context}"]
= Customizing extra installation manifests in the {ztp} pipeline
You can define a set of extra manifests for inclusion in the installation phase of the {ztp-first} pipeline. These manifests are linked to the `ClusterInstance` custom resources (CRs) and are applied to the cluster during installation. Including `MachineConfig` CRs at install time makes the installation process more efficient.
Extra manifests must be packaged in `ConfigMap` resources and referenced in the `extraManifestsRefs` field of the `ClusterInstance` CR.
.Prerequisites
* Create 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.
.Procedure
. Create a set of extra manifest CRs that the {ztp} pipeline uses to customize the cluster installs.
. In your `/clusterinstance` directory, create a subdirectory with your extra manifests. The following example illustrates a sample folder structure:
+
[source,text]
----
clusterinstance/
├── site1-sno-du.yaml
├── extra-manifest/
│ ├── 01-example-machine-config.yaml
│ ├── enable-crun-master.yaml
│ └── enable-crun-worker.yaml
└── kustomization.yaml
----
. Create or update the `kustomization.yaml` file to use `configMapGenerator` to package your extra manifests into a `ConfigMap`:
+
[source,yaml]
----
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- site1-sno-du.yaml
configMapGenerator:
- name: extra-manifests-cm
namespace: site1-sno-du <1>
files:
- extra-manifest/01-example-machine-config.yaml
- extra-manifest/enable-crun-master.yaml
- extra-manifest/enable-crun-worker.yaml
generatorOptions:
disableNameSuffixHash: true <2>
----
<1> The namespace must match the `ClusterInstance` namespace.
<2> Disables the hash suffix so the `ConfigMap` name is predictable.
. In your `ClusterInstance` CR, reference the `ConfigMap` in the `extraManifestsRefs` field:
+
[source,yaml]
----
apiVersion: siteconfig.open-cluster-management.io/v1alpha1
kind: ClusterInstance
metadata:
name: "site1-sno-du"
namespace: "site1-sno-du"
spec:
clusterName: "site1-sno-du"
networkType: "OVNKubernetes"
extraManifestsRefs:
- name: extra-manifests-cm <1>
# ...
----
<1> Reference to the `ConfigMap` containing the extra manifests.
. Commit the `ClusterInstance` CR, extra manifest files, and `kustomization.yaml` to your Git repository and push the changes.
During cluster provisioning, the SiteConfig Operator applies the CRs contained in the referenced `ConfigMap` resources as extra manifests.
[NOTE]
====
You can reference multiple `ConfigMap` resources in `extraManifestsRefs` to organize your manifests logically. For example, you might have separate `ConfigMap` resources for crun configuration, custom `MachineConfig` CRs, and other Day 0 configurations.
====