mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
78 lines
3.1 KiB
Plaintext
78 lines
3.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * scalability_and_performance/ztp_far_edge/ztp-preparing-the-hub-cluster.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="ztp-configuring-hub-cluster-with-argocd_{context}"]
|
|
= Configuring the hub cluster with ArgoCD
|
|
|
|
You can configure the hub cluster with a set of ArgoCD applications that generate the required installation and policy custom resources (CRs) for each site with {ztp-first}.
|
|
|
|
[NOTE]
|
|
====
|
|
{rh-rhacm-first} uses `ClusterInstance` CRs to generate the Day 1 managed cluster installation CRs for ArgoCD. Each ArgoCD application can manage a maximum of 1000 `ClusterInstance` CRs.
|
|
====
|
|
|
|
.Prerequisites
|
|
|
|
* You have a {product-title} hub cluster with {rh-rhacm-first} and {gitops-title} installed.
|
|
|
|
* You have extracted the reference deployment from the {ztp} plugin container as described in the "Preparing the {ztp} site configuration repository" section. Extracting the reference deployment creates the `out/argocd/deployment` directory referenced in the following procedure.
|
|
|
|
.Procedure
|
|
|
|
. Prepare the ArgoCD pipeline configuration:
|
|
|
|
.. Create a Git repository with the directory structure similar to the example directory. For more information, see "Preparing the {ztp} site configuration repository".
|
|
|
|
.. Configure access to the repository using the ArgoCD UI. Under *Settings* configure the following:
|
|
|
|
*** *Repositories* - Add the connection information. The URL must end in `.git`, for example, `https://repo.example.com/repo.git` and credentials.
|
|
|
|
*** *Certificates* - Add the public certificate for the repository, if needed.
|
|
|
|
.. Modify the two ArgoCD applications, `out/argocd/deployment/clusters-app.yaml` and `out/argocd/deployment/policies-app.yaml`, based on your Git repository:
|
|
|
|
*** Update the URL to point to the Git repository. The URL ends with `.git`, for example, `https://repo.example.com/repo.git`.
|
|
|
|
*** The `targetRevision` indicates which Git repository branch to monitor.
|
|
|
|
*** `path` specifies the path to the `ClusterInstance` and `PolicyGenerator` or `PolicyGentemplate` CRs, respectively.
|
|
|
|
[start=2]
|
|
include::snippets/ztp-patch-argocd-hub-cluster.adoc[]
|
|
|
|
|
|
. Optional: If you have existing ArgoCD applications, verify that the `PrunePropagationPolicy=background` policy is set in the `Application` resource by running the following command:
|
|
+
|
|
--
|
|
[source,terminal]
|
|
----
|
|
$ oc -n openshift-gitops get applications.argoproj.io \
|
|
clusters -o jsonpath='{.spec.syncPolicy.syncOptions}' |jq
|
|
----
|
|
|
|
.Example output for an existing policy
|
|
[source,terminal]
|
|
----
|
|
[
|
|
"CreateNamespace=true",
|
|
"PrunePropagationPolicy=background",
|
|
"RespectIgnoreDifferences=true"
|
|
]
|
|
----
|
|
--
|
|
|
|
.. If the `spec.syncPolicy.syncOption` field does not contain a `PrunePropagationPolicy` parameter or `PrunePropagationPolicy` is set to the `foreground` value, set the policy to `background` in the `Application` resource. See the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
kind: Application
|
|
spec:
|
|
syncPolicy:
|
|
syncOptions:
|
|
- PrunePropagationPolicy=background
|
|
----
|
|
|
|
+
|
|
Setting the `background` deletion policy ensures that the `ManagedCluster` CR and all its associated resources are deleted. |