mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 03:47:04 +01:00
102 lines
3.6 KiB
Plaintext
102 lines
3.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * scalability_and_performance/ztp_far_edge/ztp-manual-install.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="ztp-generating-install-and-config-crs-manually_{context}"]
|
|
= Extracting reference and example CRs from the ztp-site-generate container
|
|
|
|
Use the `ztp-site-generate` container to extract reference custom resources (CRs) and example `ClusterInstance` CRs to prepare for cluster installation and Day 2 configuration.
|
|
|
|
.Prerequisites
|
|
|
|
* You have installed the OpenShift CLI (`oc`).
|
|
|
|
* You have logged in to the hub cluster as a user with `cluster-admin` privileges.
|
|
|
|
* You installed `podman`.
|
|
|
|
.Procedure
|
|
|
|
. Create an output folder by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ mkdir -p ./out
|
|
----
|
|
|
|
. Log in to the Ecosystem container registry with your credentials by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ podman login registry.redhat.io
|
|
----
|
|
|
|
. Extract the reference and example CRs from the `ztp-site-generate` container image by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ 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
|
|
----
|
|
+
|
|
The `./out` directory contains the reference `{policy-gen-cr}` and `ClusterInstance` CRs in the `out/argocd/example/` folder.
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
out
|
|
└── argocd
|
|
└── example
|
|
├── acmpolicygenerator
|
|
│ ├── {policy-prefix}common-ranGen.yaml
|
|
│ ├── {policy-prefix}example-sno-site.yaml
|
|
│ ├── {policy-prefix}group-du-sno-ranGen.yaml
|
|
│ ├── ...
|
|
│ ├── kustomization.yaml
|
|
│ └── ns.yaml
|
|
└── clusterinstance
|
|
├── example-sno.yaml
|
|
├── example-3node.yaml
|
|
├── example-standard.yaml
|
|
└── ...
|
|
----
|
|
|
|
. Create a `ClusterInstance` CR for your cluster.
|
|
+
|
|
Use the example `ClusterInstance` CRs in the `out/argocd/example/clusterinstance/` folder that you previously extracted from the `ztp-site-generate` container as a reference. The folder includes example files for single node, three-node, and standard clusters:
|
|
+
|
|
* `example-sno.yaml`
|
|
* `example-3node.yaml`
|
|
* `example-standard.yaml`
|
|
+
|
|
Change the cluster and host details in the example file to match the type of cluster you want to install. For example:
|
|
+
|
|
.Example {sno} ClusterInstance CR
|
|
[source,yaml]
|
|
----
|
|
include::snippets/ztp_example-sno.yaml[]
|
|
----
|
|
+
|
|
[NOTE]
|
|
====
|
|
Optional: To provision additional install-time manifests on the provisioned cluster, create the extra manifest CRs and apply them to the hub cluster. Then reference them in the `extraManifestsRefs` field of the `ClusterInstance` CR. For more information, see "Customizing extra installation manifests in the {ztp} pipeline".
|
|
====
|
|
|
|
. Optional: Generate Day 2 configuration CRs from the reference `{policy-gen-cr}` CRs:
|
|
|
|
.. Create an output folder for the configuration CRs by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ mkdir -p ./ref
|
|
----
|
|
|
|
.. Generate the configuration CRs by running the following command:
|
|
+
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
$ podman run -it --rm -v `pwd`/out/argocd/example/policygentemplates:/resources:Z -v `pwd`/ref:/output:Z,U registry.redhat.io/openshift4/ztp-site-generate-rhel8:v{product-version} generator config -N . /output
|
|
----
|
|
+
|
|
The command generates example group and cluster-specific configuration CRs in the `./ref` folder. You can apply these CRs to the cluster after installation is complete.
|