<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>GitOps – TechBlog about OpenShift/Ansible/Satellite and much more</title><link>https://blog.stderr.at/categories/gitops/</link><description>TechBlog about OpenShift/Ansible/Satellite and much more</description><generator>Hugo 0.164.0</generator><language>en-us</language><copyright>Toni Schmidbauer &amp; Thomas Jungbauer</copyright><lastBuildDate>Sat, 24 Oct 2026 00:00:00 +0200</lastBuildDate><atom:link href="https://blog.stderr.at/categories/gitops/index.xml" rel="self" type="application/rss+xml"/><item><title>[Ep.20] Managing ACM Policies with OpenShift GitOps</title><link>https://blog.stderr.at/gitopscollection/2026-10-24-acm-policies-with-gitops/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-10-24-acm-policies-with-gitops/</guid><pubDate>Sat, 24 Oct 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><category>Security</category><description>Policies as code: let OpenShift GitOps deploy Advanced Cluster Management policies from Git, generate them with the PolicyGenerator, use hub templates for per-cluster values and bootstrap Argo CD on every new cluster with a policy.</description><content:encoded><![CDATA[<div class="paragraph">
<p>In <a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">[Ep.18]</a> I recommended ACM policies for the audited baseline of a cluster and Argo CD for everything that needs rendering. <a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">[Ep.19]</a> showed how ACM feeds Argo CD with clusters and the different models that can be used in Argo CD. This part turns the integration around: <strong>Argo CD deploys ACM policies</strong>, and a policy <strong>bootstraps Argo CD</strong> on every new cluster.</p>
</div>
<div class="paragraph">
<p>The result is a setup where the policies live in Git, are reviewed in pull requests like any other change, and ACM does what it is good at: distribution, enforcement and compliance reporting.</p>
</div>
<div class="paragraph">
<p>The topic turned out to be too big for a single article, so I have split it into multiple parts and maybe I should have split into even more. This is the third:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">[Ep.18] OpenShift GitOps or Advanced Cluster Management? Choosing the right tool</a> What each tool does, where they overlap and a decision guide.</p>
</li>
<li>
<p><a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">[Ep.19] ACM and OpenShift GitOps: push, pull and the Argo CD Agent</a>: how ACM registers clusters in Argo CD, and how to set up each of the three delivery models.</p>
</li>
<li>
<p><strong>[Ep.20] Managing ACM Policies with OpenShift GitOps</strong> (this article): policies as code, the PolicyGenerator, hub templates and bootstrapping Argo CD with a policy.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Everything in this series was written against <strong>OpenShift GitOps 1.22</strong> (Argo CD 3.5) and <strong>Advanced Cluster Management 2.17</strong> (Open Cluster Management). Technology Preview and GA states move quickly in both products, so check the release notes of your versions before you commit to a design.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
While I am using the term &#34;Advanced Cluster Management&#34; in this article, I am referring to the product formerly known as Open Cluster Management. Same counts for Argo CD and OpenShift GitOps.
</td>
</tr>
</tbody></table>
</div>
<div class="sect1">
<h2 id="_three_integration_patterns">Three integration patterns</h2>
<div class="sectionbody">
<div class="paragraph">
<p>There are three ways to combine policies and Argo CD. They are not exclusive, most mature setups combine the first two.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 12.5%;"/>
<col style="width: 37.5%;"/>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Pattern</th>
<th class="tableblock halign-left valign-top">How it works</th>
<th class="tableblock halign-left valign-top">Strength</th>
<th class="tableblock halign-left valign-top">Weakness</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>A: Argo CD deploys policies</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies live in Git, generated by the PolicyGenerator. The hub Argo CD syncs them to the hub, ACM propagates and evaluates them.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policy as code with review, compliance dashboard in ACM</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Needs the PolicyGenerator plugin in Argo CD</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>B: A policy bootstraps Argo CD</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One enforced policy installs OpenShift GitOps and a root Application on every placed cluster. From there, Argo CD takes over.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">New clusters configure themselves on import</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The bootstrap needs proper planning and automation.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>C: Policies configure directly</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ConfigurationPolicies apply the cluster configuration themselves. No Argo CD on the spokes.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One tool, compliance built in</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Weaker diff and ordering, large YAML in policies</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Pattern C is fine for small, compliance-driven setups. For everything else I recommend A for governance and B for the fleet bootstrap. The rest of this article shows both.</p>
</div>
<div class="paragraph">
<p>Whatever option you choose, one rule from <a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">Ep.18</a> still applies: <strong>one owner per object</strong>. If Argo CD manages an object, a policy may only look at it in <code>inform</code> mode.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_preparing_the_hub_argo_cd">Preparing the hub Argo CD</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You need an Argo CD instance on the hub that can sync to the hub itself. That instance needs three things before it can deploy policies:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>permissions for the policy API,</p>
</li>
<li>
<p>the PolicyGenerator plugin,</p>
</li>
<li>
<p>optionally, health checks for policies.</p>
</li>
</ol>
</div>
<div class="sect2">
<h3 id="_a_second_argo_cd_instance_for_the_hub">A second Argo CD instance for the hub</h3>
<div class="paragraph">
<p>In Ep.19, the default instance <code>openshift-gitops</code> became the principal of the Argo CD Agent. Its application-controller is disabled, so it cannot sync anything to the hub itself, and the manifests of agent Applications are rendered on the managed clusters anyway. The policies, however, must be created on the hub.</p>
</div>
<div class="paragraph">
<p>This article therefore uses a second, small Argo CD instance on the hub that only takes care of the hub configuration: <code>policy-gitops</code> in the namespace of the same name. If your default instance still has its application-controller (push or pull model), you can use it instead. Replace <code>policy-gitops</code> with <code>openshift-gitops</code> in the examples below.</p>
</div>
<div class="listingblock linenums">
<div class="title">Second Argo CD instance for the hub configuration</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Namespace
metadata:
  name: policy-gitops
---
apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: policy-gitops <i class="conum" data-value="1"></i><b>(1)</b>
  namespace: policy-gitops
spec: {} <i class="conum" data-value="2"></i><b>(2)</b>
---
apiVersion: v1
kind: Namespace
metadata:
  name: acm-policies
  labels:
    argocd.argoproj.io/managed-by: policy-gitops <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The service account of the application-controller is named after the instance: <code>policy-gitops-argocd-application-controller</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The PolicyGenerator plugin is added in the next sections.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>policy-gitops</code> is a namespace-scoped instance. The label allows it to manage the namespace <code>acm-policies</code>, where the policies live. The namespace must exist before the first sync, because the instance cannot create namespaces itself.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_permissions">Permissions</h3>
<div class="paragraph">
<p>The application-controller of the instance cannot create policies and Placements. Create a ClusterRole and bind it to the controller’s service account:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Not required if Argo CD runs as cluster-admin.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">ClusterRole and ClusterRoleBinding for the hub Argo CD</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openshift-gitops-policy-admin
rules:
  - apiGroups:
      - policy.open-cluster-management.io
    resources:
      - policies
      - configurationpolicies
      - certificatepolicies
      - operatorpolicies
      - policysets
      - placementbindings
    verbs: [&#34;get&#34;, &#34;list&#34;, &#34;watch&#34;, &#34;create&#34;, &#34;update&#34;, &#34;patch&#34;, &#34;delete&#34;]
  - apiGroups:
      - cluster.open-cluster-management.io
    resources:
      - placements
      - placements/status
      - placementdecisions
      - placementdecisions/status
    verbs: [&#34;get&#34;, &#34;list&#34;, &#34;watch&#34;, &#34;create&#34;, &#34;update&#34;, &#34;patch&#34;, &#34;delete&#34;]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: policy-gitops-policy-admin
subjects:
  - kind: ServiceAccount
    name: policy-gitops-argocd-application-controller
    namespace: policy-gitops
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: openshift-gitops-policy-admin</code></pre>
</div>
</div>
<div class="paragraph">
<p>The ClusterRole in the ACM documentation also contains <code>placementrules</code>. I left them out on purpose: PlacementRules are deprecated.</p>
</div>
</div>
<div class="sect2">
<h3 id="_the_policygenerator_plugin">The PolicyGenerator plugin</h3>
<div class="paragraph">
<p>Creating the policy YAML by hand is tough and error-prone. Every manifest has to be wrapped in a ConfigurationPolicy, which is wrapped in a Policy, which needs a Placement and a PlacementBinding. The <strong>PolicyGenerator</strong> solves this. It is a Kustomize generator plugin that takes plain manifests and wraps them for you.</p>
</div>
<div class="paragraph">
<p>The plugin is not part of the OpenShift GitOps images. An init container copies it from an ACM image into the repo-server, and Kustomize must be allowed to run alpha plugins.</p>
</div>
<div class="paragraph">
<p>The setup is described in the ACM documentation: <a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17/html/gitops/gitops-overview#access-policy-gen-gitops" rel="noopener" target="_blank">ACM 2.17: Accessing the Policy Generator from OpenShift GitOps</a>.</p>
</div>
<div class="listingblock linenums">
<div class="title">ArgoCD resource on the hub with the PolicyGenerator plugin (excerpt)</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: policy-gitops
  namespace: policy-gitops
spec:
  kustomizeBuildOptions: --enable-alpha-plugins <i class="conum" data-value="1"></i><b>(1)</b>
  repo:
    env:
      - name: KUSTOMIZE_PLUGIN_HOME
        value: /etc/kustomize/plugin
    initContainers:
      - name: policy-generator-install
        image: registry.redhat.io/rhacm2/multicluster-operators-subscription-rhel9:v2.17 <i class="conum" data-value="2"></i><b>(2)</b>
        command:
          - /bin/bash
        args:
          - -c
          - cp /policy-generator/PolicyGenerator-not-fips-compliant /policy-generator-tmp/PolicyGenerator <i class="conum" data-value="3"></i><b>(3)</b>
        volumeMounts:
          - mountPath: /policy-generator-tmp
            name: policy-generator
    volumeMounts:
      - mountPath: /etc/kustomize/plugin/policy.open-cluster-management.io/v1/policygenerator
        name: policy-generator
    volumes:
      - name: policy-generator
        emptyDir: {}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Allows Kustomize to execute the generator plugin.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The tag must match the minor version of your ACM hub (<code>oc get multiclusterhub -n open-cluster-management -o jsonpath=&#39;{.items[0].status.currentVersion}&#39;</code>). Update it after every hub upgrade, or let a policy do it (see <a href="#_keeping_the_image_tag_in_sync">Keeping the image tag in sync</a>).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Copies the plugin from the image to the plugin directory.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>If your policy folders contain Helm charts that should be rendered before the policies are generated, add the environment variable <code>POLICY_GEN_ENABLE_HELM</code> with the value <code>&#34;true&#34;</code> to <code>spec.repo.env</code>.</p>
</div>
<div class="sect3">
<h4 id="_keeping_the_image_tag_in_sync">Keeping the image tag in sync</h4>
<div class="paragraph">
<p>A fixed tag has one weakness: after a hub upgrade, the PolicyGenerator in the repo-server is still the old one until somebody updates the tag. The ACM documentation provides an example of a policy that keeps the image tag in sync. After an upgrade of the hub, the policy changes the image of the init container automatically.</p>
</div>
<div class="paragraph">
<p>The policy runs on the hub only, so it needs a Placement for <code>local-cluster</code>. The hub carries the label <code>local-cluster=true</code>, and it is part of the cluster set <code>global</code>, which must be bound to the policy namespace:</p>
</div>
<div class="listingblock linenums">
<div class="title">Policy that keeps the PolicyGenerator image in sync with the hub</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
  name: global
  namespace: acm-policies
spec:
  clusterSet: global <i class="conum" data-value="1"></i><b>(1)</b>
---
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: argocd-policy-generator
  namespace: acm-policies
  annotations:
    policy.open-cluster-management.io/standards: NIST SP 800-53
    policy.open-cluster-management.io/categories: CM Configuration Management
    policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
spec:
  remediationAction: enforce <i class="conum" data-value="2"></i><b>(2)</b>
  disabled: false
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: argocd-policy-generator
        spec:
          severity: medium
          object-templates:
            - complianceType: musthave
              objectDefinition:
                apiVersion: argoproj.io/v1beta1
                kind: ArgoCD
                metadata:
                  name: policy-gitops
                  namespace: policy-gitops
                spec:
                  kustomizeBuildOptions: --enable-alpha-plugins
                  repo:
                    env:
                      - name: KUSTOMIZE_PLUGIN_HOME
                        value: /etc/kustomize/plugin
                    initContainers:
                      - name: policy-generator-install
                        image: &#39;{{ (index (lookup &#34;apps/v1&#34; &#34;Deployment&#34; &#34;open-cluster-management&#34; &#34;multicluster-operators-hub-subscription&#34;).spec.template.spec.containers 0).image }}&#39; <i class="conum" data-value="3"></i><b>(3)</b>
                        command:
                          - /bin/bash
                        args:
                          - -c
                          - cp /policy-generator/PolicyGenerator-not-fips-compliant /policy-generator-tmp/PolicyGenerator
                        volumeMounts:
                          - mountPath: /policy-generator-tmp
                            name: policy-generator
                    volumeMounts:
                      - mountPath: /etc/kustomize/plugin/policy.open-cluster-management.io/v1/policygenerator
                        name: policy-generator
                    volumes:
                      - name: policy-generator
                        emptyDir: {}
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: hub-only
  namespace: acm-policies
spec:
  clusterSets:
    - global
  predicates:
    - requiredClusterSelector:
        labelSelector:
          matchLabels:
            local-cluster: &#34;true&#34; <i class="conum" data-value="4"></i><b>(4)</b>
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding
metadata:
  name: argocd-policy-generator
  namespace: acm-policies
placementRef:
  apiGroup: cluster.open-cluster-management.io
  kind: Placement
  name: hub-only
subjects:
  - apiGroup: policy.open-cluster-management.io
    kind: Policy
    name: argocd-policy-generator</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The cluster set <code>global</code> contains every managed cluster, including the hub. The Placement below narrows it down to the hub. Creating a ManagedClusterSetBinding requires the permissions <code>managedclustersetbindings</code> and <code>managedclustersets/bind</code>, which are not part of the ClusterRole above. Create it once as cluster administrator, or extend the ClusterRole if Argo CD shall sync it.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>We enforce this policy.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>lookup</code> reads the deployment of the ACM subscription controller, and the template takes the image of its first container. That is exactly the image the init container needs, in the version of the running hub.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>ACM sets this label on the hub’s own ManagedCluster.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Two things to keep in mind:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Write this policy as plain YAML</strong>, not as PolicyGenerator input. It installs the generator, so it cannot depend on it (hen-egg problem). Argo CD can sync it from Git without the plugin.</p>
</li>
<li>
<p><strong>One owner per object.</strong> The policy now manages the plugin part of the ArgoCD resource <code>policy-gitops</code>. If that resource is also deployed by Argo CD (for example, from a Helm chart for OpenShift GitOps), remove the plugin settings from there, or the two will overwrite each other.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_policy_health_in_argo_cd">Policy health in Argo CD</h3>
<div class="paragraph">
<p>By default, Argo CD considers a policy healthy as soon as it exists. That is not very useful: you want to see in Argo CD whether the policy is <strong>compliant</strong>. The policy collection of the Open Cluster Management project contains a policy that adds the matching health checks (<code>resourceHealthChecks</code>) to the ArgoCD resource: <a href="https://github.com/open-cluster-management-io/policy-collection/blob/main/stable/CM-Configuration-Management/argocd-policy-healthchecks.yaml" rel="noopener" target="_blank">argocd-policy-healthchecks.yaml</a>. The policy adds the health checks to every ArgoCD instance it finds on the cluster, so <code>policy-gitops</code> is covered as well. It is shipped with <code>remediationAction: inform</code>: set it to <code>enforce</code>, otherwise it only reports the missing health checks. After that, Argo CD shows a non-compliant policy as <strong>Degraded</strong>.</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pattern_a_policies_as_code">Pattern A: policies as code</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Pattern A is the governance part of the integration: the policies live in Git, Argo CD on the hub brings them into the cluster, and ACM does the rest. You never create a policy in the ACM console or with <code>oc apply</code> again. Every change is a pull request, and the history of your compliance is stored in Git.</p>
</div>
<div class="paragraph">
<p>The example in this section builds two policies that show both sides of a policy:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>service-mesh</strong> installs Red Hat OpenShift Service Mesh 3 on the selected clusters: the Operator and a control plane. It is <em>enforced</em> and the manifests are applied in a fixed order, because the control plane resources can only be created after the Operator has installed its CRDs.</p>
</li>
<li>
<p><strong>no-kubeadmin</strong> checks that the <code>kubeadmin</code> secret does not exist anymore. It only <em>informs</em>: ACM reports every cluster where the secret is still present, but nothing is deleted automatically.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Both start as plain Kubernetes manifests in Git. The PolicyGenerator wraps them into Policy, Placement and PlacementBinding, so you do not have to write the policy structure yourself.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This requires the hub Argo CD instance <code>policy-gitops</code> with the PolicyGenerator plugin, as described in the previous section.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following diagram shows the complete flow, from Git to the compliance status in ACM and Argo CD:</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg width="1400" height="680" viewBox="0 0 1400 680" role="img" aria-label="Policies as code: the hub Argo CD renders Policy, Placement and PlacementBinding from Git into the namespace acm-policies. ACM propagates a replicated policy per selected cluster, the policy framework on the managed cluster evaluates and enforces it, and the compliance status flows back to the ACM governance view and, with health checks, to Argo CD." version="1.1" id="as95c1e90-svg-policies-as-code" xmlns="http://www.w3.org/2000/svg" xmlns:c2pa="http://c2pa.org/manifest">
  <title id="as95c1e90-title-policies-as-code">Policies as code: the hub Argo CD renders Policy, Placement and PlacementBinding from Git into the namespace acm-policies. ACM propagates a replicated policy per selected cluster, the policy framework on the managed cluster evaluates and enforces it, and the compliance status flows back to the ACM governance view and, with health checks, to Argo CD.</title>
  <defs id="as95c1e90-defs-policies-as-code">
    <marker id="as95c1e90-arrow-0F766E" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#0F766E" id="as95c1e90-marker-path-0F766E" /></marker>
    <marker id="as95c1e90-arrow-C2410C" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#C2410C" id="as95c1e90-marker-path-C2410C" /></marker>
    <marker id="as95c1e90-arrow-4B5563" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#4B5563" id="as95c1e90-marker-path-4B5563" /></marker>
    </defs>
  <rect id="as95c1e90-bg" width="1400" height="680" fill="#FFFFFF" />
  <rect id="as95c1e90-zone-git" x="20" y="20" width="210" height="400" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="as95c1e90-label-git" x="40" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">GIT</text>
  <rect id="as95c1e90-zone-hub" x="250" y="20" width="1130" height="400" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="as95c1e90-label-hub" x="270" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">HUB</text>
  <rect id="as95c1e90-zone-spoke" x="250" y="450" width="1130" height="190" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="as95c1e90-label-spoke" x="270" y="478" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">MANAGED CLUSTERS  ·  bm, sno</text>
  <rect id="as95c1e90-ns-gitops" x="270" y="60" width="290" height="340" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="as95c1e90-label-ns-gitops" x="286" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#C2410C" text-anchor="start">openshift-gitops</text>
  <rect id="as95c1e90-ns-policies" x="580" y="60" width="320" height="340" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="as95c1e90-label-ns-policies" x="596" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#0F766E" text-anchor="start">acm-policies</text>
  <rect id="as95c1e90-ns-cluster" x="920" y="60" width="440" height="340" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="as95c1e90-label-ns-cluster" x="936" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">cluster namespaces  ·  bm, sno</text>
  <rect id="as95c1e90-rect-git" x="40" y="100" width="170" height="120" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as95c1e90-title-git" x="56" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Git</text>
  <text id="as95c1e90-line0-git" x="56" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">input/: plain</text>
  <text id="as95c1e90-line1-git" x="56" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">manifests, plus the</text>
  <text id="as95c1e90-line2-git" x="56" y="184" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">generator config</text>
  <text id="as95c1e90-note-git1" x="40" y="250" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">Every policy change</text>
  <text id="as95c1e90-note-git2" x="40" y="266" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">is a pull request.</text>
  <rect id="as95c1e90-rect-argocd" x="290" y="100" width="250" height="120" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="as95c1e90-title-argocd" x="306" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">hub Argo CD</text>
  <text id="as95c1e90-line0-argocd" x="306" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">renders the policies</text>
  <text id="as95c1e90-line1-argocd" x="306" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">(PolicyGenerator plugin</text>
  <text id="as95c1e90-line2-argocd" x="306" y="184" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">or Helm chart) and syncs</text>
  <circle id="as95c1e90-badge-1" cx="520" cy="120" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-1-text" x="520" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
  <rect id="as95c1e90-rect-policies" x="600" y="100" width="280" height="120" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as95c1e90-title-policies" x="616" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Policies</text>
  <text id="as95c1e90-line0-policies" x="616" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">Policy, Placement,</text>
  <text id="as95c1e90-line1-policies" x="616" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4B5563" text-anchor="start">PlacementBinding</text>
  <text id="as95c1e90-line2-policies" x="616" y="184" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">rendered from Git</text>
  <circle id="as95c1e90-badge-2" cx="860" cy="120" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-2-text" x="860" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
  <rect id="as95c1e90-rect-replicated" x="940" y="100" width="400" height="120" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as95c1e90-title-replicated" x="956" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Replicated policies</text>
  <text id="as95c1e90-line0-replicated" x="956" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">acm-policies.&lt;policy&gt; in bm and sno</text>
  <text id="as95c1e90-line1-replicated" x="956" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">created by ACM for every selected cluster,</text>
  <text id="as95c1e90-line2-replicated" x="956" y="184" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">IgnoreExtraneous set automatically</text>
  <circle id="as95c1e90-badge-3" cx="1320" cy="120" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-3-text" x="1320" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
  <rect id="as95c1e90-rect-health" x="290" y="260" width="250" height="110" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="as95c1e90-title-health" x="306" y="289" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">Argo CD health</text>
  <text id="as95c1e90-line0-health" x="306" y="312" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">Healthy if compliant,</text>
  <text id="as95c1e90-line1-health" x="306" y="328" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">Degraded if not (with the</text>
  <text id="as95c1e90-line2-health" x="306" y="344" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">policy health checks)</text>
  <circle id="as95c1e90-badge-6" cx="520" cy="280" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-6-text" x="520" y="284.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">6</text>
  <rect id="as95c1e90-rect-governance" x="940" y="260" width="300" height="110" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="as95c1e90-title-governance" x="956" y="289" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">ACM governance</text>
  <text id="as95c1e90-line0-governance" x="956" y="312" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">compliance per policy and</text>
  <text id="as95c1e90-line1-governance" x="956" y="328" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">cluster, with history</text>
  <circle id="as95c1e90-badge-5" cx="1220" cy="280" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-5-text" x="1220" y="284.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
  <rect id="as95c1e90-rect-framework" x="940" y="500" width="400" height="110" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="as95c1e90-title-framework" x="956" y="529" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">Policy framework</text>
  <text id="as95c1e90-line0-framework" x="956" y="552" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">pulls the replicated policy,</text>
  <text id="as95c1e90-line1-framework" x="956" y="568" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">evaluates it and enforces it</text>
  <text id="as95c1e90-line2-framework" x="956" y="584" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">(inform or enforce)</text>
  <circle id="as95c1e90-badge-4" cx="1320" cy="520" r="11" fill="#1F2937" />
  <text id="as95c1e90-badge-4-text" x="1320" y="524.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
  <rect id="as95c1e90-rect-resources" x="600" y="500" width="280" height="110" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as95c1e90-title-resources" x="616" y="529" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Objects on the spoke</text>
  <text id="as95c1e90-line0-resources" x="616" y="552" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">created or checked</text>
  <text id="as95c1e90-line1-resources" x="616" y="568" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">by the policy</text>
  <path id="as95c1e90-flow-git-argocd" d="M 212 160 L 286 160" fill="none" stroke="#4B5563" stroke-width="2" stroke-linejoin="round" marker-end="url(#as95c1e90-arrow-4B5563)" />
  <text id="as95c1e90-label-sync" x="249" y="151" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">sync</text>
  <path id="as95c1e90-flow-argocd-policies" d="M 542 160 L 596 160" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as95c1e90-arrow-C2410C)" />
  <path id="as95c1e90-flow-policies-replicated" d="M 882 150 L 936 150" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <path id="as95c1e90-flow-replicated-framework" d="M 1290 222 L 1290 496" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <text id="as95c1e90-label-pulled" x="1280" y="440" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="end">pulled by the spoke</text>
  <path id="as95c1e90-flow-framework-resources" d="M 938 555 L 884 555" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <path id="as95c1e90-status-framework-replicated" d="M 1320 498 L 1320 224" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <text id="as95c1e90-label-status" x="1330" y="440" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">status</text>
  <path id="as95c1e90-status-replicated-policies" d="M 938 200 L 884 200" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <path id="as95c1e90-status-replicated-governance" d="M 1090 222 L 1090 256" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <path id="as95c1e90-status-policies-health" d="M 740 222 L 740 315 L 544 315" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#as95c1e90-arrow-0F766E)" />
  <text id="as95c1e90-label-compliant" x="642" y="307" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="middle">status.compliant</text>
  <rect id="as95c1e90-legend-you" x="40" y="652" width="22" height="14" rx="3" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as95c1e90-legend-you-text" x="70" y="664" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">created by you</text>
  <rect id="as95c1e90-legend-acm" x="194.609375" y="652" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as95c1e90-legend-acm-text" x="224.609375" y="664" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by ACM</text>
  <rect id="as95c1e90-legend-argo" x="370.5625" y="652" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as95c1e90-legend-argo-text" x="400.5625" y="664" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by Argo CD</text>
  <rect id="as95c1e90-legend-platform" x="566.984375" y="652" width="22" height="14" rx="3" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.6" />
  <text id="as95c1e90-legend-platform-text" x="596.984375" y="664" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">platform component</text>
  <text id="as95c1e90-legend-extra" x="1380" y="664" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#4B5563" text-anchor="end">Dashed arrows: compliance status back to the hub</text>
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="3.5" fill="#4B5563" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 212 160 L 286 160" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 542 160 L 596 160" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.80s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 882 150 L 936 150" begin="indefinite" data-begin="0.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1290 222 L 1290 496" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.60s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 938 555 L 884 555" begin="indefinite" data-begin="1.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.00s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1320 498 L 1320 224" begin="indefinite" data-begin="2.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.40s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 938 200 L 884 200" begin="indefinite" data-begin="2.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.40s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1090 222 L 1090 256" begin="indefinite" data-begin="2.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.80s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 740 222 L 740 315 L 544 315" begin="indefinite" data-begin="2.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Policies as code: from plain manifests in Git to compliance on every cluster</div>
</div>

</div>
<div class="paragraph">
<p>What happens under the hood:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The <strong>hub Argo CD</strong> renders the policies from Git and syncs them to the hub.</p>
</li>
<li>
<p>The result is a set of <strong>Policy</strong>, <strong>Placement</strong> and <strong>PlacementBinding</strong> objects in the namespace <code>acm-policies</code>.</p>
</li>
<li>
<p>ACM creates a <strong>replicated policy</strong> in the namespace of every selected cluster on the hub.</p>
</li>
<li>
<p>The <strong>policy framework</strong> on each managed cluster pulls its replicated policy, evaluates it and, in <code>enforce</code> mode, fixes what is different.</p>
</li>
<li>
<p>The compliance status flows back to the hub and shows up in the <strong>ACM governance</strong> view, per policy and cluster.</p>
</li>
<li>
<p>With the policy health checks, Argo CD shows a non-compliant policy as <strong>Degraded</strong>.</p>
</li>
</ol>
</div>
<hr/>
<div class="sect2">
<h3 id="_repository_layout">Repository layout</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">acm-policies/
├── kustomization.yaml
├── policy-generator.yaml
└── input
    ├── service-mesh
    │   ├── 01-subscription.yaml       # OpenShift Service Mesh 3 Operator
    │   ├── 02-namespace-istio-system.yaml
    │   ├── 03-namespace-istio-cni.yaml
    │   ├── 04-istiocni.yaml           # CNI plugin, required on OpenShift
    │   └── 05-istio.yaml              # the control plane
    └── no-kubeadmin
        └── kubeadmin-secret.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The files in <code>input/</code> are plain Kubernetes manifests, exactly as you would apply them with <code>oc apply</code>. The Operator is installed in the namespace <code>openshift-operators</code>, which already has an OperatorGroup for all namespaces, so neither a namespace nor an OperatorGroup is needed for it:</p>
</div>
<div class="listingblock linenums">
<div class="title">input/service-mesh/01-subscription.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: servicemeshoperator3
  namespace: openshift-operators
spec:
  channel: stable-3.4 <i class="conum" data-value="1"></i><b>(1)</b>
  installPlanApproval: Automatic
  name: servicemeshoperator3
  source: redhat-operators
  sourceNamespace: openshift-marketplace</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Pins the minor version. Use <code>stable</code> to always get the latest version.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The control plane consists of two cluster-scoped resources, <code>IstioCNI</code> and <code>Istio</code>, each pointing to its own namespace (<code>istio-cni</code> and <code>istio-system</code>):</p>
</div>
<div class="listingblock linenums">
<div class="title">input/service-mesh/04-istiocni.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: sailoperator.io/v1
kind: IstioCNI
metadata:
  name: default
spec:
  namespace: istio-cni</code></pre>
</div>
</div>
<div class="listingblock linenums">
<div class="title">input/service-mesh/05-istio.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: sailoperator.io/v1
kind: Istio
metadata:
  name: default
spec:
  namespace: istio-system</code></pre>
</div>
</div>
<div class="paragraph">
<p>And the kubeadmin secret that must not exist:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
if your original kubeadmin secret is still present, you can ignore this yaml. Honestly, I am not even sure if this would work, once you have removed the secret.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">input/no-kubeadmin/kubeadmin-secret.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: kubeadmin
  namespace: kube-system</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <code>kustomization.yaml</code> only references the generator:</p>
</div>
<div class="listingblock linenums">
<div class="title">kustomization.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">generators:
  - policy-generator.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>Render the folder locally before you push. If it does not render on your machine, it will not render in Argo CD either. With the PolicyGenerator binary in your Kustomize plugin path:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">kustomize build --enable-alpha-plugins acm-policies/</code></pre>
</div>
</div>
<div class="paragraph">
<p>The output contains a Policy, a Placement and a PlacementBinding per policy.</p>
</div>
<hr/>
</div>
<div class="sect2">
<h3 id="_the_policygenerator_configuration">The PolicyGenerator configuration</h3>
<div class="paragraph">
<p>The file <code>policy-generator.yaml</code> is the heart of the setup. It does not contain any policy itself, it only describes which policies the generator shall create from the manifests in <code>input/</code>. It has two parts:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>policyDefaults</code> apply to every policy: the namespace on the hub where the policies are created, the default remediation action and severity, and the Placement that decides which clusters receive them.</p>
</li>
<li>
<p><code>policies</code> lists the policies, each with its name, the manifests it contains and the settings that differ from the defaults.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For every entry in <code>policies</code>, the generator creates a Policy, a Placement and a PlacementBinding. The manifests are wrapped into a ConfigurationPolicy inside the Policy: by default all manifests of a policy into one, with <code>consolidateManifests: false</code> one per manifest. Our two policies use this as follows: <code>service-mesh</code> overrides the defaults to enforce and to apply its manifests in order, while <code>no-kubeadmin</code> keeps the defaults and only changes the compliance type.</p>
</div>
<div class="listingblock linenums">
<div class="title">policy-generator.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: policy.open-cluster-management.io/v1
kind: PolicyGenerator
metadata:
  name: cluster-baseline
policyDefaults:
  namespace: acm-policies
  remediationAction: inform <i class="conum" data-value="1"></i><b>(1)</b>
  severity: medium
  placement:
    labelSelector:
      matchExpressions:
        - key: name <i class="conum" data-value="5"></i><b>(5)</b>
          operator: In
          values:
            - sno
            - bm
policies:
  - name: service-mesh
    remediationAction: enforce <i class="conum" data-value="2"></i><b>(2)</b>
    orderManifests: true <i class="conum" data-value="3"></i><b>(3)</b>
    consolidateManifests: false
    manifests:
      - path: input/service-mesh/01-subscription.yaml
      - path: input/service-mesh/02-namespace-istio-system.yaml
      - path: input/service-mesh/03-namespace-istio-cni.yaml
      - path: input/service-mesh/04-istiocni.yaml
      - path: input/service-mesh/05-istio.yaml
  - name: no-kubeadmin
    manifests:
      - path: input/no-kubeadmin/
        complianceType: mustnothave <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Default for all policies: report only.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>This policy is enforced.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Creates one ConfigurationPolicy per manifest and makes each one depend on the previous one: first the Subscription, then the namespaces, then IstioCNI and Istio. Note that the Subscription policy is compliant as soon as the Subscription exists, not when the Operator is installed. Until the CRDs are there, the IstioCNI policy reports an error and is evaluated again. If you want to wait for the installed Operator, use an OperatorPolicy instead of the Subscription, as shown in Pattern B.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The kubeadmin secret must not exist. In inform mode, ACM reports every cluster where it still exists. Remove it with care, only after an identity provider is configured.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Selects the clusters <code>sno</code> and <code>bm</code>. ACM sets the label <code>name</code> on every ManagedCluster. For a growing fleet, a label such as <code>environment=production</code> or the cluster set label <code>cluster.open-cluster-management.io/clusterset</code> scales better than a list of names.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_bind_the_cluster_sets_to_the_policy_namespace">Bind the cluster sets to the policy namespace</h3>
<div class="paragraph">
<p>A Placement only sees the clusters of cluster sets that are bound to its own namespace. The bindings from Ep.19 live in <code>openshift-gitops</code>, so the Placements in <code>acm-policies</code> would find no cluster at all. ACM then shows the warning <em>&#34;ClusterSets failed to load. Verify that there is at least one ClusterSet bound to your selected namespace.&#34;</em></p>
</div>
<div class="paragraph">
<p>Bind the cluster set <code>production</code> to <code>acm-policies</code>, and <code>global</code> as well if you use the policy that keeps the PolicyGenerator image in sync (its Placement selects the hub from <code>global</code>):</p>
</div>
<div class="listingblock linenums">
<div class="title">ManagedClusterSetBindings in the policy namespace</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
  name: production
  namespace: acm-policies
spec:
  clusterSet: production
---
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
  name: global
  namespace: acm-policies
spec:
  clusterSet: global</code></pre>
</div>
</div>
<div class="paragraph">
<p>The generated Placements select <code>sno</code> and <code>bm</code> by name, from the cluster sets bound to <code>acm-policies</code>. Check the result:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get placementdecisions -n acm-policies \
  -o custom-columns=NAME:.metadata.name,CLUSTERS:.status.decisions[*].clusterName</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_the_argo_cd_application">The Argo CD Application</h3>
<div class="paragraph">
<p>On the hub, one Application syncs the folder:</p>
</div>
<div class="listingblock linenums">
<div class="title">Application for the policies</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: acm-policies
  namespace: policy-gitops <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  project: default
  source:
    repoURL: https://github.com/tjungbauer/acm-policies.git
    targetRevision: main
    path: .
  destination:
    server: https://kubernetes.default.svc
    namespace: acm-policies
  syncPolicy:
    automated:
      prune: true
      selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The Application belongs to the instance <code>policy-gitops</code>. No <code>CreateNamespace=true</code>: the namespace <code>acm-policies</code> already exists with the <code>managed-by</code> label.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_replicated_policies">Replicated policies</h3>
<div class="paragraph">
<p>When ACM propagates a policy, it creates a copy in the namespace of every managed cluster on the hub, the <strong>replicated policy</strong>. Argo CD could treat these copies as extraneous resources of the Application and show it as <em>OutOfSync</em> or even try to delete them. ACM prevents that: it automatically sets the annotation <code>argocd.argoproj.io/compare-options: IgnoreExtraneous</code> on every replicated policy.</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pattern_b_a_policy_bootstraps_argo_cd">Pattern B: a policy bootstraps Argo CD</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The bootstrap question from <a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">Ep.18</a>: who installs Argo CD on a new cluster? With ACM, the answer is a policy. As soon as a cluster is imported and matches the Placement of the policy, the policy installs OpenShift GitOps and creates a root Application that points to the cluster’s folder in Git. From there, Argo CD configures the rest.</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg width="1400" height="720" viewBox="0 0 1400 720" role="img" aria-label="Bootstrap policy: the Placement selects the ManagedClusters sno and bm by their name label. The enforced policy gitops-bootstrap applies five templates in order: namespace, OperatorPolicy for OpenShift GitOps, ClusterRoleBinding, repository secret and root Application. The local Argo CD then syncs everything else from Git." version="1.1" id="asa8d4a31-svg-bootstrap-policy" xmlns="http://www.w3.org/2000/svg" xmlns:c2pa="http://c2pa.org/manifest">
  <title id="asa8d4a31-title-bootstrap-policy">Bootstrap policy: the Placement selects the ManagedClusters sno and bm by their name label. The enforced policy gitops-bootstrap applies five templates in order: namespace, OperatorPolicy for OpenShift GitOps, ClusterRoleBinding, repository secret and root Application. The local Argo CD then syncs everything else from Git.</title>
  <defs id="asa8d4a31-defs-bootstrap-policy">
    <marker id="asa8d4a31-arrow-0F766E" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#0F766E" id="asa8d4a31-marker-path-0F766E" /></marker>
    <marker id="asa8d4a31-arrow-C2410C" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#C2410C" id="asa8d4a31-marker-path-C2410C" /></marker>
    <marker id="asa8d4a31-arrow-4B5563" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#4B5563" id="asa8d4a31-marker-path-4B5563" /></marker>
    </defs>
  <rect id="asa8d4a31-bg" width="1400" height="720" fill="#FFFFFF" />
  <rect id="asa8d4a31-zone-hub" x="20" y="20" width="560" height="660" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asa8d4a31-label-hub" x="40" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">HUB</text>
  <rect id="asa8d4a31-zone-spoke" x="610" y="20" width="770" height="660" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asa8d4a31-label-spoke" x="630" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">MANAGED CLUSTER  ·  sno</text>
  <rect style="--d:0.20s" class="rv" id="asa8d4a31-rect-cluster" x="40" y="70" width="250" height="100" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text style="--d:0.20s" class="rv" id="asa8d4a31-title-cluster" x="56" y="99" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">ManagedCluster sno</text>
  <text style="--d:0.20s" class="rv" id="asa8d4a31-line0-cluster" x="56" y="122" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">label name=sno</text>
  <text style="--d:0.20s" class="rv" id="asa8d4a31-line1-cluster" x="56" y="138" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">the only manual step</text>
  <rect style="--d:0.20s" class="rv" id="asa8d4a31-rect-placement" x="310" y="70" width="250" height="100" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text style="--d:0.20s" class="rv" id="asa8d4a31-title-placement" x="326" y="99" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Placement</text>
  <text style="--d:0.20s" class="rv" id="asa8d4a31-line0-placement" x="326" y="122" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">labelSelector</text>
  <text style="--d:0.20s" class="rv" id="asa8d4a31-line1-placement" x="326" y="138" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">name in [sno, bm]</text>
  <path style="--d:0.20s" class="rv" id="asa8d4a31-flow-cluster-placement" d="M 292 120 L 306 120" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <rect style="--d:0.70s" class="rv" id="asa8d4a31-ns-policies" x="40" y="196" width="520" height="464" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text style="--d:0.70s" class="rv" id="asa8d4a31-label-ns-policies" x="56" y="220" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#0F766E" text-anchor="start">acm-policies</text>
  <rect style="--d:0.70s" class="rv" id="asa8d4a31-rect-policy" x="56" y="232" width="488" height="412" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text style="--d:0.70s" class="rv" id="asa8d4a31-title-policy" x="72" y="261" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Policy gitops-bootstrap</text>
  <text style="--d:0.70s" class="rv" id="asa8d4a31-line0-policy" x="72" y="282" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">enforce · templates applied in order, each one waits</text>
  <text style="--d:0.70s" class="rv" id="asa8d4a31-line1-policy" x="72" y="298" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">until the previous one is compliant</text>
  <rect style="--d:1.30s" class="rv" id="asa8d4a31-rect-tpl1" x="72" y="316" width="456" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.4" />
  <circle style="--d:1.30s" class="rv" id="asa8d4a31-badge-tpl1" cx="96" cy="342" r="12" fill="#0F766E" />
  <text style="--d:1.30s" class="rv" id="asa8d4a31-badge-tpl1-text" x="96" y="346.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
  <text style="--d:1.30s" class="rv" id="asa8d4a31-title-tpl1" x="120" y="338" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Namespace</text>
  <text style="--d:1.30s" class="rv" id="asa8d4a31-line0-tpl1" x="120" y="356" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">openshift-gitops-operator</text>
  <rect style="--d:1.70s" class="rv" id="asa8d4a31-rect-obj1" x="650" y="316" width="320" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:1.70s" class="rv" id="asa8d4a31-title-obj1" x="666" y="338" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Namespace</text>
  <text style="--d:1.70s" class="rv" id="asa8d4a31-line0-obj1" x="666" y="356" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">openshift-gitops-operator</text>
  <path style="--d:1.70s" class="rv" id="asa8d4a31-flow-tpl1" d="M 530 342 L 646 342" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <rect style="--d:2.10s" class="rv" id="asa8d4a31-rect-tpl2" x="72" y="380" width="456" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.4" />
  <circle style="--d:2.10s" class="rv" id="asa8d4a31-badge-tpl2" cx="96" cy="406" r="12" fill="#0F766E" />
  <text style="--d:2.10s" class="rv" id="asa8d4a31-badge-tpl2-text" x="96" y="410.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
  <text style="--d:2.10s" class="rv" id="asa8d4a31-title-tpl2" x="120" y="402" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">OperatorPolicy</text>
  <text style="--d:2.10s" class="rv" id="asa8d4a31-line0-tpl2" x="120" y="420" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">OpenShift GitOps, channel gitops-1.22</text>
  <rect style="--d:2.50s" class="rv" id="asa8d4a31-rect-obj2" x="650" y="380" width="320" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:2.50s" class="rv" id="asa8d4a31-title-obj2" x="666" y="402" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">OpenShift GitOps</text>
  <text style="--d:2.50s" class="rv" id="asa8d4a31-line0-obj2" x="666" y="420" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">operator and default Argo CD instance</text>
  <path style="--d:2.50s" class="rv" id="asa8d4a31-flow-tpl2" d="M 530 406 L 646 406" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <rect style="--d:2.90s" class="rv" id="asa8d4a31-rect-tpl3" x="72" y="444" width="456" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.4" />
  <circle style="--d:2.90s" class="rv" id="asa8d4a31-badge-tpl3" cx="96" cy="470" r="12" fill="#0F766E" />
  <text style="--d:2.90s" class="rv" id="asa8d4a31-badge-tpl3-text" x="96" y="474.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
  <text style="--d:2.90s" class="rv" id="asa8d4a31-title-tpl3" x="120" y="466" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">ClusterRoleBinding</text>
  <text style="--d:2.90s" class="rv" id="asa8d4a31-line0-tpl3" x="120" y="484" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">rights for the local application-controller</text>
  <rect style="--d:3.30s" class="rv" id="asa8d4a31-rect-obj3" x="650" y="444" width="320" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:3.30s" class="rv" id="asa8d4a31-title-obj3" x="666" y="466" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">ClusterRoleBinding</text>
  <text style="--d:3.30s" class="rv" id="asa8d4a31-line0-obj3" x="666" y="484" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">local controller may deploy</text>
  <path style="--d:3.30s" class="rv" id="asa8d4a31-flow-tpl3" d="M 530 470 L 646 470" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <rect style="--d:3.70s" class="rv" id="asa8d4a31-rect-tpl4" x="72" y="508" width="456" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.4" />
  <circle style="--d:3.70s" class="rv" id="asa8d4a31-badge-tpl4" cx="96" cy="534" r="12" fill="#0F766E" />
  <text style="--d:3.70s" class="rv" id="asa8d4a31-badge-tpl4-text" x="96" y="538.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
  <text style="--d:3.70s" class="rv" id="asa8d4a31-title-tpl4" x="120" y="530" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Repository secret</text>
  <text style="--d:3.70s" class="rv" id="asa8d4a31-line0-tpl4" x="120" y="548" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">copySecretData from the hub</text>
  <rect style="--d:4.10s" class="rv" id="asa8d4a31-rect-obj4" x="650" y="508" width="320" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:4.10s" class="rv" id="asa8d4a31-title-obj4" x="666" y="530" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Repository secret</text>
  <text style="--d:4.10s" class="rv" id="asa8d4a31-line0-obj4" x="666" y="548" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">Git credentials for the local Argo CD</text>
  <path style="--d:4.10s" class="rv" id="asa8d4a31-flow-tpl4" d="M 530 534 L 646 534" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <rect style="--d:4.50s" class="rv" id="asa8d4a31-rect-tpl5" x="72" y="572" width="456" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.4" />
  <circle style="--d:4.50s" class="rv" id="asa8d4a31-badge-tpl5" cx="96" cy="598" r="12" fill="#0F766E" />
  <text style="--d:4.50s" class="rv" id="asa8d4a31-badge-tpl5-text" x="96" y="602.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
  <text style="--d:4.50s" class="rv" id="asa8d4a31-title-tpl5" x="120" y="594" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Root Application</text>
  <text style="--d:4.50s" class="rv" id="asa8d4a31-line0-tpl5" x="120" y="612" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">path clusters/sno/bootstrap</text>
  <rect style="--d:4.90s" class="rv" id="asa8d4a31-rect-obj5" x="650" y="572" width="320" height="52" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:4.90s" class="rv" id="asa8d4a31-title-obj5" x="666" y="594" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13.5" font-weight="700" fill="#0F766E" text-anchor="start">Root Application</text>
  <text style="--d:4.90s" class="rv" id="asa8d4a31-line0-obj5" x="666" y="612" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start">app-of-apps for sno, prune: false</text>
  <path style="--d:4.90s" class="rv" id="asa8d4a31-flow-tpl5" d="M 530 598 L 646 598" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-0F766E)" />
  <text id="asa8d4a31-label-applied" x="650" y="306" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">applied in order by the policy framework on sno</text>
  <rect style="--d:3.00s" class="rv" id="asa8d4a31-rect-localargo" x="1010" y="380" width="350" height="100" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text style="--d:3.00s" class="rv" id="asa8d4a31-title-localargo" x="1026" y="409" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Local Argo CD</text>
  <text style="--d:3.00s" class="rv" id="asa8d4a31-line0-localargo" x="1026" y="432" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">installed by the operator,</text>
  <text style="--d:3.00s" class="rv" id="asa8d4a31-line1-localargo" x="1026" y="448" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">reads the repository secret</text>
  <path style="--d:3.00s" class="rv" id="asa8d4a31-flow-operator-localargo" d="M 972 406 L 1006 406" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-C2410C)" />
  <rect style="--d:5.40s" class="rv" id="asa8d4a31-rect-rest" x="1010" y="540" width="350" height="110" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text style="--d:5.40s" class="rv" id="asa8d4a31-title-rest" x="1026" y="569" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Everything else</text>
  <text style="--d:5.40s" class="rv" id="asa8d4a31-line0-rest" x="1026" y="592" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">operators, OAuth, RBAC, apps ...</text>
  <text style="--d:5.40s" class="rv" id="asa8d4a31-line1-rest" x="1026" y="608" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">synced by the local Argo CD</text>
  <text style="--d:5.40s" class="rv" id="asa8d4a31-line2-rest" x="1026" y="624" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4B5563" text-anchor="start">from clusters/sno/</text>
  <path style="--d:5.40s" class="rv" id="asa8d4a31-flow-root-rest" d="M 972 598 L 1006 598" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-C2410C)" />
  <path style="--d:5.40s" class="rv" id="asa8d4a31-flow-localargo-rest" d="M 1185 482 L 1185 536" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asa8d4a31-arrow-C2410C)" />
  <rect style="--d:6.00s" class="rv" id="asa8d4a31-rect-owner" x="650" y="80" width="710" height="96" rx="8" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.2" stroke-dasharray="6 4" />
  <text style="--d:6.00s" class="rv" id="asa8d4a31-owner1" x="670" y="110" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13" font-weight="600" fill="#0F766E" text-anchor="start">The policy owns the five objects on the left.</text>
  <text style="--d:6.00s" class="rv" id="asa8d4a31-owner2" x="670" y="132" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="13" font-weight="600" fill="#C2410C" text-anchor="start">Argo CD owns everything the root Application brings in.</text>
  <text style="--d:6.00s" class="rv" id="asa8d4a31-owner3" x="670" y="154" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">Never manage the same object from both sides.</text>
  <rect id="asa8d4a31-legend-you" x="40" y="692" width="22" height="14" rx="3" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asa8d4a31-legend-you-text" x="70" y="704" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">created by you</text>
  <rect id="asa8d4a31-legend-acm" x="194.609375" y="692" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asa8d4a31-legend-acm-text" x="224.609375" y="704" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by ACM</text>
  <rect id="asa8d4a31-legend-argo" x="370.5625" y="692" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asa8d4a31-legend-argo-text" x="400.5625" y="704" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by Argo CD</text>
  <rect id="asa8d4a31-legend-platform" x="566.984375" y="692" width="22" height="14" rx="3" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.6" />
  <text id="asa8d4a31-legend-platform-text" x="596.984375" y="704" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">platform component</text>
  <text id="asa8d4a31-legend-extra" x="1380" y="704" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#4B5563" text-anchor="end">Build-up order = order of the policy templates</text>
<circle class="flow-dot" style="--d:0.20s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 292 120 L 306 120" begin="indefinite" data-begin="0.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.70s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 530 342 L 646 342" begin="indefinite" data-begin="1.70" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.50s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 530 406 L 646 406" begin="indefinite" data-begin="2.50" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.30s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 530 470 L 646 470" begin="indefinite" data-begin="3.30" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:4.10s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 530 534 L 646 534" begin="indefinite" data-begin="4.10" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:4.90s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 530 598 L 646 598" begin="indefinite" data-begin="4.90" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.00s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 972 406 L 1006 406" begin="indefinite" data-begin="3.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:5.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 972 598 L 1006 598" begin="indefinite" data-begin="5.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:5.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1185 482 L 1185 536" begin="indefinite" data-begin="5.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Bootstrap policy: the templates are applied in order, then the local Argo CD takes over</div>
</div>

</div>
<div class="paragraph">
<p>We extend our repository with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">acm-policies/
└── input
    └── gitops-bootstrap
        ├── 01-namespace.yaml          # openshift-gitops-operator
        ├── 02-operatorpolicy.yaml     # OpenShift GitOps Operator
        ├── 03-controller-rbac.yaml    # rights for the local controller
        ├── 04-repo-credentials.yaml   # Git credentials, copied from the hub
        └── 05-root-application.yaml   # app-of-apps for this cluster</code></pre>
</div>
</div>
<div class="paragraph">
<p>The first file creates the namespace for the Operator. The OperatorPolicy in the next step expects it to exist:</p>
</div>
<div class="listingblock linenums">
<div class="title">input/gitops-bootstrap/01-namespace.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Namespace
metadata:
  name: openshift-gitops-operator</code></pre>
</div>
</div>
<div class="listingblock linenums">
<div class="title">input/gitops-bootstrap/02-operatorpolicy.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: policy.open-cluster-management.io/v1beta1
kind: OperatorPolicy <i class="conum" data-value="1"></i><b>(1)</b>
metadata:
  name: openshift-gitops-operator
spec:
  remediationAction: enforce
  severity: high
  complianceType: musthave
  subscription:
    name: openshift-gitops-operator
    namespace: openshift-gitops-operator
    channel: gitops-1.22 <i class="conum" data-value="2"></i><b>(2)</b>
    source: redhat-operators
    sourceNamespace: openshift-marketplace
  upgradeApproval: Automatic</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The PolicyGenerator adds OperatorPolicy manifests unchanged as a policy template, no extra wrapping.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Pin the channel. Moving to the next version is a one-line pull request.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The root Application is the app-of-apps that contains the Application for every cluster.</p>
</div>
<div class="listingblock linenums">
<div class="title">input/gitops-bootstrap/05-root-application.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: root
  namespace: openshift-gitops
spec:
  project: default
  source:
    repoURL: https://github.com/tjungbauer/openshift-clusterconfig-gitops.git
    targetRevision: main
    path: &#39;{{hub printf &#34;clusters/%s/bootstrap&#34; .ManagedClusterName hub}}&#39; <i class="conum" data-value="1"></i><b>(1)</b>
  destination:
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      prune: false <i class="conum" data-value="2"></i><b>(2)</b>
      selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>A hub template, resolved on the hub for every cluster: <code>sno</code> gets <code>clusters/sno/bootstrap</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Never prune on the root Application. A broken path would otherwise remove everything below it.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The local Argo CD must be allowed to create whatever the root Application brings in. <code>03-controller-rbac.yaml</code> grants its application-controller cluster-admin rights, the same as in the pull model of <a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">Ep.19</a>:</p>
</div>
<div class="listingblock linenums">
<div class="title">input/gitops-bootstrap/03-controller-rbac.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: argo-admin
subjects:
  - kind: ServiceAccount
    name: openshift-gitops-argocd-application-controller <i class="conum" data-value="1"></i><b>(1)</b>
    namespace: openshift-gitops
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The service account of the default instance <code>openshift-gitops</code>, which the Operator creates after the installation.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Simple and usually fine for platform configuration. For application teams, prefer namespaces labelled with <code>argocd.argoproj.io/managed-by</code>.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>And the generator configuration ties it together:</p>
</div>
<div class="listingblock linenums">
<div class="title">policy-generator.yaml (excerpt)</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">policies:
  - name: gitops-bootstrap
    remediationAction: enforce
    orderManifests: true <i class="conum" data-value="1"></i><b>(1)</b>
    consolidateManifests: false
    placement:
      labelSelector:
        matchExpressions:
          - key: name <i class="conum" data-value="2"></i><b>(2)</b>
            operator: In
            values:
              - sno
              - bm
    manifests:
      - path: input/gitops-bootstrap/01-namespace.yaml
      - path: input/gitops-bootstrap/02-operatorpolicy.yaml
      - path: input/gitops-bootstrap/03-controller-rbac.yaml
      - path: input/gitops-bootstrap/04-repo-credentials.yaml
      - path: input/gitops-bootstrap/05-root-application.yaml</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The order matters: the Application CRD only exists after the operator is installed. With <code>orderManifests</code>, the root Application is only created when the operator policy is compliant.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The same selection as for the other policies: the clusters <code>sno</code> and <code>bm</code>, selected by the <code>name</code> label that ACM sets on every ManagedCluster. In a larger fleet, a dedicated label such as <code>gitops=enabled</code> makes the bootstrap an opt-in per cluster.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Pattern B is meant for clusters that get their Argo CD from this policy. If you followed the pull or agent part of Ep.19, the GitOps add-on of ACM has already installed OpenShift GitOps on <code>sno</code> and <code>bm</code>, and the policy and the add-on would then manage the same operator. Decide which of the two owns the operator before you enforce this policy, or test Pattern B on a cluster without the add-on.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Who owns what afterwards? The policy owns exactly five objects: the namespace, the operator, the ClusterRoleBinding, the repository secret and the root Application. Everything the root Application brings in belongs to Argo CD. Keep it that way: if you also manage the OpenShift GitOps Subscription with Argo CD on the spoke, the two will fight.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_the_result_in_acm_argo_cd">The result in ACM &amp; Argo CD</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once Argo CD has synced the repository, the policies show up in the ACM console under <strong>Governance</strong>.</p>
</div>
<div class="paragraph">
<p>The list of <strong>Policies</strong> shows the three policies of this article in the namespace <code>acm-policies</code>: <code>service-mesh</code>, <code>no-kubeadmin</code> and <code>gitops-bootstrap</code>. For each policy you see the remediation action (inform or enforce), the cluster violations and the policy set, if there is one.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-20/acm-governance-policies.png?width=80%" alt="ACM Governance policies"/>
</div>
<div class="title">Figure 1. Policies in the namespace acm-policies</div>
</div>
<div class="paragraph">
<p>A click on a policy opens the details. The <strong>Details</strong> tab shows the policy templates, here the ConfigurationPolicies and the OperatorPolicy that the PolicyGenerator created from the plain manifests, and the Placement with the selected clusters <code>sno</code> and <code>bm</code>.</p>
</div>
<div class="paragraph">
<p>The <code>no-kubeadmin</code> policy is a good example for <code>inform</code>: ACM only reports that the secret <code>kubeadmin</code> still exists, it does not delete it.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-20/acm-policy-no-kubeadmin-results.png?width=80%" alt="Results of the policy no-kubeadmin"/>
</div>
<div class="title">Figure 2. Results of the policy no-kubeadmin</div>
</div>
<div class="paragraph">
<p>In the Argo CD UI we can also verify the status (including the resource tree).</p>
</div>
<div class="paragraph">
<p>The Application <code>acm-policies</code> shows the status <strong>Degraded</strong>. This is because the policy <code>no-kubeadmin</code> is non-compliant …​ the secrets are still present.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-20/policy-gitops-acm-policies-tile.png?width=50%" alt="Application acm-policies in Argo CD"/>
</div>
<div class="title">Figure 3. Application acm-policies in Argo CD</div>
</div>
<div class="paragraph">
<p>The resource tree proves this:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-20/policy-gitops-acm-policies-tree.png?width=80%" alt="Resource tree of the application acm-policies"/>
</div>
<div class="title">Figure 4. Resource tree of the application acm-policies</div>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>That concludes the mini-series. ACM decides <em>where</em> and checks <em>compliance</em>, Argo CD decides <em>what</em> and keeps it <em>in sync</em>, and Git is the only place where changes are made.</p>
</div>
<div class="paragraph">
<p>And as always: <strong>If it is not in Git, it does not exist.</strong> That includes your ACM policies.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The diagrams in this article have been manually drawn on a whiteboard. AI then generated the SVGs from photos and made them look equal in all articles.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17/html/gitops/gitops-overview" rel="noopener" target="_blank">ACM 2.17: GitOps (managing policy definitions with OpenShift GitOps, Policy Generator integration)</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17/html/governance/index" rel="noopener" target="_blank">ACM 2.17: Governance (Policy Generator, OperatorPolicy, hub templates)</a></p>
</li>
<li>
<p><a href="https://github.com/open-cluster-management-io/policy-collection" rel="noopener" target="_blank">Open Cluster Management: policy collection</a></p>
</li>
<li>
<p><a href="/gitopscollection/2024-04-02-configure_app_of_apps/">[Ep.4] Configure App-of-Apps</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.19] ACM and OpenShift GitOps: push, pull and the Argo CD Agent</title><link>https://blog.stderr.at/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/</guid><pubDate>Fri, 23 Oct 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>How ACM registers clusters in OpenShift GitOps: push model, pull model and the Argo CD Agent add-on, with a step-by-step setup for each approach.</description><content:encoded><![CDATA[<div class="paragraph">
<p>In <a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">[Ep.18]</a> I compared OpenShift GitOps and Advanced Cluster Management and ended with the statement that they are layers, not competitors. ACM knows the fleet and Argo CD delivers the content. This part is about the glue between the two: how ACM registers its clusters in Argo CD, and the three ways an Argo CD Application can reach a managed cluster: the <strong>push model</strong>, the <strong>pull model</strong> and the <strong>Argo CD Agent</strong>.</p>
</div>
<div class="paragraph">
<p>For each of them I will explain what it actually is, how the data flows, and how to set it up step by step.</p>
</div>
<div class="paragraph">
<p>The topic turned out to be too big for a single article, so I have split it into multiple parts and maybe I should have split into even more. This is the second part:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/">[Ep.18] OpenShift GitOps or Advanced Cluster Management? Choosing the right tool</a> What each tool does, where they overlap and a decision guide.</p>
</li>
<li>
<p><strong>[Ep.19] ACM and OpenShift GitOps: push, pull and the Argo CD Agent</strong> (this article): how ACM registers clusters in Argo CD, and how to set up each of the three delivery models.</p>
</li>
<li>
<p><a href="/gitopscollection/2026-10-24-acm-policies-with-gitops/">[Ep.20] Managing ACM Policies with OpenShift GitOps</a>: policies as code, the PolicyGenerator, hub templates and bootstrapping Argo CD with a policy.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Everything in this series was written against <strong>OpenShift GitOps 1.22</strong> (Argo CD 3.5) and <strong>Advanced Cluster Management 2.17</strong> (Open Cluster Management). Technology Preview and GA states move quickly in both products, so check the release notes of your versions before you commit to a design.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
While I am using the term &#34;Advanced Cluster Management&#34; in this article, I am referring to the product formerly known as Open Cluster Management. Same counts for Argo CD and OpenShift GitOps.
</td>
</tr>
</tbody></table>
</div>
<div class="sect1">
<h2 id="_the_setup">The setup</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before we dig into the models, let’s talk about my lab setup.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>There are 3 clusters:</p>
<div class="ulist">
<ul>
<li>
<p><code>hub</code> is the ACM hub with openshift-gitops installed.</p>
</li>
<li>
<p><code>bm</code> is a bare metal cluster with a single node.</p>
</li>
<li>
<p><code>sno</code> a single node cluster.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>The <code>hub</code> cluster is the starting point. Argo CD on the hub currently knows one cluster: <code>in-cluster</code>. This entity is automatically added during installation of Argo CD and it is the cluster Argo CD is hosted on.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/argocd-settings-clusters.png" alt="Argo CD settings clusters"/>
</div>
<div class="title">Figure 1. Argo CD settings clusters</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites_for_all_models">Prerequisites for all models</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>An ACM hub with the OpenShift GitOps Operator installed (the default instance in <code>openshift-gitops</code>).</p>
</li>
<li>
<p>The <strong>ManagedServiceAccount add-on</strong> enabled. ACM uses it to create and rotate the tokens for the push and the pull model. It is enabled by default with current versions of the multicluster engine, but check it if you upgraded from an old release: <code>oc get managedclusteraddon managed-serviceaccount -n &lt;cluster-name&gt;</code>.</p>
<div class="listingblock linenums">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get managedclusteraddon -A | grep managed-serviceaccount                                                                                                                               ─╯
bm              managed-serviceaccount        True                   False
local-cluster   managed-serviceaccount        True                   False
sno             managed-serviceaccount        True                   False</code></pre>
</div>
</div>
</li>
<li>
<p>The managed clusters <code>sno</code> and <code>bm</code> are in a ManagedClusterSet. In this article I called it <code>production</code>.</p>
<div class="openblock">
<div class="content">
<div class="listingblock linenums">
<div class="title">ManagedClusterSet production</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSet
metadata:
  name: production <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  clusterSelector:
    selectorType: ExclusiveClusterSetLabel <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Cluster-scoped, so there is no namespace.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The default. A cluster joins the set through the label <code>cluster.open-cluster-management.io/clusterset=production</code>. A cluster can only be in one such set at a time.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Add the clusters to the set by labelling them.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc label managedcluster bm cluster.open-cluster-management.io/clusterset=production --overwrite
oc label managedcluster sno cluster.open-cluster-management.io/clusterset=production --overwrite</code></pre>
</div>
</div>
<div class="paragraph">
<p>Check the result:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get managedclusterset production
oc get managedclusters -l cluster.open-cluster-management.io/clusterset=production</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">NAME         EMPTY   AGE
production   False   53s
NAME   HUB ACCEPTED   MANAGED CLUSTER URLS                   JOINED   AVAILABLE   AGE
bm     true           https://api.bm.stdin.at:6443           True     True        172m
sno    true           https://api.sno.aws.ispworld.at:6443   True     True        51m</code></pre>
</div>
</div>
</div>
</div>
</li>
<li>
<p>A <code>ManagedClusterSetBinding</code> for the cluster set <code>production</code> in the <strong>openshift-gitops</strong> namespace.</p>
<div class="openblock">
<div class="content">
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
It binds a ManagedClusterSet resource to a <strong>namespace</strong>. This is easy to forget: the Placement for Argo CD lives in the <strong>Argo CD namespace</strong>, so the cluster set must be bound there. Without this binding, the Placement does not find a single cluster.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">ManagedClusterSetBinding in the Argo CD namespace</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
  name: production
  namespace: openshift-gitops
spec:
  clusterSet: production</code></pre>
</div>
</div>
<div class="paragraph">
<p>Verify that your managed clusters are in the cluster set:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get managedclusters -l cluster.open-cluster-management.io/clusterset=production</code></pre>
</div>
</div>
</div>
</div>
</li>
</ol>
</div>
<div class="paragraph">
<p>The following image shows the currently created objects in the hub cluster:</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg
   width="1200"
   height="600"
   viewBox="0 0 1200 600"
   role="img"
   aria-label="Objects created in the prerequisites: GitOps instance, ManagedServiceAccount add-on, ManagedClusterSet production and its binding to openshift-gitops"
   version="1.1"
   id="ase622760-svg59"
  
  
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
  
  <title
     id="ase622760-title1">Objects created in the prerequisites: GitOps instance, ManagedServiceAccount add-on, ManagedClusterSet production and its binding to openshift-gitops</title>
  <defs
     id="ase622760-defs2">
    <rect
       x="0"
       y="529.88306"
       width="460.97997"
       height="100.61071"
       id="ase622760-rect63" />
    <marker
       id="ase622760-arrow-0F766E"
       viewBox="0 0 10 10"
       refX="8.5"
       refY="5"
       markerWidth="7"
       markerHeight="7"
       orient="auto-start-reverse">
      <path
         d="M 0 0 L 10 5 L 0 10 z"
         fill="#0F766E"
         id="ase622760-path1" />
    </marker>
    <marker
       id="ase622760-arrow-4B5563"
       viewBox="0 0 10 10"
       refX="8.5"
       refY="5"
       markerWidth="7"
       markerHeight="7"
       orient="auto-start-reverse">
      <path
         d="M 0 0 L 10 5 L 0 10 z"
         fill="#4B5563"
         id="ase622760-path2" />
    </marker>
  </defs>
  <rect
     width="1200"
     height="600"
     fill="#FFFFFF"
     id="ase622760-rect2" />
  <rect
     x="20"
     y="20"
     width="420"
     height="500"
     rx="14"
     fill="#F8FAFC"
     stroke="#E2E8F0"
     stroke-width="1.5"
     id="ase622760-rect3" />
  <text
     x="40"
     y="48"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text3">HUB  ·  CLUSTER-SCOPED</text>
  <rect
     x="40"
     y="64"
     width="170"
     height="84"
     rx="10"
     fill="#EEF2FF"
     stroke="#4338CA"
     stroke-width="1.6"
     id="ase622760-rect4" />
  <text
     x="56"
     y="93"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text4">bm</text>
  <text
     x="56"
     y="116"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text5"><tspan
       style="font-weight:bold"
       id="ase622760-tspan60">ManagedCluster</tspan></text>
  <rect
     x="40"
     y="168"
     width="170"
     height="84"
     rx="10"
     fill="#EEF2FF"
     stroke="#4338CA"
     stroke-width="1.6"
     id="ase622760-rect5" />
  <text
     x="56"
     y="197"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text6">sno</text>
  <text
     x="56"
     y="220"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text7"><tspan
       style="font-weight:bold"
       id="ase622760-tspan61">ManagedCluster</tspan></text>
  <rect
     x="40"
     y="272"
     width="170"
     height="84"
     rx="10"
     fill="#FFFFFF"
     stroke="#4338CA"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="ase622760-rect7" />
  <text
     x="56"
     y="301"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text8">local-cluster</text>
  <text
     x="56"
     y="324"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#4b5563"
     text-anchor="start"
     id="ase622760-text9"><tspan
   style="font-weight:bold"
   id="ase622760-tspan62">ManagedCluster</tspan> (the</text>
  <text
     x="56"
     y="340"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#4b5563"
     text-anchor="start"
     id="ase622760-text10">hub), not in production Set</text>
  <rect
     x="250"
     y="100"
     width="170"
     height="120"
     rx="10"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.6"
     id="ase622760-rect10" />
  <text
     x="266"
     y="129"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="ase622760-text12">production</text>
  <text
     x="266"
     y="152"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text13"><tspan
       style="font-weight:bold"
       id="ase622760-tspan59">ManagedClusterSet,</tspan></text>
  <text
     x="266"
     y="168"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text14">one exclusive set per</text>
  <text
     x="266"
     y="184"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text15">cluster</text>
  <path
     d="M 212 106 L 248 140"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#ase622760-arrow-0F766E)"
     id="ase622760-path15" />
  <path
     d="M 212 210 L 248 190"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#ase622760-arrow-0F766E)"
     id="ase622760-path16" />
  <text
     x="40"
     y="392"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="500"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text16">bm and sno join the set with the label</text>
  <text
     x="40"
     y="412"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="start"
     id="ase622760-text17">cluster.open-cluster-management.io/</text>
  <text
     x="40"
     y="430"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="start"
     id="ase622760-text18">clusterset=production</text>
  <text
     x="40"
     y="462"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text19">The label is the only link between a</text>
  <text
     x="40"
     y="480"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text20">cluster and its set.</text>
  <rect
     x="460"
     y="20"
     width="720"
     height="500"
     rx="14"
     fill="#F8FAFC"
     stroke="#E2E8F0"
     stroke-width="1.5"
     id="ase622760-rect20" />
  <text
     x="480"
     y="48"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text21">HUB  ·  NAMESPACES</text>
  <rect
     x="480"
     y="52"
     width="680"
     height="196"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="ase622760-rect21" />
  <text
     x="496"
     y="76"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#C2410C"
     text-anchor="start"
     id="ase622760-text22">openshift-gitops</text>
  <rect
     x="496"
     y="92"
     width="200"
     height="132"
     rx="10"
     fill="#FDF0E8"
     stroke="#C2410C"
     stroke-width="1.6"
     id="ase622760-rect22" />
  <text
     x="512"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#c2410c"
     text-anchor="start"
     id="ase622760-text24">ArgoCD</text>
  <text
     x="512"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text25">openshift-gitops, the default</text>
  <text
     x="512"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text26">instance of the OpenShift</text>
  <text
     x="512"
     y="176"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text27">GitOps Operator</text>
  <rect
     x="716"
     y="92"
     width="210"
     height="132"
     rx="10"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.6"
     id="ase622760-rect27" />
  <text
     x="732"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="ase622760-text29">Set binding</text>
  <text
     x="732"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text30"><tspan
       style="font-weight:bold"
       id="ase622760-tspan63">ManagedClusterSetBinding</tspan></text>
  <text
     x="732"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text31">production: makes the set</text>
  <text
     x="732"
     y="176"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="ase622760-text32">usable in this namespace</text>
  <rect
     x="946"
     y="92"
     width="196"
     height="132"
     rx="10"
     fill="#FFFFFF"
     stroke="#4B5563"
     stroke-width="1.4"
     stroke-dasharray="6 4"
     id="ase622760-rect32" />
  <text
     x="962"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text33">Placement</text>
  <text
     x="962"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text34">next step: selects clusters</text>
  <text
     x="962"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text35">from the bound set</text>
  <path
     d="M 928 158 L 944 158"
     fill="none"
     stroke="#4B5563"
     stroke-width="2"
     stroke-linejoin="round"
     stroke-dasharray="4 3"
     marker-end="url(#ase622760-arrow-4B5563)"
     id="ase622760-path35" />
  <path
     d="M 821 226 L 821 262 L 330 262 L 330 222"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#ase622760-arrow-0F766E)"
     id="ase622760-path36" />
  <circle class="flow-dot" style="--d:0.30s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 821 226 L 821 262 L 330 262 L 330 222" begin="indefinite" data-begin="0.30" dur="2.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <rect
     x="500"
     y="252"
     width="168"
     height="20"
     fill="#F8FAFC"
     id="ase622760-rect36" />
  <text
     x="584"
     y="266"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="middle"
     id="ase622760-text36">clusterSet: production</text>
  <text
     x="480"
     y="306"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text37">Cluster namespaces (one per managed cluster, created by ACM)</text>
  <rect
     x="480"
     y="318"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="ase622760-rect37" />
  <text
     x="496"
     y="342"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text38">bm</text>
  <rect
     x="492"
     y="356"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="ase622760-rect38" />
  <text
     x="508"
     y="385"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="ase622760-text40">Add-on</text>
  <text
     x="508"
     y="408"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text41">ManagedClusterAddOn</text>
  <text
     x="508"
     y="424"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text42">managed-serviceaccount,</text>
  <text
     x="508"
     y="440"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text43">enabled by default</text>
  <rect
     x="712"
     y="318"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="ase622760-rect43" />
  <text
     x="728"
     y="342"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text44">sno</text>
  <rect
     x="724"
     y="356"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="ase622760-rect44" />
  <text
     x="740"
     y="385"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="ase622760-text46">Add-on</text>
  <text
     x="740"
     y="408"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text47">ManagedClusterAddOn</text>
  <text
     x="740"
     y="424"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text48">managed-serviceaccount,</text>
  <text
     x="740"
     y="440"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text49">enabled by default</text>
  <rect
     x="944"
     y="318"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="ase622760-rect49" />
  <text
     x="960"
     y="342"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="ase622760-text50">local-cluster</text>
  <rect
     x="956"
     y="356"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="ase622760-rect50" />
  <text
     x="972"
     y="385"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="ase622760-text52">Add-on</text>
  <text
     x="972"
     y="408"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text53">ManagedClusterAddOn</text>
  <text
     x="972"
     y="424"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text54">managed-serviceaccount,</text>
  <text
     x="972"
     y="440"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="ase622760-text55">enabled by default</text>
  <rect
     x="40"
     y="557"
     width="22"
     height="14"
     rx="3"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.4"
     id="ase622760-rect55" />
  <text
     x="70"
     y="569"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text56">created by you</text>
  <rect
     x="166.234375"
     y="557"
     width="22"
     height="14"
     rx="3"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.4"
     stroke-dasharray="4 3"
     id="ase622760-rect56" />
  <text
     x="196.23438"
     y="569"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="ase622760-text57">generated by ACM</text>
  
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 212 106 L 248 140" begin="indefinite" data-begin="0.00" dur="1.20s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.60s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 212 210 L 248 190" begin="indefinite" data-begin="0.60" dur="1.20s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Currently created objects in the hub cluster</div>
</div>

</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_the_bridge_placement_gitopscluster_and_applicationset">The bridge: Placement, GitOpsCluster and ApplicationSet</h2>
<div class="sectionbody">
<div class="paragraph">
<p>So far, we only created the prerequisites for all three models. When we now look at the models all three of them start with the same chain of objects on the hub:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>a <strong>Placement</strong> decides <em>which</em> managed clusters are used,</p>
</li>
<li>
<p>a <strong>GitOpsCluster</strong> makes these clusters known to an Argo CD instance, and</p>
</li>
<li>
<p>an <strong>ApplicationSet</strong> creates one Application per selected cluster.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The GitOpsCluster is the actual bridge between ACM and Argo CD. ACM knows the clusters, Argo CD knows the Applications, and the GitOpsCluster translates one into the other.</p>
</div>
<div class="paragraph">
<p>What differs between the models is what happens <em>after</em> this chain: <em>who</em> talks to the managed cluster, <em>in which direction</em> the network connection goes, and <em>where</em> the reconciliation happens. That is why the GitOpsCluster and the ApplicationSet look different in each model and are created in the model sections below.</p>
</div>
<div class="paragraph">
<p>The Placement is identical for all three, so we create it now.</p>
</div>
<div class="sect2">
<h3 id="_the_placement">The Placement</h3>
<div class="paragraph">
<p>The Placement lives in the Argo CD namespace, next to the ManagedClusterSetBinding from the prerequisites. It selects the OpenShift clusters of the cluster set <code>production</code>.</p>
</div>
<div class="listingblock linenums">
<div class="title">Placement in the Argo CD namespace</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: production-clusters
  namespace: openshift-gitops <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  clusterSets:
    - production <i class="conum" data-value="2"></i><b>(2)</b>
  predicates:
    - requiredClusterSelector: <i class="conum" data-value="3"></i><b>(3)</b>
        labelSelector:
          matchExpressions:
            - key: vendor
              operator: In
              values:
                - OpenShift
  tolerations: <i class="conum" data-value="4"></i><b>(4)</b>
    - key: cluster.open-cluster-management.io/unreachable
      operator: Exists
    - key: cluster.open-cluster-management.io/unavailable
      operator: Exists</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The same namespace as the GitOpsCluster that will reference it.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Represents the ManagedClusterSets from which the ManagedClusters are selected.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The predicate to select only OpenShift clusters.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>By default a Placement drops clusters that are unreachable. For GitOps we want to keep them, so that a short network hiccup does not remove the cluster secret and, worst case, the generated Applications.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The result of a Placement is a <strong>PlacementDecision</strong>. Check which clusters were selected:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get placementdecisions -n openshift-gitops \
  -l cluster.open-cluster-management.io/placement=production-clusters \
  -o jsonpath=&#39;{.items[*].status.decisions[*].clusterName}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>With <code>bm</code> and <code>sno</code> in the set, the output is:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">bm sno</code></pre>
</div>
</div>
<div class="paragraph">
<p>The Placement and its PlacementDecision complete the picture on the hub:</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg
   width="1200"
   height="720"
   viewBox="0 0 1200 720"
   role="img"
   aria-label="Objects on the hub: managed clusters, ManagedClusterSet production, the binding to openshift-gitops, the Placement production-clusters with its PlacementDecision (bm, sno), and the ManagedServiceAccount add-ons"
   version="1.1"
   id="as5de8cd1-svg59"
  
  
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
  
  <title
     id="as5de8cd1-title1">Objects on the hub: managed clusters, ManagedClusterSet production, the binding to openshift-gitops, the Placement production-clusters with its PlacementDecision (bm, sno), and the ManagedServiceAccount add-ons</title>
  <defs
     id="as5de8cd1-defs2">
    <rect
       x="0"
       y="529.88306"
       width="460.97997"
       height="100.61071"
       id="as5de8cd1-rect63" />
    <marker
       id="as5de8cd1-arrow-0F766E"
       viewBox="0 0 10 10"
       refX="8.5"
       refY="5"
       markerWidth="7"
       markerHeight="7"
       orient="auto-start-reverse">
      <path
         d="M 0 0 L 10 5 L 0 10 z"
         fill="#0F766E"
         id="as5de8cd1-path1" />
    </marker>
    <marker
       id="as5de8cd1-arrow-4B5563"
       viewBox="0 0 10 10"
       refX="8.5"
       refY="5"
       markerWidth="7"
       markerHeight="7"
       orient="auto-start-reverse">
      <path
         d="M 0 0 L 10 5 L 0 10 z"
         fill="#4B5563"
         id="as5de8cd1-path2" />
    </marker>
  </defs>
  <rect
     width="1200"
     height="720"
     fill="#FFFFFF"
     id="as5de8cd1-rect2" />
  <rect
     x="20"
     y="20"
     width="420"
     height="614"
     rx="14"
     fill="#F8FAFC"
     stroke="#E2E8F0"
     stroke-width="1.5"
     id="as5de8cd1-rect3" />
  <text
     x="40"
     y="48"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text3">HUB  ·  CLUSTER-SCOPED</text>
  <rect
     x="40"
     y="64"
     width="170"
     height="84"
     rx="10"
     fill="#EEF2FF"
     stroke="#4338CA"
     stroke-width="1.6"
     id="as5de8cd1-rect4" />
  <text
     x="56"
     y="93"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text4">bm</text>
  <text
     x="56"
     y="116"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text5"><tspan
       style="font-weight:bold"
       id="as5de8cd1-tspan60">ManagedCluster</tspan></text>
  <rect
     x="40"
     y="168"
     width="170"
     height="84"
     rx="10"
     fill="#EEF2FF"
     stroke="#4338CA"
     stroke-width="1.6"
     id="as5de8cd1-rect5" />
  <text
     x="56"
     y="197"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text6">sno</text>
  <text
     x="56"
     y="220"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text7"><tspan
       style="font-weight:bold"
       id="as5de8cd1-tspan61">ManagedCluster</tspan></text>
  <rect
     x="40"
     y="272"
     width="170"
     height="84"
     rx="10"
     fill="#FFFFFF"
     stroke="#4338CA"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="as5de8cd1-rect7" />
  <text
     x="56"
     y="301"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text8">local-cluster</text>
  <text
     x="56"
     y="324"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#4b5563"
     text-anchor="start"
     id="as5de8cd1-text9"><tspan
   style="font-weight:bold"
   id="as5de8cd1-tspan62">ManagedCluster</tspan> (the</text>
  <text
     x="56"
     y="340"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#4b5563"
     text-anchor="start"
     id="as5de8cd1-text10">hub), not in production Set</text>
  <rect
     x="250"
     y="100"
     width="170"
     height="120"
     rx="10"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.6"
     id="as5de8cd1-rect10" />
  <text
     x="266"
     y="129"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="as5de8cd1-text12">production</text>
  <text
     x="266"
     y="152"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text13"><tspan
       style="font-weight:bold"
       id="as5de8cd1-tspan59">ManagedClusterSet,</tspan></text>
  <text
     x="266"
     y="168"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text14">one exclusive set per</text>
  <text
     x="266"
     y="184"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text15">cluster</text>
  <path
     d="M 212 106 L 248 140"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#as5de8cd1-arrow-0F766E)"
     id="as5de8cd1-path15" />
  <path
     d="M 212 210 L 248 190"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#as5de8cd1-arrow-0F766E)"
     id="as5de8cd1-path16" />
  <text
     x="40"
     y="392"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="500"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text16">bm and sno join the set with the label</text>
  <text
     x="40"
     y="412"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="start"
     id="as5de8cd1-text17">cluster.open-cluster-management.io/</text>
  <text
     x="40"
     y="430"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="start"
     id="as5de8cd1-text18">clusterset=production</text>
  <text
     x="40"
     y="462"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text19">The label is the only link between a</text>
  <text
     x="40"
     y="480"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text20">cluster and its set.</text>
  <rect
     x="460"
     y="20"
     width="720"
     height="614"
     rx="14"
     fill="#F8FAFC"
     stroke="#E2E8F0"
     stroke-width="1.5"
     id="as5de8cd1-rect20" />
  <text
     x="480"
     y="48"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text21">HUB  ·  NAMESPACES</text>
  <rect
     x="480"
     y="52"
     width="680"
     height="344"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="as5de8cd1-rect21" />
  <text
     x="496"
     y="76"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#C2410C"
     text-anchor="start"
     id="as5de8cd1-text22">openshift-gitops</text>
  <rect
     x="496"
     y="92"
     width="200"
     height="132"
     rx="10"
     fill="#FDF0E8"
     stroke="#C2410C"
     stroke-width="1.6"
     id="as5de8cd1-rect22" />
  <text
     x="512"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#c2410c"
     text-anchor="start"
     id="as5de8cd1-text24">ArgoCD</text>
  <text
     x="512"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text25">openshift-gitops, the default</text>
  <text
     x="512"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text26">instance of the OpenShift</text>
  <text
     x="512"
     y="176"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text27">GitOps Operator</text>
  <rect
     x="716"
     y="92"
     width="210"
     height="132"
     rx="10"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.6"
     id="as5de8cd1-rect27" />
  <text
     x="732"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="as5de8cd1-text29">Set binding</text>
  <text
     x="732"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text30"><tspan
       style="font-weight:bold"
       id="as5de8cd1-tspan63">ManagedClusterSetBinding</tspan></text>
  <text
     x="732"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text31">production: makes the set</text>
  <text
     x="732"
     y="176"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text32">usable in this namespace</text>
  <rect
     x="946"
     y="92"
     width="196"
     height="132"
     rx="10"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.6"
    
     id="as5de8cd1-rect32" />
  <text
     x="962"
     y="121"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15"
     font-weight="700"
     fill="#0F766E"
     text-anchor="start"
     id="as5de8cd1-text33">Placement</text>
  <text
     x="962"
     y="144"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text34"><tspan style="font-weight:bold" id="as5de8cd1-tspan-placement-name">production-clusters</tspan></text>
  <text
     x="962"
     y="160"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#1F2937"
     text-anchor="start"
     id="as5de8cd1-text35">clusterSets: production</text>
  <text x="962" y="176" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start" id="as5de8cd1-text-placement-pred">vendor In OpenShift</text>
  <path
     d="M 928 158 L 944 158"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
    
     marker-end="url(#as5de8cd1-arrow-0F766E)"
     id="as5de8cd1-path35" />
  <path d="M 1044 226 L 1044 266" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as5de8cd1-arrow-0F766E)" id="as5de8cd1-path-placement-decision" />
  <text x="1054" y="251" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start" id="as5de8cd1-text-generates">generates</text>
  <rect x="946" y="270" width="196" height="108" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" id="as5de8cd1-rect-decision" />
  <text x="962" y="298" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start" id="as5de8cd1-text-decision-title">PlacementDecision</text>
  <text x="962" y="320" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start" id="as5de8cd1-text-decision-label">decisions:</text>
  <rect x="1030" y="306" width="40" height="22" rx="6" fill="#EEF2FF" stroke="#4338CA" stroke-width="1.4" id="as5de8cd1-rect-decision-bm" />
  <text x="1050" y="321" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4338CA" text-anchor="middle" id="as5de8cd1-text-decision-bm">bm</text>
  <rect x="1078" y="306" width="46" height="22" rx="6" fill="#EEF2FF" stroke="#4338CA" stroke-width="1.4" id="as5de8cd1-rect-decision-sno" />
  <text x="1101" y="321" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4338CA" text-anchor="middle" id="as5de8cd1-text-decision-sno">sno</text>
  <text x="962" y="350" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start" id="as5de8cd1-text-decision-note1">local-cluster is not in the</text>
  <text x="962" y="366" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#4B5563" text-anchor="start" id="as5de8cd1-text-decision-note2">set, so it is never selected</text>
  <path
     d="M 821 226 L 821 262 L 330 262 L 330 222"
     fill="none"
     stroke="#0F766E"
     stroke-width="2"
     stroke-linejoin="round"
     marker-end="url(#as5de8cd1-arrow-0F766E)"
     id="as5de8cd1-path36" />
  <circle class="flow-dot" style="--d:0.30s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 821 226 L 821 262 L 330 262 L 330 222" begin="indefinite" data-begin="0.30" dur="2.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <rect
     x="500"
     y="252"
     width="168"
     height="20"
     fill="#FFFFFF"
     id="as5de8cd1-rect36" />
  <text
     x="584"
     y="266"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="600"
     fill="#0F766E"
     text-anchor="middle"
     id="as5de8cd1-text36">clusterSet: production</text>
  <text
     x="480"
     y="420"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text37">Cluster namespaces (one per managed cluster, created by ACM)</text>
  <rect
     x="480"
     y="432"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="as5de8cd1-rect37" />
  <text
     x="496"
     y="456"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text38">bm</text>
  <rect
     x="492"
     y="470"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="as5de8cd1-rect38" />
  <text
     x="508"
     y="499"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="as5de8cd1-text40">Add-on</text>
  <text
     x="508"
     y="522"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text41">ManagedClusterAddOn</text>
  <text
     x="508"
     y="538"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text42">managed-serviceaccount,</text>
  <text
     x="508"
     y="554"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text43">enabled by default</text>
  <rect
     x="712"
     y="432"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="as5de8cd1-rect43" />
  <text
     x="728"
     y="456"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text44">sno</text>
  <rect
     x="724"
     y="470"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="as5de8cd1-rect44" />
  <text
     x="740"
     y="499"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="as5de8cd1-text46">Add-on</text>
  <text
     x="740"
     y="522"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text47">ManagedClusterAddOn</text>
  <text
     x="740"
     y="538"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text48">managed-serviceaccount,</text>
  <text
     x="740"
     y="554"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text49">enabled by default</text>
  <rect
     x="944"
     y="432"
     width="216"
     height="182"
     rx="10"
     fill="#FFFFFF"
     stroke="#CBD5E1"
     stroke-width="1.2"
     id="as5de8cd1-rect49" />
  <text
     x="960"
     y="456"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12"
     font-weight="700"
     fill="#4338CA"
     text-anchor="start"
     id="as5de8cd1-text50">local-cluster</text>
  <rect
     x="956"
     y="470"
     width="192"
     height="128"
     rx="10"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.6"
     stroke-dasharray="6 4"
     id="as5de8cd1-rect50" />
  <text
     x="972"
     y="499"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="15px"
     font-weight="700"
     fill="#0f766e"
     text-anchor="start"
     id="as5de8cd1-text52">Add-on</text>
  <text
     x="972"
     y="522"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text53">ManagedClusterAddOn</text>
  <text
     x="972"
     y="538"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text54">managed-serviceaccount,</text>
  <text
     x="972"
     y="554"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12.5"
     font-weight="400"
     fill="#4B5563"
     text-anchor="start"
     id="as5de8cd1-text55">enabled by default</text>
  <rect
     x="40"
     y="671"
     width="22"
     height="14"
     rx="3"
     fill="#E6F4F1"
     stroke="#0F766E"
     stroke-width="1.4"
     id="as5de8cd1-rect55" />
  <text
     x="70"
     y="683"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text56">created by you</text>
  <rect
     x="166.234375"
     y="671"
     width="22"
     height="14"
     rx="3"
     fill="#FFFFFF"
     stroke="#0F766E"
     stroke-width="1.4"
     stroke-dasharray="4 3"
     id="as5de8cd1-rect56" />
  <text
     x="196.23438"
     y="683"
     font-family="Inter, 'Liberation Sans', Arial, sans-serif"
     font-size="12px"
     font-weight="400"
     fill="#1f2937"
     text-anchor="start"
     id="as5de8cd1-text57">generated by ACM</text>
  
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 212 106 L 248 140" begin="indefinite" data-begin="0.00" dur="1.20s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.60s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 212 210 L 248 190" begin="indefinite" data-begin="0.60" dur="1.20s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.90s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1044 226 L 1044 266" begin="indefinite" data-begin="0.90" dur="0.90s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Objects in the hub cluster after creating the Placement</div>
</div>

</div>
<div class="paragraph">
<p>At this point nothing has happened in Argo CD yet: <em>Settings &gt; Clusters</em> still shows only <code>in-cluster</code>. The Placement only <em>decides</em> what clusters could be selected. The GitOpsCluster in the next section turns the decision into Argo CD clusters.</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_push_model">The push model</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_what_it_actually_is">What it actually is</h3>
<div class="paragraph">
<p>The push model is &#34;classic&#34; Argo CD. One Argo CD instance on the hub renders the manifests and applies them to the API server of every managed cluster, by default through the cluster proxy of the multicluster engine. ACM contributes the cluster registration, the credentials and the connection path.</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg width="1400" height="620" viewBox="0 0 1400 620" role="img" aria-label="Push model: Placement, PlacementDecision and GitOpsCluster create a cluster secret on the hub; the ApplicationSet generates one Application per cluster. The hub Argo CD application-controller sends its API requests to the cluster-proxy on the hub, which forwards them through a tunnel opened by the managed cluster; only without the proxy does it fall back to the API server URL of the managed cluster" version="1.1" id="as4f6ec12-svg-push-model" xmlns="http://www.w3.org/2000/svg">
  <title id="as4f6ec12-title-push-model">Push model: Placement, PlacementDecision and GitOpsCluster create a cluster secret on the hub; the ApplicationSet generates one Application per cluster. The hub Argo CD application-controller sends its API requests to the cluster-proxy on the hub, which forwards them through a tunnel opened by the managed cluster; only without the proxy does it fall back to the API server URL of the managed cluster</title>
  <defs id="as4f6ec12-defs-push-model">
    <marker id="as4f6ec12-arrow-0F766E" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#0F766E" id="as4f6ec12-marker-path-0F766E" /></marker>
    <marker id="as4f6ec12-arrow-C2410C" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#C2410C" id="as4f6ec12-marker-path-C2410C" /></marker>
    <marker id="as4f6ec12-arrow-4B5563" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#4B5563" id="as4f6ec12-marker-path-4B5563" /></marker>
    </defs>
  <rect id="as4f6ec12-bg" width="1400" height="620" fill="#FFFFFF" />
  <rect id="as4f6ec12-zone-hub" x="20" y="20" width="970" height="560" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="as4f6ec12-label-hub" x="40" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">HUB</text>
  <rect id="as4f6ec12-zone-spoke" x="1050" y="20" width="330" height="560" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="as4f6ec12-label-spoke" x="1070" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">MANAGED CLUSTER  ·  bm, sno</text>
  <rect id="as4f6ec12-ns-gitops" x="40" y="60" width="730" height="480" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="as4f6ec12-label-ns" x="56" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#C2410C" text-anchor="start">openshift-gitops</text>
  <rect id="as4f6ec12-ns-mce" x="790" y="360" width="185" height="180" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="as4f6ec12-label-ns-mce" x="806" y="384" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">multicluster-engine</text>
  <rect id="as4f6ec12-rect-placement" x="60" y="100" width="180" height="84" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as4f6ec12-title-placement" x="76" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Placement</text>
  <text id="as4f6ec12-line0-placement" x="76" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">production-clusters</text>
  <rect id="as4f6ec12-rect-decision" x="290" y="100" width="190" height="84" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-title-decision" x="306" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">PlacementDecision</text>
  <text id="as4f6ec12-line0-decision" x="306" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">decisions: bm, sno</text>
  <rect id="as4f6ec12-rect-gitopscluster" x="540" y="100" width="210" height="84" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as4f6ec12-title-gitopscluster" x="556" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">GitOpsCluster</text>
  <text id="as4f6ec12-line0-gitopscluster" x="556" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">bridge from ACM to Argo CD</text>
  <rect id="as4f6ec12-rect-secret" x="540" y="232" width="210" height="108" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-title-secret" x="556" y="261" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Cluster secret</text>
  <text id="as4f6ec12-line0-secret" x="556" y="284" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">one per cluster, token of the</text>
  <text id="as4f6ec12-line1-secret" x="556" y="300" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4B5563" text-anchor="start">ManagedServiceAccount</text>
  <text id="as4f6ec12-line2-secret" x="556" y="316" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">application-manager</text>
  <rect id="as4f6ec12-rect-appset" x="60" y="392" width="180" height="96" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as4f6ec12-title-appset" x="76" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">ApplicationSet</text>
  <text id="as4f6ec12-line0-appset" x="76" y="444" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">generator:</text>
  <text id="as4f6ec12-line1-appset" x="76" y="460" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">clusterDecisionResource</text>
  <rect id="as4f6ec12-rect-application" x="290" y="392" width="190" height="96" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-title-application" x="306" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Application</text>
  <text id="as4f6ec12-line0-application" x="306" y="444" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">one per selected cluster</text>
  <rect id="as4f6ec12-rect-controller" x="540" y="392" width="210" height="96" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="as4f6ec12-title-controller" x="556" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Argo CD</text>
  <text id="as4f6ec12-line0-controller" x="556" y="444" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">application-controller</text>
  <text id="as4f6ec12-line1-controller" x="556" y="460" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">reconciles all clusters</text>
  <rect id="as4f6ec12-rect-proxy" x="800" y="396" width="168" height="96" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="as4f6ec12-title-proxy" x="816" y="425" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">cluster-proxy</text>
  <text id="as4f6ec12-line0-proxy" x="816" y="448" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">default server URL</text>
  <text id="as4f6ec12-line1-proxy" x="816" y="464" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">in the cluster secret</text>
  <text id="as4f6ec12-note-spoke1" x="1070" y="124" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">No Argo CD on the spoke:</text>
  <text id="as4f6ec12-note-spoke2" x="1070" y="142" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">the hub reconciles everything.</text>
  <text id="as4f6ec12-note-spoke3" x="1070" y="160" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">No hub, no reconciliation.</text>
  <rect id="as4f6ec12-rect-resources" x="1070" y="232" width="290" height="108" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-title-resources" x="1086" y="261" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Resources</text>
  <text id="as4f6ec12-line0-resources" x="1086" y="284" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">applied by the hub Argo CD,</text>
  <text id="as4f6ec12-line1-resources" x="1086" y="300" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">e.g. Namespaces, Deployments</text>
  <rect id="as4f6ec12-rect-apiserver" x="1070" y="392" width="290" height="96" rx="10" fill="#FFFFFF" stroke="#4B5563" stroke-width="1.4" />
  <text id="as4f6ec12-title-apiserver" x="1086" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4338CA" text-anchor="start">kube-apiserver</text>
  <text id="as4f6ec12-line0-apiserver" x="1086" y="444" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">of each managed cluster,</text>
  <text id="as4f6ec12-line1-apiserver" x="1086" y="460" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">cluster-proxy agent alongside</text>
  <path id="as4f6ec12-flow-placement-decision" d="M 242 142 L 286 142" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-0F766E)" />
  <path id="as4f6ec12-flow-decision-gitopscluster" d="M 482 142 L 536 142" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-0F766E)" />
  <path id="as4f6ec12-flow-gitopscluster-secret" d="M 645 186 L 645 228" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-0F766E)" />
  <text id="as4f6ec12-label-creates" x="655" y="212" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start">creates</text>
  <path id="as4f6ec12-flow-secret-controller" d="M 645 342 L 645 388" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-0F766E)" />
  <text id="as4f6ec12-label-usedby" x="655" y="370" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start">used by</text>
  <path id="as4f6ec12-flow-decision-appset" d="M 385 186 L 385 290 L 150 290 L 150 388" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-0F766E)" />
  <text id="as4f6ec12-label-reads" x="162" y="282" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start">reads the decisions</text>
  <path id="as4f6ec12-flow-appset-application" d="M 242 440 L 286 440" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-C2410C)" />
  <path id="as4f6ec12-flow-application-controller" d="M 482 440 L 536 440" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-C2410C)" />
  <path id="as4f6ec12-flow-controller-proxy" d="M 752 430 L 796 430" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-C2410C)" />
  <text id="as4f6ec12-label-https" x="774" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#C2410C" text-anchor="middle">HTTPS</text>
  <circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="3.5" fill="#4B5563" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1068 462 L 974 462" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <rect id="as4f6ec12-bg-tunnel-label" x="974" y="472" width="96" height="30" fill="#FFFFFF" />
  <path id="as4f6ec12-flow-proxy-apiserver" d="M 970 430 L 1066 430" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-C2410C)" />
  <text id="as4f6ec12-label-requests" x="1014" y="421" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#C2410C" text-anchor="middle">API requests</text>
  <path id="as4f6ec12-tunnel-spoke-hub" d="M 1068 462 L 974 462" fill="none" stroke="#4B5563" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#as4f6ec12-arrow-4B5563)" />
  <text id="as4f6ec12-label-tunnel1" x="1022" y="484" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">tunnel opened</text>
  <text id="as4f6ec12-label-tunnel2" x="1022" y="498" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">by the spoke</text>
  <path id="as4f6ec12-fallback-controller-apiserver" d="M 645 490 L 645 522 L 1120 522 L 1120 492" fill="none" stroke="#4B5563" stroke-width="1.3" stroke-linejoin="round" stroke-dasharray="2 3" marker-end="url(#as4f6ec12-arrow-4B5563)" />
  <text id="as4f6ec12-label-fallback" x="635" y="516" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="end">fallback (no proxy): API server URL</text>
  <path id="as4f6ec12-flow-apiserver-resources" d="M 1215 390 L 1215 344" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#as4f6ec12-arrow-C2410C)" />
  <text id="as4f6ec12-label-applies" x="1225" y="370" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#C2410C" text-anchor="start">creates</text>
  <circle id="as4f6ec12-badge-1" cx="220" cy="120" r="11" fill="#1F2937" />
  <text id="as4f6ec12-badge-1-text" x="220" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
  <circle id="as4f6ec12-badge-2" cx="730" cy="120" r="11" fill="#1F2937" />
  <text id="as4f6ec12-badge-2-text" x="730" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
  <circle id="as4f6ec12-badge-3" cx="730" cy="252" r="11" fill="#1F2937" />
  <text id="as4f6ec12-badge-3-text" x="730" y="256.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
  <circle id="as4f6ec12-badge-4" cx="952" cy="416" r="11" fill="#1F2937" />
  <text id="as4f6ec12-badge-4-text" x="952" y="420.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
  <circle id="as4f6ec12-badge-5" cx="220" cy="412" r="11" fill="#1F2937" />
  <text id="as4f6ec12-badge-5-text" x="220" y="416.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
  <rect id="as4f6ec12-legend-you" x="40" y="594" width="22" height="14" rx="3" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="as4f6ec12-legend-you-text" x="70" y="606" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">created by you</text>
  <rect id="as4f6ec12-legend-acm" x="176" y="594" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-legend-acm-text" x="206" y="606" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by ACM</text>
  <rect id="as4f6ec12-legend-argo" x="336" y="594" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="as4f6ec12-legend-argo-text" x="366" y="606" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by Argo CD</text>
  <rect id="as4f6ec12-legend-platform" x="512" y="594" width="22" height="14" rx="3" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="as4f6ec12-legend-platform-text" x="542" y="606" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">platform component</text>
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 242 142 L 286 142" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 482 142 L 536 142" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.80s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 645 186 L 645 228" begin="indefinite" data-begin="0.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 645 342 L 645 388" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 385 186 L 385 290 L 150 290 L 150 388" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 242 440 L 286 440" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.60s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 482 440 L 536 440" begin="indefinite" data-begin="1.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.00s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 752 430 L 796 430" begin="indefinite" data-begin="2.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 970 430 L 1066 430" begin="indefinite" data-begin="2.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.80s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1215 390 L 1215 344" begin="indefinite" data-begin="2.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Push model: the hub Argo CD applies the resources to every managed cluster</div>
</div>

</div>
<div class="paragraph">
<p>What happens under the hood (the numbers refer to the diagram above):</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The <strong>Placement</strong> selects managed clusters, the result is stored in a <strong>PlacementDecision</strong>.</p>
</li>
<li>
<p>The <strong>GitOpsCluster</strong> controller reads the PlacementDecision and creates one Argo CD cluster secret per cluster in the Argo CD namespace, named <code>&lt;cluster-name&gt;-application-manager-cluster-secret</code>.</p>
</li>
<li>
<p>The token in the secret belongs to the <strong>ManagedServiceAccount</strong> <code>application-manager</code>. ACM rotates it automatically for you, and the cluster secret on the hub is updated when the token changes. <strong>No long-lived tokens</strong>.</p>
</li>
<li>
<p>The server URL in the cluster secret points to the <strong>cluster proxy</strong> of the multicluster engine. This is the default, because the <code>cluster-proxy</code> add-on is always enabled. Only if the cluster proxy is unavailable does ACM fall back to the API server URL of the managed cluster (OpenShift clusters only).</p>
</li>
<li>
<p>The <strong>ApplicationSet</strong> with the <code>clusterDecisionResource</code> generator creates one Application per cluster. <strong>The application-controller of the hub Argo CD reconciles all of them</strong>.</p>
</li>
</ol>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="paragraph">
<p>By default, the <code>application-manager</code> service account has <strong>cluster administrator</strong> permissions on the managed cluster. Everybody who can read secrets in the Argo CD namespace on the hub therefore effectively has cluster-admin on every registered managed cluster. Do not hand out the <code>admin</code> role for <code>openshift-gitops</code> lightly, and consider a customised service account (see below).</p>
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The consequences:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>One Argo CD to rule them all.</strong> One UI, one place to look, the full resource tree and live diff for every cluster.</p>
</li>
<li>
<p><strong>The hub carries the load.</strong> Every cluster adds watches and cache to the hub’s application-controller. With many clusters, the performance tuning from <a href="/gitopscollection/2026-03-27-openshift-gitops-performance-tuning/">Ep.16</a> becomes mandatory.</p>
</li>
<li>
<p><strong>No hub, no reconciliation.</strong> If the hub is down, nothing drifts back into the desired state on the spokes.</p>
</li>
<li>
<p><strong>Network:</strong> with the cluster proxy (default), the managed cluster opens the tunnel to the hub, so the hub does not need to reach the spoke API server directly. Only with the API-URL fallback must the hub reach the spoke’s API server.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_step_1_the_gitopscluster">Step 1: The GitOpsCluster</h3>
<div class="paragraph">
<p>The GitOpsCluster connects the Placement with the Argo CD instance. This now finally creates the Argo CD clusters on the hub. In the Argo CD UI, <em>Settings &gt; Clusters</em> should show the new clusters:</p>
</div>
<div class="listingblock linenums">
<div class="title">GitOpsCluster for the push model</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps.open-cluster-management.io/v1beta1
kind: GitOpsCluster
metadata:
  name: gitops-production
  namespace: openshift-gitops
spec:
  argoServer:
    cluster: local-cluster <i class="conum" data-value="1"></i><b>(1)</b>
    argoNamespace: openshift-gitops <i class="conum" data-value="2"></i><b>(2)</b>
  placementRef:
    kind: Placement
    apiVersion: cluster.open-cluster-management.io/v1beta1
    name: production-clusters <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The name of the local cluster, where Argo CD runs. On a default hub this is <code>local-cluster</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The namespace of the Argo CD instance.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The Placement from the prerequisites.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify that ACM created the cluster secrets:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get gitopscluster gitops-production -n openshift-gitops -o yaml
oc get secrets -n openshift-gitops -l argocd.argoproj.io/secret-type=cluster</code></pre>
</div>
</div>
<div class="paragraph">
<p>You should see one <code>&lt;cluster-name&gt;-application-manager-cluster-secret</code> per selected cluster.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">NAME                                        TYPE     DATA   AGE
bm-application-manager-cluster-secret       Opaque   3      32s
cluster-kubernetes.default.svc-3396314289   Opaque   3      10h
sno-application-manager-cluster-secret      Opaque   3      32s</code></pre>
</div>
</div>
<div class="paragraph">
<p>The clusters also appear in the Argo CD UI under <em>Settings &gt; Clusters</em>.
The API URL is the cluster proxy URL:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/gitopscluster-cluster-secrets.png" alt="GitOpsCluster cluster secrets"/>
</div>
<div class="title">Figure 2. GitOpsCluster cluster secrets</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The connection status is unknown because the cluster has no Argo CD Applications yet.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_2_the_applicationset">Step 2: The ApplicationSet</h3>
<div class="paragraph">
<p>For the ApplicationSet we use the <a href="https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Cluster-Decision-Resource/" rel="noopener" target="_blank"><strong>clusterDecisionResource</strong></a> generator. It reads the PlacementDecision directly, so the list of clusters always reflects the current state of the fleet. The generator requires a ConfigMap that tells it how to read PlacementDecisions. The GitOpsCluster controller creates it automatically under the name <code>acm-placement</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get configmap acm-placement -n openshift-gitops -o yaml</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">data:
  apiVersion: cluster.open-cluster-management.io/v1beta1 <i class="conum" data-value="1"></i><b>(1)</b>
  kind: placementdecisions
  statusListKey: decisions <i class="conum" data-value="2"></i><b>(2)</b>
  matchKey: clusterName <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The PlacementDecision API.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The list in the PlacementDecision status that holds the selected clusters.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The field in each list entry that is matched against the <code>name</code> of the Argo CD cluster secret.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>With this information we can create the ApplicationSet using our Compliance Operator as example:</p>
</div>
<div class="listingblock linenums">
<div class="title">ApplicationSet for the push model</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: compliance-operator
  namespace: openshift-gitops
spec:
  generators:
    - clusterDecisionResource:
        configMapRef: acm-placement <i class="conum" data-value="1"></i><b>(1)</b>
        labelSelector:
          matchLabels:
            cluster.open-cluster-management.io/placement: production-clusters <i class="conum" data-value="2"></i><b>(2)</b>
        requeueAfterSeconds: 180 <i class="conum" data-value="3"></i><b>(3)</b>
  template:
    metadata:
      name: &#39;compliance-operator-{{name}}&#39; <i class="conum" data-value="4"></i><b>(4)</b>
    spec:
      project: default
      source:
        repoURL: https://github.com/tjungbauer/openshift-clusterconfig-gitops.git
        targetRevision: main
        path: &#39;clusters/{{name}}/setup-compliance-operator&#39; <i class="conum" data-value="5"></i><b>(5)</b>
      destination:
        server: &#39;{{server}}&#39; <i class="conum" data-value="6"></i><b>(6)</b>
      syncPolicy:
        automated: <i class="conum" data-value="7"></i><b>(7)</b>
          prune: true
          selfHeal: true
  syncPolicy:
    preserveResourcesOnDeletion: true <i class="conum" data-value="8"></i><b>(8)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The ConfigMap created by the GitOpsCluster controller.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The name of our Placement.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>How often the generator re-reads the PlacementDecision (in seconds).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Create the name for the Application based on the cluster name.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The path to the Compliance Operator setup in the Git repository. Each cluster has its own path in the Git repository.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The server URL from the cluster secret, usually the cluster proxy URL.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Automated sync policy for the Application.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>If a cluster leaves the Placement, the generated Application is removed. With this setting, the deployed resources on that cluster are kept.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In Argo CD we can see the ApplicationSet which automatically created two Applications, one for each (selected) cluster:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/argocd-applicationset-compliance-operator.png" alt="ApplicationSet Applications"/>
</div>
<div class="title">Figure 3. ApplicationSet Applications in Argo CD</div>
</div>
<div class="paragraph">
<p>The Applications have been automatically synced by the hub Argo CD (because we configured it to do so).</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/argocd-applications-compliance-operator.png" alt="ApplicationSet Applications synced"/>
</div>
<div class="title">Figure 4. ApplicationSet Applications synced in Argo CD</div>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
The ApplicationSet created the Applications which were immediately synced by the hub Argo CD. They installed and configured the Compliance Operator on the two managed clusters: <code>bm</code> and <code>sno</code>.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_why_is_this_nice">Why is this nice?</h3>
<div class="paragraph">
<p>Compare this with manually maintained cluster secrets: no tokens, no rotation scripts. Label a new cluster with <code>vendor=OpenShift</code>, add it to the cluster set <code>production</code>, and within a few minutes it has its Application. Detach a cluster from ACM and the Application disappears. You do not need to maintain the cluster secrets manually.</p>
</div>
</div>
<div class="sect2">
<h3 id="_what_to_watch_out_for">What to watch out for</h3>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Think about <code>prune: true</code> together with dynamic Placements. Without <code>preserveResourcesOnDeletion</code>, removing a cluster from the Placement (for example by changing a label) can delete the deployed resources on that cluster. Use it for everything that holds data or that the cluster cannot live without.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_least_privilege_a_customised_service_account">Least privilege: a customised service account</h3>
<div class="paragraph">
<p>For platform configuration, the ServiceAccount <code>application-manager</code> with cluster-admin is often acceptable: the Argo CD instance <em>is</em> the cluster administrator. For application teams it is too much. ACM lets you replace it with your own <strong>ManagedServiceAccount</strong> and grant it exactly the permissions you want with a <strong>ClusterPermission</strong>. Both resources are created in the namespace of the managed cluster on the hub:</p>
</div>
<div class="listingblock linenums">
<div class="title">ManagedServiceAccount and ClusterPermission for one managed cluster</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: authentication.open-cluster-management.io/v1alpha1
kind: ManagedServiceAccount
metadata:
  name: argocd-deployer
  namespace: sno <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  rotation: {} <i class="conum" data-value="2"></i><b>(2)</b>
---
apiVersion: rbac.open-cluster-management.io/v1alpha1
kind: ClusterPermission
metadata:
  name: argocd-deployer
  namespace: sno
spec:
  roles: <i class="conum" data-value="3"></i><b>(3)</b>
    - namespace: shop
      rules:
        - apiGroups: [&#34;apps&#34;]
          resources: [&#34;deployments&#34;]
          verbs: [&#34;get&#34;, &#34;list&#34;, &#34;watch&#34;, &#34;create&#34;, &#34;update&#34;, &#34;patch&#34;, &#34;delete&#34;]
        - apiGroups: [&#34;&#34;]
          resources: [&#34;services&#34;, &#34;configmaps&#34;]
          verbs: [&#34;get&#34;, &#34;list&#34;, &#34;watch&#34;, &#34;create&#34;, &#34;update&#34;, &#34;patch&#34;, &#34;delete&#34;]
  roleBindings:
    - namespace: shop
      roleRef:
        kind: Role
      subject:
        apiGroup: authentication.open-cluster-management.io
        kind: ManagedServiceAccount
        name: argocd-deployer
  clusterRole: <i class="conum" data-value="4"></i><b>(4)</b>
    rules:
      - apiGroups: [&#34;*&#34;]
        resources: [&#34;*&#34;]
        verbs: [&#34;get&#34;, &#34;list&#34;, &#34;watch&#34;]
  clusterRoleBinding:
    subject:
      apiGroup: authentication.open-cluster-management.io
      kind: ManagedServiceAccount
      name: argocd-deployer</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The namespace of the managed cluster on the hub. The service account is created on that cluster.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Let ACM rotate the token.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Write permissions only in the namespace <code>shop</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Read-only access to the rest of the cluster, so that Argo CD can discover API resources and show health.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Then reference the service account in the GitOpsCluster:</p>
</div>
<div class="listingblock linenums">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps.open-cluster-management.io/v1beta1
kind: GitOpsCluster
metadata:
  name: gitops-team-shop
  namespace: openshift-gitops
spec:
  managedServiceAccountRef: argocd-deployer <i class="conum" data-value="1"></i><b>(1)</b>
  argoServer:
    cluster: local-cluster
    argoNamespace: openshift-gitops
  placementRef:
    kind: Placement
    apiVersion: cluster.open-cluster-management.io/v1beta1
    name: production-clusters</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Use this ManagedServiceAccount instead of <code>application-manager</code>. The cluster secrets are now named <code>&lt;cluster-name&gt;-argocd-deployer-cluster-secret</code>.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The <code>ManagedServiceAccount</code> and the <code>ClusterPermission</code> must exist for <strong>every</strong> cluster of the Placement. Creating them by hand does not scale and is not GitOps-like.</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_pull_model">The pull model</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_what_it_actually_is_2">What it actually is</h3>
<div class="paragraph">
<p>The <strong>pull model</strong> turns the direction around. The Application is still <em>defined</em> on the hub, but the hub does not reconcile it. Instead, ACM transports the Application object itself to the managed cluster, where a <strong>local Argo CD instance</strong> does the actual work.</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg width="1480" height="690" viewBox="0 0 1480 690" role="img" aria-label="Pull model: the ApplicationSet on the hub generates Applications that the hub Argo CD ignores. The propagation controller wraps each Application into a ManifestWork in the cluster namespace, the work agent on the managed cluster pulls it and creates the Application, and the local Argo CD reconciles it. Status returns through the ManifestWork and ACM search into the MulticlusterApplicationSetReport" version="1.1" id="asdf83d23-svg-pull-model" xmlns="http://www.w3.org/2000/svg" xmlns:c2pa="http://c2pa.org/manifest">
  <title id="asdf83d23-title-pull-model">Pull model: the ApplicationSet on the hub generates Applications that the hub Argo CD ignores. The propagation controller wraps each Application into a ManifestWork in the cluster namespace, the work agent on the managed cluster pulls it and creates the Application, and the local Argo CD reconciles it. Status returns through the ManifestWork and ACM search into the MulticlusterApplicationSetReport</title>
  <defs id="asdf83d23-defs-pull-model">
    <marker id="asdf83d23-arrow-0F766E" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#0F766E" id="asdf83d23-marker-path-0F766E" /></marker>
    <marker id="asdf83d23-arrow-C2410C" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#C2410C" id="asdf83d23-marker-path-C2410C" /></marker>
    <marker id="asdf83d23-arrow-4B5563" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#4B5563" id="asdf83d23-marker-path-4B5563" /></marker>
    </defs>
  <rect id="asdf83d23-bg" width="1480" height="690" fill="#FFFFFF" />
  <rect id="asdf83d23-zone-hub" x="20" y="20" width="1090" height="620" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asdf83d23-label-hub" x="40" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">HUB</text>
  <rect id="asdf83d23-zone-spoke" x="1140" y="20" width="320" height="620" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asdf83d23-label-spoke" x="1160" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">MANAGED CLUSTER  ·  bm, sno</text>
  <rect id="asdf83d23-ns-gitops" x="40" y="60" width="580" height="430" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="asdf83d23-label-ns" x="56" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#C2410C" text-anchor="start">openshift-gitops</text>
  <rect id="asdf83d23-ns-ocm" x="640" y="60" width="260" height="430" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="asdf83d23-label-ns-ocm" x="656" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">open-cluster-management</text>
  <text id="asdf83d23-label-pod" x="656" y="478" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="400" fill="#4B5563" text-anchor="start">all three in the pod multicluster-integrations</text>
  <rect id="asdf83d23-ns-cluster" x="920" y="60" width="170" height="180" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="asdf83d23-label-ns-cluster" x="936" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">cluster namespaces</text>
  <rect id="asdf83d23-rect-appset" x="60" y="110" width="190" height="110" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdf83d23-title-appset" x="76" y="139" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">ApplicationSet</text>
  <text id="asdf83d23-line0-appset" x="76" y="162" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">generator:</text>
  <text id="asdf83d23-line1-appset" x="76" y="178" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">clusterDecisionResource</text>
  <text id="asdf83d23-line2-appset" x="76" y="194" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">with pull annotations</text>
  <circle id="asdf83d23-badge-1" cx="230" cy="130" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-1-text" x="230" y="134.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
  <rect id="asdf83d23-rect-application" x="270" y="110" width="190" height="110" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-application" x="286" y="139" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Application</text>
  <text id="asdf83d23-line0-application" x="286" y="162" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">one per selected cluster</text>
  <text id="asdf83d23-line1-application" x="286" y="178" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4B5563" text-anchor="start">skip-reconcile: true</text>
  <text id="asdf83d23-line2-application" x="286" y="194" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">hub Argo CD ignores it</text>
  <circle id="asdf83d23-badge-2" cx="440" cy="130" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-2-text" x="440" y="134.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
  <rect id="asdf83d23-rect-report" x="300" y="250" width="305" height="96" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-report" x="316" y="279" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">MulticlusterApplicationSetReport</text>
  <text id="asdf83d23-line0-report" x="316" y="302" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">sync and health per cluster,</text>
  <text id="asdf83d23-line1-report" x="316" y="318" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">aggregated, not real-time</text>
  <rect id="asdf83d23-rect-placement" x="60" y="380" width="170" height="84" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdf83d23-title-placement" x="76" y="409" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Placement</text>
  <text id="asdf83d23-line0-placement" x="76" y="432" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">production-clusters</text>
  <rect id="asdf83d23-rect-decision" x="256" y="380" width="180" height="84" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-decision" x="272" y="409" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">PlacementDecision</text>
  <text id="asdf83d23-line0-decision" x="272" y="432" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">decisions: bm, sno</text>
  <rect id="asdf83d23-rect-secret" x="460" y="380" width="145" height="84" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-secret" x="476" y="409" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Cluster secret</text>
  <text id="asdf83d23-line0-secret" x="476" y="432" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">required, but</text>
  <text id="asdf83d23-line1-secret" x="476" y="448" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">not used to deploy</text>
  <rect id="asdf83d23-rect-propagation" x="656" y="110" width="228" height="110" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdf83d23-title-propagation" x="672" y="139" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">propagation</text>
  <text id="asdf83d23-line0-propagation" x="672" y="162" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">controller</text>
  <text id="asdf83d23-line1-propagation" x="672" y="178" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">wraps each Application</text>
  <text id="asdf83d23-line2-propagation" x="672" y="194" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">into a ManifestWork</text>
  <circle id="asdf83d23-badge-3" cx="864" cy="130" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-3-text" x="864" y="134.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
  <rect id="asdf83d23-rect-aggregation" x="656" y="250" width="228" height="96" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdf83d23-title-aggregation" x="672" y="279" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">aggregation</text>
  <text id="asdf83d23-line0-aggregation" x="672" y="302" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">controller</text>
  <text id="asdf83d23-line1-aggregation" x="672" y="318" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">builds the report</text>
  <circle id="asdf83d23-badge-6" cx="864" cy="270" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-6-text" x="864" y="274.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">6</text>
  <rect id="asdf83d23-rect-sync" x="656" y="370" width="228" height="96" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdf83d23-title-sync" x="672" y="399" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">resource sync</text>
  <text id="asdf83d23-line0-sync" x="672" y="422" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">controller</text>
  <text id="asdf83d23-line1-sync" x="672" y="438" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">queries ACM search, 10 s</text>
  <rect id="asdf83d23-rect-manifestwork" x="936" y="110" width="138" height="110" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-manifestwork" x="952" y="139" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">ManifestWork</text>
  <text id="asdf83d23-line0-manifestwork" x="952" y="162" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">in namespace</text>
  <text id="asdf83d23-line1-manifestwork" x="952" y="178" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#4B5563" text-anchor="start">sno or bm</text>
  <text id="asdf83d23-line2-manifestwork" x="952" y="194" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">wraps the App</text>
  <rect id="asdf83d23-rect-agent" x="1160" y="110" width="280" height="110" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdf83d23-title-agent" x="1176" y="139" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">work agent</text>
  <text id="asdf83d23-line0-agent" x="1176" y="162" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">part of the klusterlet,</text>
  <text id="asdf83d23-line1-agent" x="1176" y="178" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">creates the Application</text>
  <text id="asdf83d23-line2-agent" x="1176" y="194" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">from the ManifestWork</text>
  <circle id="asdf83d23-badge-4" cx="1420" cy="130" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-4-text" x="1420" y="134.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
  <rect id="asdf83d23-rect-spoke-app" x="1160" y="250" width="280" height="84" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-spoke-app" x="1176" y="279" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Application</text>
  <text id="asdf83d23-line0-spoke-app" x="1176" y="302" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">in openshift-gitops on the spoke</text>
  <rect id="asdf83d23-rect-local-argo" x="1160" y="370" width="280" height="96" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="asdf83d23-title-local-argo" x="1176" y="399" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Local Argo CD</text>
  <text id="asdf83d23-line0-local-argo" x="1176" y="422" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">application-controller</text>
  <text id="asdf83d23-line1-local-argo" x="1176" y="438" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">pulls Git, reconciles locally</text>
  <circle id="asdf83d23-badge-5" cx="1420" cy="390" r="11" fill="#1F2937" />
  <text id="asdf83d23-badge-5-text" x="1420" y="394.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
  <rect id="asdf83d23-rect-resources" x="1160" y="500" width="280" height="84" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-title-resources" x="1176" y="529" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Resources</text>
  <text id="asdf83d23-line0-resources" x="1176" y="552" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">applied by the local Argo CD</text>
  <path id="asdf83d23-flow-placement-decision" d="M 232 422 L 252 422" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <path id="asdf83d23-flow-decision-appset" d="M 345 378 L 345 362 L 150 362 L 150 224" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <text id="asdf83d23-label-reads" x="160" y="356" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start">reads the decisions</text>
  <path id="asdf83d23-flow-appset-application" d="M 252 165 L 266 165" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <path id="asdf83d23-flow-application-propagation" d="M 462 165 L 652 165" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <text id="asdf83d23-label-watches" x="557" y="156" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#C2410C" text-anchor="middle">ocm-managed-cluster</text>
  <path id="asdf83d23-flow-propagation-manifestwork" d="M 886 165 L 932 165" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="3.5" fill="#4B5563" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1158 180 L 1078 180" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <rect id="asdf83d23-bg-pull-label" x="1092" y="190" width="60" height="32" rx="0" fill="#F8FAFC" stroke="#F8FAFC" stroke-width="0" />
  <path id="asdf83d23-flow-manifestwork-agent" d="M 1076 150 L 1156 150" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <text id="asdf83d23-label-app" x="1116" y="141" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#C2410C" text-anchor="middle">Application</text>
  <path id="asdf83d23-pull-spoke-hub" d="M 1158 180 L 1078 180" fill="none" stroke="#4B5563" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdf83d23-arrow-4B5563)" />
  <text id="asdf83d23-label-pull1" x="1118" y="202" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">pulled by</text>
  <text id="asdf83d23-label-pull2" x="1118" y="216" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">the spoke</text>
  <path id="asdf83d23-flow-agent-app" d="M 1300 222 L 1300 246" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <path id="asdf83d23-flow-app-argo" d="M 1300 336 L 1300 366" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <path id="asdf83d23-flow-argo-resources" d="M 1300 468 L 1300 496" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdf83d23-arrow-C2410C)" />
  <text id="asdf83d23-label-applies" x="1310" y="488" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#C2410C" text-anchor="start">applies</text>
  <path id="asdf83d23-status-manifestwork" d="M 1005 222 L 1005 298 L 888 298" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <text id="asdf83d23-label-mw-status" x="1015" y="270" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">ManifestWork</text>
  <text id="asdf83d23-label-mw-status2" x="1015" y="284" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">status</text>
  <path id="asdf83d23-status-search" d="M 1156 418 L 888 418" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <text id="asdf83d23-label-search" x="1022" y="409" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="middle">ACM search: resources, errors</text>
  <path id="asdf83d23-status-sync-aggregation" d="M 770 368 L 770 350" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <path id="asdf83d23-status-aggregation-report" d="M 654 298 L 609 298" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdf83d23-arrow-0F766E)" />
  <text id="asdf83d23-note-hub1" x="40" y="530" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">The hub Argo CD only generates the Applications:</text>
  <text id="asdf83d23-note-hub2" x="40" y="548" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">reconciliation happens on every spoke, with its own OpenShift GitOps.</text>
  <text id="asdf83d23-note-hub3" x="40" y="566" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">No hub, still reconciliation. All connections are opened by the spoke.</text>
  <text id="asdf83d23-note-hub4" x="40" y="594" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="start">Dashed arrows: status back to the hub.</text>
  <rect id="asdf83d23-legend-you" x="40" y="664" width="22" height="14" rx="3" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdf83d23-legend-you-text" x="70" y="676" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">created by you</text>
  <rect id="asdf83d23-legend-acm" x="194.609375" y="664" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-legend-acm-text" x="224.609375" y="676" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by ACM</text>
  <rect id="asdf83d23-legend-argo" x="370.5625" y="664" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdf83d23-legend-argo-text" x="400.5625" y="676" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by Argo CD</text>
  <rect id="asdf83d23-legend-platform" x="566.984375" y="664" width="22" height="14" rx="3" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.6" />
  <text id="asdf83d23-legend-platform-text" x="596.984375" y="676" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">platform component</text>
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 232 422 L 252 422" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 345 378 L 345 362 L 150 362 L 150 224" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.80s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 252 165 L 266 165" begin="indefinite" data-begin="0.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 462 165 L 652 165" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.60s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 886 165 L 932 165" begin="indefinite" data-begin="1.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.00s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1076 150 L 1156 150" begin="indefinite" data-begin="2.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1300 222 L 1300 246" begin="indefinite" data-begin="2.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.80s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1300 336 L 1300 366" begin="indefinite" data-begin="2.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.20s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1300 468 L 1300 496" begin="indefinite" data-begin="3.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.60s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1005 222 L 1005 298 L 888 298" begin="indefinite" data-begin="3.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.60s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1156 418 L 888 418" begin="indefinite" data-begin="3.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:4.00s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 770 368 L 770 350" begin="indefinite" data-begin="4.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:4.40s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 654 298 L 609 298" begin="indefinite" data-begin="4.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Pull model: the hub ships the Application, the local Argo CD reconciles it</div>
</div>

</div>
<div class="paragraph">
<p>What happens under the hood:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The ApplicationSet on the hub generates an Application per cluster, just as in the push model.</p>
</li>
<li>
<p>The generated Application carries the label <code>apps.open-cluster-management.io/pull-to-ocm-managed-cluster: &#34;true&#34;</code> and the annotation <code>argocd.argoproj.io/skip-reconcile: &#34;true&#34;</code>. The latter tells the hub Argo CD to ignore it.</p>
</li>
<li>
<p>The <strong>propagation controller</strong> on the hub picks up every Application with the annotation <code>apps.open-cluster-management.io/ocm-managed-cluster</code>. It wraps the Application into a <strong>ManifestWork</strong> in the namespace of the target cluster. We are still on the hub cluster at this point.</p>
</li>
<li>
<p>The <strong>work agent</strong> on the managed cluster (part of the regular ACM klusterlet) pulls the ManifestWork and creates the Application in the <code>openshift-gitops</code> namespace of the managed cluster.</p>
</li>
<li>
<p>The <strong>local Argo CD on the managed cluster</strong> pulls Git and reconciles the Application against its own API server.</p>
</li>
<li>
<p>The status travels back in two ways: the ManifestWork reports the status of the Application object, and the <strong>resource sync controller</strong> queries the ACM search component on each managed cluster for the resource list and error messages. The <strong>aggregation controller</strong> combines both into a <strong>MulticlusterApplicationSetReport</strong> per ApplicationSet.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>All three controllers run as containers in the <code>multicluster-integrations</code> pod in the <code>open-cluster-management</code> namespace on the hub. The resource sync and aggregation controllers run every 10 seconds.</p>
</div>
<div class="paragraph">
<p>The consequences:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>The spokes do the work.</strong> The hub only creates ManifestWorks, which scales much better than one controller watching every cluster.</p>
</li>
<li>
<p><strong>The hub never connects to the spoke APIs.</strong> All connections are initiated by the managed cluster (the klusterlet of ACM does that anyway). Perfect for firewalls that only allow outbound traffic from the spoke.</p>
</li>
<li>
<p><strong>No hub, still reconciliation.</strong> If the hub goes away, the local Argo CD keeps self-healing with the last known Application.</p>
</li>
<li>
<p><strong>Limited visibility.</strong> The status on the hub is not real-time and not complete. Resources that failed to deploy are not part of the resource list, only the error messages show them. For details, you have to look at the Argo CD of the spoke.</p>
</li>
<li>
<p><strong>An Argo CD per cluster.</strong> Every managed cluster runs a full OpenShift GitOps instance, needs access to Git and its own repository credentials, and must be installed, updated and given the right permissions.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The ACM documentation lists the requirements for the pull model:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenShift GitOps installed on the hub <strong>and</strong> on every target managed cluster, in the namespace <code>openshift-gitops</code>.</p>
</li>
<li>
<p>OpenShift GitOps on the hub in version 1.9.0 or later, and <strong>equal to or newer than</strong> the version on the managed clusters.</p>
</li>
<li>
<p>A cluster secret per managed cluster on the hub, created by a GitOpsCluster. The ApplicationSet generator matches the PlacementDecision against these secrets, even if the hub never uses them to deploy.</p>
</li>
</ul>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
So the GitOpsCluster and the Placement from the push model are needed here as well.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_1_openshift_gitops_on_the_managed_clusters">Step 1: OpenShift GitOps on the managed clusters</h3>
<div class="paragraph">
<p>There are two ways to get a local Argo CD onto every spoke.</p>
</div>
<div class="sect3">
<h4 id="_option_a_the_gitops_add_on_in_basic_mode">Option A: the GitOps add-on in Basic mode</h4>
<div class="paragraph">
<p>The GitOpsCluster can install OpenShift GitOps automatically for you. Simply enable the add-on:</p>
</div>
<div class="listingblock linenums">
<div class="title">GitOpsCluster with the GitOps add-on in Basic mode</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps.open-cluster-management.io/v1beta1
kind: GitOpsCluster
metadata:
  name: gitops-production
  namespace: openshift-gitops
spec:
  argoServer:
    argoNamespace: openshift-gitops
  placementRef:
    kind: Placement
    apiVersion: cluster.open-cluster-management.io/v1beta1
    name: production-clusters
    namespace: openshift-gitops
  gitopsAddon:
    enabled: true <i class="conum" data-value="1"></i><b>(1)</b>
    overrideExistingConfigs: false <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Basic mode: deploys the OpenShift GitOps Operator into <code>openshift-gitops-operator</code> and an Argo CD instance into <code>openshift-gitops</code> on every selected cluster.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Safety feature: do not overwrite existing Argo CD configurations on the managed clusters.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>When we update the GitOpsCluster resource, that we have created in the previous chapter, the managed clusters will start to install OpenShift GitOps. The Argo CD instance <code>acm-openshift-gitops</code> will be created in the namespace <code>openshift-gitops</code>.</p>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
This is by far the easiest way to get a local Argo CD onto every spoke as you need to configure the GitOpsCluster resource anyway. This automatically creates an ACM policy <code>gitops-production-argocd-policy</code> that manages the Argo CD resource on the spokes.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>Enabling the GitOps add-on through a GitOpsCluster <strong>disables the push model for all applications</strong>. This is a fleet-wide decision. If you need push and pull side by side, use option B.</p>
</li>
<li>
<p>The Basic mode is supported for <strong>OpenShift</strong> managed clusters only.</p>
</li>
<li>
<p>To customise the ArgoCD resource on a single spoke without the add-on reverting it, annotate it with <code>gitops-addon.open-cluster-management.io/skip: &#34;true&#34;</code>.</p>
</li>
</ul>
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify the add-on:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># on a managed cluster
oc get pods -n open-cluster-management-agent-addon
oc get pods -n openshift-gitops-operator
oc get pods -n openshift-gitops</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_option_b_your_own_policy">Option B: your own policy</h4>
<div class="paragraph">
<p>If you want better control over the operator version, or you need the push model as well, install OpenShift GitOps with your <strong>own policy</strong>. This is the same OperatorPolicy pattern as in <a href="/gitopscollection/2026-10-20-openshift-gitops-vs-acm/#_option_2_acm_with_an_operatorpolicy">Ep.18</a>:</p>
</div>
<div class="listingblock linenums">
<div class="title">Policy that installs OpenShift GitOps on the managed clusters</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: openshift-gitops-spoke
  namespace: acm-policies
spec:
  remediationAction: enforce <i class="conum" data-value="1"></i><b>(1)</b>
  disabled: false
  policy-templates:
    - objectDefinition: <i class="conum" data-value="2"></i><b>(2)</b>
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: openshift-gitops-operator-namespace
        spec:
          severity: high
          object-templates:
            - complianceType: musthave
              objectDefinition:
                apiVersion: v1
                kind: Namespace
                metadata:
                  name: openshift-gitops-operator
    - objectDefinition: <i class="conum" data-value="3"></i><b>(3)</b>
        apiVersion: policy.open-cluster-management.io/v1beta1
        kind: OperatorPolicy
        metadata:
          name: openshift-gitops-operator
        spec:
          severity: high
          complianceType: musthave
          subscription:
            name: openshift-gitops-operator
            namespace: openshift-gitops-operator
            channel: gitops-1.22 <i class="conum" data-value="4"></i><b>(4)</b>
            source: redhat-operators
            sourceNamespace: openshift-marketplace
          upgradeApproval: Automatic</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Enforce the policy.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Create the namespace <code>openshift-gitops-operator</code> on the managed clusters.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Install the OpenShift GitOps Operator.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Pin the channel. The hub must run the same or a newer OpenShift GitOps version than the spokes, so upgrade the hub first.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This installs the Namespace and the Operator, the Argo CD instance is created automatically by the Operator.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Bind the policy with a Placement and a PlacementBinding in <code>acm-policies</code>, using the same label selector as the GitOps Placement, so that every cluster that should receive pull Applications also receives a local Argo CD. See above for examples.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_2_permissions_for_the_local_argo_cd">Step 2: Permissions for the local Argo CD</h3>
<div class="paragraph">
<p>Now with Argo CD deployed on the managed cluster, the local application-controller must be allowed to create whatever the Applications contain. Without that, syncs fail with <code>forbidden</code> errors for the service account <code>openshift-gitops-argocd-application-controller</code>. The ACM documentation offers two ways:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Cluster administrator</strong>: a ClusterRoleBinding on every managed cluster. Simple, and for platform configuration usually what you want. For example, to install a new Operator.</p>
</li>
<li>
<p><strong>Least privilege</strong>: create every destination namespace on the managed cluster with the label <code>argocd.argoproj.io/managed-by: openshift-gitops</code>. The OpenShift GitOps Operator then grants the local instance admin rights in exactly these namespaces. The namespaces must be declared in Git, as part of the Application.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>For option 1, add the ClusterRoleBinding to the policy that manages the spokes (the <code>&lt;gitopscluster-name&gt;-argocd-policy</code> from option A or your own policy from option B):</p>
</div>
<div class="listingblock linenums">
<div class="title">Policy template granting the local controller cluster-admin</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: openshift-gitops-controller-rbac
        spec:
          severity: high
          object-templates:
            - complianceType: musthave
              objectDefinition:
                apiVersion: rbac.authorization.k8s.io/v1
                kind: ClusterRoleBinding
                metadata:
                  name: argo-admin
                subjects:
                  - kind: ServiceAccount
                    name: openshift-gitops-argocd-application-controller
                    namespace: openshift-gitops
                roleRef:
                  apiGroup: rbac.authorization.k8s.io
                  kind: ClusterRole
                  name: cluster-admin</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_3_the_applicationset_for_the_pull_model">Step 3: The ApplicationSet for the pull model</h3>
<div class="paragraph">
<p>The ApplicationSet uses the same generator as the push model: <code>clusterDecisionResource</code>. The template gets a label and three annotations, and the destination changes.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The Compliance Operator is already installed on <code>sno</code> and <code>bm</code> by the push model. To keep the two models from fighting over the same objects, the pull example deploys something else: the console branding from the folder <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/branding" rel="noopener" target="_blank">clusters/&lt;cluster&gt;/branding</a> of my GitOps repository.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">ApplicationSet for the pull model</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: branding-pull
  namespace: openshift-gitops
spec:
  generators:
    - clusterDecisionResource:
        configMapRef: acm-placement
        labelSelector:
          matchLabels:
            cluster.open-cluster-management.io/placement: production-clusters
        requeueAfterSeconds: 180
  template:
    metadata:
      name: &#39;branding-{{name}}&#39;
      labels:
        apps.open-cluster-management.io/pull-to-ocm-managed-cluster: &#39;true&#39; <i class="conum" data-value="1"></i><b>(1)</b>
      annotations:
        argocd.argoproj.io/skip-reconcile: &#39;true&#39; <i class="conum" data-value="2"></i><b>(2)</b>
        apps.open-cluster-management.io/ocm-managed-cluster: &#39;{{name}}&#39; <i class="conum" data-value="3"></i><b>(3)</b>
        apps.open-cluster-management.io/ocm-managed-cluster-app-namespace: openshift-gitops <i class="conum" data-value="4"></i><b>(4)</b>
    spec:
      project: default <i class="conum" data-value="5"></i><b>(5)</b>
      source:
        repoURL: https://github.com/tjungbauer/openshift-clusterconfig-gitops.git
        targetRevision: main
        path: &#39;clusters/{{name}}/branding&#39; <i class="conum" data-value="6"></i><b>(6)</b>
      destination:
        server: https://kubernetes.default.svc <i class="conum" data-value="7"></i><b>(7)</b>
      syncPolicy:
        automated:
          prune: true
          selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Marks the Application as a pull model Application.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Prevents the Argo CD instance on the hub from reconciling the Application itself.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The target managed cluster. The propagation controller only processes Applications with this annotation.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The namespace on the managed cluster where the Application is created, i.e. the namespace of the local Argo CD.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The AppProject must exist <strong>on the managed cluster</strong>. The default instance always has <code>default</code>. Custom projects, and the repository credentials for private repositories, have to be created on the spokes, for example by another policy.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>One folder per cluster: <code>clusters/sno/branding</code> and <code>clusters/bm/branding</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>From the perspective of the local Argo CD on the spoke, the destination is the cluster it runs on.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
<div class="paragraph">
<p>Do not forget the <code>skip-reconcile</code> annotation. Without it, the hub Argo CD tries to sync the Application to <code><a class="bare" href="https://kubernetes.default.svc">https://kubernetes.default.svc</a></code>, which is the <strong>hub</strong> itself. You would deploy the configuration of every managed cluster onto the hub.</p>
</div>
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_4_verify_the_flow">Step 4: Verify the flow</h3>
<div class="paragraph">
<p>Follow the Application through the chain. First, the Applications on the hub, which are not reconciled there:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get applications -n openshift-gitops -l apps.open-cluster-management.io/pull-to-ocm-managed-cluster=true</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then the ManifestWork the propagation controller created in the namespace of one managed cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get manifestwork -n sno</code></pre>
</div>
</div>
<div class="paragraph">
<p>On the managed cluster, the Application now exists and is reconciled by the local Argo CD:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get applications -n openshift-gitops</code></pre>
</div>
</div>
<div class="paragraph">
<p>Back on the hub, the aggregated status per ApplicationSet:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get multiclusterapplicationsetreports -n openshift-gitops
oc get multiclusterapplicationsetreport branding-pull -n openshift-gitops -o yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The report lists the sync and health status per cluster and a summary. A shortened example with one failing cluster:</p>
</div>
<div class="listingblock linenums">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps.open-cluster-management.io/v1alpha1
kind: MulticlusterApplicationSetReport
metadata:
  name: branding-pull
  namespace: openshift-gitops
statuses:
  clusterConditions:
    - cluster: sno
      healthStatus: Healthy
      syncStatus: Synced
    - cluster: bm
      healthStatus: Missing
      syncStatus: OutOfSync
      conditions:
        - type: SyncError
          message: &#39;Failed sync attempt: ... is forbidden: User &#34;system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller&#34; cannot create resource ...&#39;
  summary:
    clusters: &#34;2&#34;
    healthy: &#34;1&#34;
    notHealthy: &#34;1&#34;
    synced: &#34;1&#34;
    notSynced: &#34;1&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <code>forbidden</code> message in the example is the most common error with the pull model: the local controller is missing permissions (step 2). The report is the first place to look. For the details, go to the Argo CD of the spoke: it has the full conditions and events.</p>
</div>
</div>
<div class="sect2">
<h3 id="_the_visibility_trade_off">The visibility trade-off</h3>
<div class="paragraph">
<p>The pull model has one weak spot: <strong>visibility</strong>. The hub only gets an aggregated and delayed status. The hub cluster never connects directly to the spoke clusters and therefore never sees the full resource tree.</p>
</div>
<div class="paragraph">
<p>The result is the following:</p>
</div>
<div class="paragraph">
<p>While the ApplicationSet in the hub shows a healthy sync status:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/pull-argocd-applicationset-branding-pull.png" alt="Pull Model ApplicationSet"/>
</div>
<div class="title">Figure 5. ApplicationSet in the hub shows a healthy sync status</div>
</div>
<div class="paragraph">
<p>The Application itself shows also a healthy sync status BUT …​ it does not show any child-resources.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/pull-argocd-application-branding-bm.png" alt="Pull Model UI Trade-off"/>
</div>
<div class="title">Figure 6. Pull Model UI Trade-off</div>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The whole resource tree is missing in the UI. You are basically blind and you cannot see a Diff. You can check <code>oc get multiclusterapplicationsetreport branding-pull -n openshift-gitops -o yaml</code> to see the full status, but that’s not as nice as seeing it in the UI.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_mixing_push_and_pull">Mixing push and pull</h3>
<div class="paragraph">
<p>The model is decided <strong>per ApplicationSet</strong>, by the label and annotations in the template. One hub Argo CD can therefore use push and pull ApplicationSets side by side. A pattern I like: platform components via push (one UI, full visibility for a small platform team), application workloads via pull.</p>
</div>
<div class="paragraph">
<p>The one exception is the GitOps add-on: once it is enabled through a GitOpsCluster, the push model is switched off. If you want to mix, install OpenShift GitOps on the spokes with your own policy (option B).</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_argo_cd_agent_via_the_gitops_add_on">The Argo CD Agent via the GitOps add-on</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_what_it_actually_is_3">What it actually is</h3>
<div class="paragraph">
<p>The pull model has one weak spot: visibility. The hub only gets an aggregated, delayed status. The Argo CD Agent (see <a href="/gitopscollection/2026-01-14-argocd-agent/">Ep.15</a>) solves exactly that. A lightweight agent on the spoke reconciles locally and synchronises the full Application status back to the <strong>principal</strong> on the hub. The connection is initiated by the spoke (gRPC with mutual TLS), the hub holds no Kubernetes credentials for the spokes, and the Argo CD UI on the hub shows the full resource tree.</p>
</div>
<div class="paragraph">
<p>Setting up the agent by hand means a lot of plumbing: a CA, certificates for the principal and for every agent, registering every agent, installing the agent on every spoke. This is where ACM helps. The GitOps add-on in <strong>Agent mode</strong> does all of that for the clusters of a Placement: it installs OpenShift GitOps and the agent on the spokes, manages the PKI and creates the cluster secrets in agent mode.</p>
</div>
<div class="paragraph">
<div class="imageblock animated-svg" data-animated-svg>
  <div class="content">
<svg width="1400" height="780" viewBox="0 0 1400 780" role="img" aria-label="Argo CD Agent via the ACM GitOps add-on: the hub Argo CD runs as principal with its controller disabled. The GitOpsCluster creates certificates, agent-mode cluster secrets and ManifestWorks; the gitops-addon on the managed cluster installs OpenShift GitOps and the agent. The agent opens a gRPC connection with mutual TLS to the principal, receives the Applications routed by destination name, reconciles them locally and sends the full status back, so the hub UI shows the complete resource tree" version="1.1" id="asdcaeff4-svg-agent-model" xmlns="http://www.w3.org/2000/svg" xmlns:c2pa="http://c2pa.org/manifest">
  <title id="asdcaeff4-title-agent-model">Argo CD Agent via the ACM GitOps add-on: the hub Argo CD runs as principal with its controller disabled. The GitOpsCluster creates certificates, agent-mode cluster secrets and ManifestWorks; the gitops-addon on the managed cluster installs OpenShift GitOps and the agent. The agent opens a gRPC connection with mutual TLS to the principal, receives the Applications routed by destination name, reconciles them locally and sends the full status back, so the hub UI shows the complete resource tree</title>
  <defs id="asdcaeff4-defs-agent-model">
    <marker id="asdcaeff4-arrow-0F766E" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#0F766E" id="asdcaeff4-marker-path-0F766E" /></marker>
    <marker id="asdcaeff4-arrow-C2410C" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#C2410C" id="asdcaeff4-marker-path-C2410C" /></marker>
    <marker id="asdcaeff4-arrow-4B5563" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#4B5563" id="asdcaeff4-marker-path-4B5563" /></marker>
    </defs>
  <rect id="asdcaeff4-bg" width="1400" height="780" fill="#FFFFFF" />
  <rect id="asdcaeff4-zone-hub" x="20" y="20" width="1360" height="360" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asdcaeff4-label-hub" x="40" y="48" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">HUB</text>
  <rect id="asdcaeff4-zone-spoke" x="20" y="450" width="1360" height="280" rx="14" fill="#F8FAFC" stroke="#E2E8F0" stroke-width="1.5" />
  <text id="asdcaeff4-label-spoke" x="40" y="478" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">MANAGED CLUSTER  ·  bm, sno</text>
  <rect id="asdcaeff4-ns-gitops" x="40" y="60" width="1020" height="300" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="asdcaeff4-label-ns" x="56" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#C2410C" text-anchor="start">openshift-gitops</text>
  <rect id="asdcaeff4-ns-cluster" x="1080" y="60" width="280" height="300" rx="10" fill="#FFFFFF" stroke="#CBD5E1" stroke-width="1.2" />
  <text id="asdcaeff4-label-ns-cluster" x="1096" y="84" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="700" fill="#4B5563" text-anchor="start">cluster namespaces</text>
  <rect id="asdcaeff4-rect-placement" x="60" y="100" width="180" height="100" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdcaeff4-title-placement" x="76" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Placement</text>
  <text id="asdcaeff4-line0-placement" x="76" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">production-clusters</text>
  <rect id="asdcaeff4-rect-gitopscluster" x="260" y="100" width="230" height="100" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdcaeff4-title-gitopscluster" x="276" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">GitOpsCluster</text>
  <text id="asdcaeff4-line0-gitopscluster" x="276" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">gitopsAddon + argoCDAgent</text>
  <text id="asdcaeff4-line1-gitopscluster" x="276" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">mode: managed</text>
  <circle id="asdcaeff4-badge-2" cx="470" cy="120" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-2-text" x="470" y="124.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
  <rect id="asdcaeff4-rect-addon" x="1096" y="100" width="248" height="110" rx="10" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdcaeff4-title-addon" x="1112" y="129" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">Add-on resources</text>
  <text id="asdcaeff4-line0-addon" x="1112" y="152" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">certificates, cluster secrets</text>
  <text id="asdcaeff4-line1-addon" x="1112" y="168" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">in agent mode, ManifestWorks</text>
  <text id="asdcaeff4-line2-addon" x="1112" y="184" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">per managed cluster</text>
  <rect id="asdcaeff4-rect-appset" x="60" y="240" width="180" height="100" rx="10" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdcaeff4-title-appset" x="76" y="269" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#0F766E" text-anchor="start">ApplicationSet</text>
  <text id="asdcaeff4-line0-appset" x="76" y="292" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">destination.name:</text>
  <text id="asdcaeff4-line1-appset" x="76" y="308" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">&#x27;{{name}}&#x27;</text>
  <circle id="asdcaeff4-badge-5" cx="220" cy="260" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-5-text" x="220" y="264.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
  <rect id="asdcaeff4-rect-applications" x="260" y="240" width="230" height="100" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdcaeff4-title-applications" x="276" y="269" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Applications</text>
  <text id="asdcaeff4-line0-applications" x="276" y="292" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">on the hub, one per cluster,</text>
  <text id="asdcaeff4-line1-applications" x="276" y="308" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">routed by destination.name</text>
  <rect id="asdcaeff4-rect-principal" x="520" y="240" width="250" height="100" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="asdcaeff4-title-principal" x="536" y="269" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Argo CD principal</text>
  <text id="asdcaeff4-line0-principal" x="536" y="292" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">controller disabled</text>
  <text id="asdcaeff4-line1-principal" x="536" y="308" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">gRPC endpoint via Route</text>
  <circle id="asdcaeff4-badge-1" cx="750" cy="260" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-1-text" x="750" y="264.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
  <rect id="asdcaeff4-rect-ui" x="800" y="240" width="240" height="100" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdcaeff4-title-ui" x="816" y="269" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">Argo CD UI on the hub</text>
  <text id="asdcaeff4-line0-ui" x="816" y="292" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">full resource tree,</text>
  <text id="asdcaeff4-line1-ui" x="816" y="308" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">live status of every cluster</text>
  <rect id="asdcaeff4-rect-agent" x="520" y="500" width="250" height="96" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="asdcaeff4-title-agent" x="536" y="529" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Argo CD Agent</text>
  <text id="asdcaeff4-line0-agent" x="536" y="552" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">mode managed,</text>
  <text id="asdcaeff4-line1-agent" x="536" y="568" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">opens the connection</text>
  <circle id="asdcaeff4-badge-4" cx="750" cy="520" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-4-text" x="750" y="524.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
  <rect id="asdcaeff4-rect-local" x="520" y="620" width="250" height="96" rx="10" fill="#FDF0E8" stroke="#C2410C" stroke-width="1.6" />
  <text id="asdcaeff4-title-local" x="536" y="649" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Local components</text>
  <text id="asdcaeff4-line0-local" x="536" y="672" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">application-controller,</text>
  <text id="asdcaeff4-line1-local" x="536" y="688" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">repo-server, Redis, no UI</text>
  <circle id="asdcaeff4-badge-6" cx="750" cy="640" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-6-text" x="750" y="644.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">6</text>
  <rect id="asdcaeff4-rect-resources" x="800" y="620" width="240" height="96" rx="10" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdcaeff4-title-resources" x="816" y="649" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#C2410C" text-anchor="start">Resources</text>
  <text id="asdcaeff4-line0-resources" x="816" y="672" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">applied locally, Git pulled</text>
  <text id="asdcaeff4-line1-resources" x="816" y="688" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">by the spoke</text>
  <rect id="asdcaeff4-rect-gitops-addon" x="1096" y="500" width="248" height="96" rx="10" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.4" />
  <text id="asdcaeff4-title-gitops-addon" x="1112" y="529" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="15" font-weight="700" fill="#4B5563" text-anchor="start">gitops-addon</text>
  <text id="asdcaeff4-line0-gitops-addon" x="1112" y="552" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">installs OpenShift GitOps</text>
  <text id="asdcaeff4-line1-gitops-addon" x="1112" y="568" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#1F2937" text-anchor="start">and the agent</text>
  <circle id="asdcaeff4-badge-3" cx="1324" cy="520" r="11" fill="#1F2937" />
  <text id="asdcaeff4-badge-3-text" x="1324" y="524.5" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
  <text id="asdcaeff4-note-spoke1" x="60" y="524" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="700" fill="#1F2937" text-anchor="start">No Kubernetes credentials of the</text>
  <text id="asdcaeff4-note-spoke2" x="60" y="542" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">spoke on the hub. The agent opens</text>
  <text id="asdcaeff4-note-spoke3" x="60" y="560" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">the only connection (outbound).</text>
  <text id="asdcaeff4-note-spoke4" x="60" y="590" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12.5" font-weight="400" fill="#4B5563" text-anchor="start">No hub, still reconciliation.</text>
  <path id="asdcaeff4-flow-placement-gitopscluster" d="M 242 150 L 256 150" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-0F766E)" />
  <path id="asdcaeff4-flow-gitopscluster-addon" d="M 492 150 L 1092 150" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-0F766E)" />
  <text id="asdcaeff4-label-creates" x="792" y="141" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#0F766E" text-anchor="middle">creates</text>
  <path id="asdcaeff4-flow-addon-gitopsaddon" d="M 1220 212 L 1220 496" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-0F766E)" />
  <text id="asdcaeff4-label-mw1" x="1230" y="408" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">ManifestWorks,</text>
  <text id="asdcaeff4-label-mw2" x="1230" y="422" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">pulled by the klusterlet</text>
  <path id="asdcaeff4-flow-gitopsaddon-agent" d="M 1094 548 L 774 548" fill="none" stroke="#4B5563" stroke-width="1.6" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-4B5563)" />
  <text id="asdcaeff4-label-installs" x="934" y="540" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="middle">installs, with client certificate</text>
  <path id="asdcaeff4-flow-placement-appset" d="M 150 202 L 150 236" fill="none" stroke="#0F766E" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-0F766E)" />
  <path id="asdcaeff4-flow-appset-applications" d="M 242 290 L 256 290" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <path id="asdcaeff4-flow-applications-principal" d="M 492 290 L 516 290" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <path id="asdcaeff4-flow-principal-ui" d="M 772 290 L 796 290" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <circle class="flow-dot" style="--d:1.60s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 575 342 L 575 496" begin="indefinite" data-begin="1.60" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <rect id="asdcaeff4-bg-conn-label" x="380" y="392" width="200" height="50" rx="0" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="0" />
  <path id="asdcaeff4-flow-principal-agent" d="M 575 342 L 575 496" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <text id="asdcaeff4-label-apps" x="567" y="404" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#C2410C" text-anchor="end">Applications</text>
  <path id="asdcaeff4-conn-agent-principal" d="M 645 496 L 645 344" fill="none" stroke="#4B5563" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdcaeff4-arrow-4B5563)" />
  <text id="asdcaeff4-label-conn1" x="567" y="424" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="end">gRPC stream, mTLS,</text>
  <text id="asdcaeff4-label-conn2" x="567" y="438" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#4B5563" text-anchor="end">opened by the agent</text>
  <path id="asdcaeff4-status-agent-principal" d="M 715 496 L 715 344" fill="none" stroke="#0F766E" stroke-width="1.6" stroke-linejoin="round" stroke-dasharray="5 3" marker-end="url(#asdcaeff4-arrow-0F766E)" />
  <text id="asdcaeff4-label-status1" x="725" y="404" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="700" fill="#0F766E" text-anchor="start">full status back:</text>
  <text id="asdcaeff4-label-status2" x="725" y="418" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="11" font-weight="600" fill="#0F766E" text-anchor="start">resource tree, health, events</text>
  <path id="asdcaeff4-flow-agent-local" d="M 645 598 L 645 616" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <path id="asdcaeff4-flow-local-resources" d="M 772 668 L 796 668" fill="none" stroke="#C2410C" stroke-width="2" stroke-linejoin="round" marker-end="url(#asdcaeff4-arrow-C2410C)" />
  <rect id="asdcaeff4-legend-you" x="40" y="752" width="22" height="14" rx="3" fill="#E6F4F1" stroke="#0F766E" stroke-width="1.6" />
  <text id="asdcaeff4-legend-you-text" x="70" y="764" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">created by you</text>
  <rect id="asdcaeff4-legend-acm" x="194.609375" y="752" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#0F766E" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdcaeff4-legend-acm-text" x="224.609375" y="764" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by ACM</text>
  <rect id="asdcaeff4-legend-argo" x="370.5625" y="752" width="22" height="14" rx="3" fill="#FFFFFF" stroke="#C2410C" stroke-width="1.6" stroke-dasharray="6 4" />
  <text id="asdcaeff4-legend-argo-text" x="400.5625" y="764" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">generated by Argo CD</text>
  <rect id="asdcaeff4-legend-platform" x="566.984375" y="752" width="22" height="14" rx="3" fill="#F1F5F9" stroke="#4B5563" stroke-width="1.6" />
  <text id="asdcaeff4-legend-platform-text" x="596.984375" y="764" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="400" fill="#1F2937" text-anchor="start">platform component</text>
  <text id="asdcaeff4-legend-tp" x="1380" y="764" font-family="Inter, 'Liberation Sans', Arial, sans-serif" font-size="12" font-weight="600" fill="#4B5563" text-anchor="end">Technology Preview in ACM 2.17</text>
<circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 242 150 L 256 150" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 492 150 L 1092 150" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.80s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1220 212 L 1220 496" begin="indefinite" data-begin="0.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="3.5" fill="#4B5563" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 1094 548 L 774 548" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.40s" visibility="hidden" r="4.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 150 202 L 150 236" begin="indefinite" data-begin="0.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.00s" visibility="hidden" r="3.5" fill="#4B5563" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 645 496 L 645 344" begin="indefinite" data-begin="0.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:0.80s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 242 290 L 256 290" begin="indefinite" data-begin="0.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:1.20s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 492 290 L 516 290" begin="indefinite" data-begin="1.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.00s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 645 598 L 645 616" begin="indefinite" data-begin="2.00" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.40s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 772 668 L 796 668" begin="indefinite" data-begin="2.40" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:2.80s" visibility="hidden" r="3.5" fill="#0F766E" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 715 496 L 715 344" begin="indefinite" data-begin="2.80" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  <circle class="flow-dot" style="--d:3.20s" visibility="hidden" r="4.5" fill="#C2410C" stroke="#FFFFFF" stroke-width="1.5"><animateMotion path="M 772 290 L 796 290" begin="indefinite" data-begin="3.20" dur="1.40s" repeatCount="indefinite" calcMode="linear"/></circle>
  </svg>
</div>
  <div class="title">Argo CD Agent: the agent opens the connection, receives the Applications and sends the full status back</div>
</div>

</div>
<div class="paragraph">
<p>What happens under the hood:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The Argo CD instance on the hub runs as <strong>principal</strong>. In the ACM configuration its application-controller is disabled, and a Route exposes the gRPC endpoint for the agents.</p>
</li>
<li>
<p>The <strong>GitOpsCluster</strong> with the add-on and the agent enabled creates the certificates, the cluster secrets in agent mode and the ManifestWorks for every cluster of the Placement.</p>
</li>
<li>
<p>The <strong>gitops-addon</strong> on the managed cluster installs OpenShift GitOps and the agent, including the client certificate of the agent.</p>
</li>
<li>
<p>The <strong>agent</strong> opens the connection to the principal: a gRPC stream with mutual TLS, initiated by the spoke.</p>
</li>
<li>
<p>The <strong>ApplicationSet</strong> generates the Applications on the hub. With destination-based mapping, the principal sends each Application to the agent whose name matches <code>spec.destination.name</code>.</p>
</li>
<li>
<p>The <strong>local components</strong> on the managed cluster pull Git and reconcile. The agent sends the full status back, so the Argo CD UI on the hub shows the resource tree, health and events of every cluster.</p>
</li>
</ol>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p>The Agent mode of the GitOps add-on is <strong>Technology Preview</strong> in ACM 2.17. With ACM 5.0 which is planned for November 2026 this will become GA.</p>
</li>
<li>
<p>Every cluster that runs the Argo CD Agent requires an <strong>OpenShift Platform Plus</strong> subscription.</p>
</li>
</ul>
</div>
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_1_prepare_the_hub_argo_cd">Step 1: Prepare the hub Argo CD</h3>
<div class="paragraph">
<p>First we need to prepare Argo CD. We need to modify the Operator Subscription and the Argo CD resource. This step has an important consequence: the Argo CD instance on the hub becomes an agent <strong>principal</strong>. Its own application-controller is <strong>disabled</strong>, so this instance no longer pushes to any cluster.</p>
</div>
<div class="paragraph">
<p>OpenShift GitOps 1.22 itself also supports a hybrid architecture (GA), where the application-controller stays enabled and push and agent Applications run side by side in one instance. The ACM 2.17 documentation for the add-on does not cover that combination yet.</p>
</div>
<div class="paragraph">
<p>First, add the required environment variables to the <code>Subscription</code> of the OpenShift GitOps Operator on the hub:</p>
</div>
<div class="listingblock linenums">
<div class="title">Subscription of the OpenShift GitOps Operator on the hub (excerpt)</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  config:
    env:
      - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES <i class="conum" data-value="1"></i><b>(1)</b>
        value: openshift-gitops,local-cluster
      - name: ARGOCD_PRINCIPAL_TLS_SERVER_ALLOW_GENERATE <i class="conum" data-value="2"></i><b>(2)</b>
        value: &#34;false&#34;
      - name: ARGOCD_PRINCIPAL_REDIS_SERVER_ADDRESS <i class="conum" data-value="3"></i><b>(3)</b>
        value: openshift-gitops-redis:6379</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Namespaces in which the OpenShift GitOps Operator runs Argo CD instances as cluster-scoped instances, with permissions for the whole cluster. The ACM documentation lists the default instance in <code>openshift-gitops</code> and <code>local-cluster</code>, the cluster namespace of the hub itself.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Do not let the principal generate a temporary, self-signed TLS certificate. That option is meant for development only. The server certificate of the principal is provided instead (the GitOps add-on manages the PKI).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The Redis instance the principal uses. The default of the principal is <code>argocd-redis:6379</code>, which does not exist with OpenShift GitOps. The Redis service of the default instance is called <code>openshift-gitops-redis</code>.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Then configure the ArgoCD resource on the hub for agent mode:</p>
</div>
<div class="listingblock linenums">
<div class="title">ArgoCD resource on the hub in agent mode</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  controller:
    enabled: false <i class="conum" data-value="1"></i><b>(1)</b>
  sourceNamespaces:
    - &#39;*&#39;
  argoCDAgent:
    principal:
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      destinationBasedMapping: true <i class="conum" data-value="3"></i><b>(3)</b>
      auth: &#34;mtls:CN=system:open-cluster-management:cluster:([^:]+):addon:gitops-addon:agent:gitops-addon-agent&#34; <i class="conum" data-value="4"></i><b>(4)</b>
      namespace:
        allowedNamespaces:
          - &#39;*&#39;
      server:
        route:
          enabled: true <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The hub instance no longer reconciles Applications itself.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Turns the instance into an agent principal.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Applications are routed to an agent by <code>spec.destination.name</code> instead of by namespace.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The agent identity is taken from the client certificate that the add-on issues.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Exposes the principal with a Route. The agents connect to it, and the GitOpsCluster controller discovers its address from there.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Finally, the principal only propagates AppProjects whose <code>destinations</code> and <code>sourceNamespaces</code> match the agents. The ACM documentation therefore configures the <code>default</code> AppProject in <code>openshift-gitops</code> with matching (or wildcard) values.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
If your hub Argo CD currently deploys anything via the push model, do not convert it. Install a second, dedicated Argo CD instance for the agent principal, or keep the agent for a separate hub. OpenShift GitOps 1.22 itself supports a <strong>hybrid architecture</strong> (push and agent Applications in one control plane, GA in 1.22), but the ACM 2.17 documentation for the add-on configures the hub instance with its controller disabled.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_2_the_gitopscluster_in_agent_mode">Step 2: The GitOpsCluster in agent mode</h3>
<div class="listingblock linenums">
<div class="title">GitOpsCluster with the GitOps add-on and the Argo CD Agent</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps.open-cluster-management.io/v1beta1
kind: GitOpsCluster
metadata:
  name: gitops-agent-clusters
  namespace: openshift-gitops
spec:
  argoServer:
    argoNamespace: openshift-gitops
  placementRef:
    kind: Placement
    apiVersion: cluster.open-cluster-management.io/v1beta1
    name: production-clusters
    namespace: openshift-gitops
  gitopsAddon:
    enabled: true <i class="conum" data-value="1"></i><b>(1)</b>
    argoCDAgent:
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      mode: managed <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Installs OpenShift GitOps on the spokes, as in Basic mode.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Additionally deploys the agent, creates the PKI and the cluster secrets in agent mode.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>managed</code>: the hub is the source of truth for Applications. <code>autonomous</code>: the spoke owns its Applications and the hub only observes them. The default is <code>managed</code>.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The controller discovers the principal address from the Route.</p>
</div>
<div class="paragraph">
<p>You can check the discovered address with the following command:</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
It will take a while until it appears.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get gitopscluster gitops-agent-clusters -n openshift-gitops \
  -o jsonpath=&#39;{.spec.gitopsAddon.argoCDAgent.serverAddress}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_3_permissions_on_the_managed_clusters">Step 3: Permissions on the managed clusters</h3>
<div class="paragraph">
<p>When the GitOpsCluster is created, ACM also creates the policy <code>&lt;gitopscluster-name&gt;-argocd-policy</code> on the hub. It is created once and then belongs to you, so it is the right place to add the permissions. Two service accounts on the spokes need them:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the <strong>agent</strong> itself, which reports the status and the live resources to the principal, needs read access,</p>
</li>
<li>
<p>the local <strong>application-controller</strong>, which actually applies the manifests, needs write access to everything the Applications deploy.</p>
</li>
</ul>
</div>
<div class="listingblock linenums">
<div class="title">Additional object templates in the gitops-agent-clusters-argocd-policy</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">            - complianceType: musthave
              objectDefinition:
                apiVersion: rbac.authorization.k8s.io/v1
                kind: ClusterRoleBinding
                metadata:
                  name: acm-openshift-gitops-argocd-agent-cluster-reader
                subjects:
                  - kind: ServiceAccount
                    name: acm-openshift-gitops-agent-agent <i class="conum" data-value="1"></i><b>(1)</b>
                    namespace: openshift-gitops
                roleRef:
                  apiGroup: rbac.authorization.k8s.io
                  kind: ClusterRole
                  name: view
            - complianceType: musthave
              objectDefinition:
                apiVersion: rbac.authorization.k8s.io/v1
                kind: ClusterRoleBinding
                metadata:
                  name: argo-admin
                subjects:
                  - kind: ServiceAccount
                    name: acm-openshift-gitops-argocd-application-controller <i class="conum" data-value="2"></i><b>(2)</b>
                    namespace: openshift-gitops
                roleRef:
                  apiGroup: rbac.authorization.k8s.io
                  kind: ClusterRole
                  name: cluster-admin <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The agent: read access is enough.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The local application-controller of the instance the add-on creates.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Simple and usually fine for platform configuration. For application teams, use the least-privilege approach from the pull model instead: the label <code>argocd.argoproj.io/managed-by</code> on the destination namespaces.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_4_the_applicationset">Step 4: The ApplicationSet</h3>
<div class="paragraph">
<p>With destination-based mapping, the ApplicationSet looks almost like a push ApplicationSet. The only difference is the destination: <code>name</code> instead of <code>server</code>.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The push example already installed the Compliance Operator and the pull example the console branding. The agent example therefore uses a third folder, <code>clusters/&lt;cluster&gt;/branding-bottom</code>, so that the three models do not manage the same objects.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">ApplicationSet for agent mode</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: branding-bottom-agent
  namespace: openshift-gitops
spec:
  generators:
    - clusterDecisionResource:
        configMapRef: acm-placement
        labelSelector:
          matchLabels:
            cluster.open-cluster-management.io/placement: production-clusters
        requeueAfterSeconds: 30
  template:
    metadata:
      name: &#39;branding-bottom-{{name}}&#39;
    spec:
      project: default
      source:
        repoURL: https://github.com/tjungbauer/openshift-clusterconfig-gitops.git
        targetRevision: main
        path: &#39;clusters/{{name}}/branding-bottom&#39; <i class="conum" data-value="1"></i><b>(1)</b>
      destination:
        name: &#39;{{name}}&#39; <i class="conum" data-value="2"></i><b>(2)</b>
      syncPolicy:
        automated:
          prune: true
          selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>One folder per cluster: <code>clusters/sno/branding-bottom</code> and <code>clusters/bm/branding-bottom</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The principal routes the Application to the agent with this name, which is the name of the managed cluster.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_5_verify">Step 5: Verify</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># hub: overall state, the conditions tell you which step failed
oc get gitopscluster gitops-agent-clusters -n openshift-gitops \
  -o jsonpath=&#39;{.status.conditions}&#39; | jq

# hub: the principal is running
oc get pods -n openshift-gitops -l app.kubernetes.io/name=openshift-gitops-agent-principal

# managed cluster: the agent is running
oc get pods -n openshift-gitops -l app.kubernetes.io/part-of=argocd-agent

# hub: Application status, synchronised by the agent
oc get applications.argoproj.io -n openshift-gitops</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_the_visibility_in_the_ui">The visibility in the UI</h3>
<div class="paragraph">
<p>The big advantage of the Argo CD Agent is the visibility in the UI. While the ApplicationSet in the hub shows a healthy sync status:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/agent-argocd-applicationset-branding-bottom-agent.png" alt="Agent Model ApplicationSet"/>
</div>
<div class="title">Figure 7. ApplicationSet in the hub shows a healthy sync status</div>
</div>
<div class="paragraph">
<p>The Application itself now also shows the full resource tree.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-19/agent-argocd-application-branding-bottom-bm.png" alt="Agent Model UI Visibility"/>
</div>
<div class="title">Figure 8. Agent Model UI Visibility</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_side_by_side">Side by side</h2>
<div class="sectionbody">
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 18.1818%;"/>
<col style="width: 27.2727%;"/>
<col style="width: 27.2727%;"/>
<col style="width: 27.2728%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Aspect</th>
<th class="tableblock halign-left valign-top">Push</th>
<th class="tableblock halign-left valign-top">Pull</th>
<th class="tableblock halign-left valign-top">Argo CD Agent (add-on)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Status in ACM 2.17</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">GA, default</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">GA</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Technology Preview (GA in ACM 5.0)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Where Argo CD reconciles</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Managed cluster (full Argo CD instance)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Managed cluster (agent with local Argo CD components)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Network direction</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub → spoke (cluster proxy or API)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Spoke → hub (klusterlet)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Spoke → hub (agent → principal)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Spoke credentials on the hub</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Token per cluster</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Cluster secret exists, not used for delivery</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mTLS certificates, managed by the add-on</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Status visible on the hub</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Full (resource tree, live diff)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Aggregated report, not real-time</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Full, synchronised by the agent</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub down</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No reconciliation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Reconciliation continues</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Reconciliation continues</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Footprint on the spoke</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">None</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Full OpenShift GitOps instance</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift GitOps plus agent</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Git access needed from</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Every spoke</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Every spoke</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Can be mixed with push on the same hub instance</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">–</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (unless the add-on is enabled)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Not in the ACM 2.17 documented setup (hub controller disabled)</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I have to admit that this article is a bit long. But I hope it gives you a good overview of the different models and how to set them up.</p>
</div>
<div class="paragraph">
<p>Always keep in mind:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The <strong>GitOpsCluster</strong> is the bridge: it turns placed managed clusters into Argo CD cluster secrets and keeps the tokens rotated.</p>
</li>
<li>
<p><strong>Push</strong> is the default and the easiest start: one Argo CD on the hub, full visibility, but the hub holds cluster-admin tokens for every spoke unless you use your own ManagedServiceAccount. With a huge fleet, usually greater than 20 clusters, it becomes unmanageable.</p>
</li>
<li>
<p><strong>Pull</strong> moves the reconciliation to the spokes: the hub ships Applications as ManifestWorks, a local Argo CD does the work. More scalable and outbound-only, at the price of an Argo CD per cluster and a delayed, aggregated status as well as a trade-off in visibility.</p>
</li>
<li>
<p>The <strong>Argo CD Agent add-on</strong> combines pull-style distribution with a full UI on the hub, and ACM takes care of the PKI. It is Technology Preview in ACM 2.17 and in the documented setup it turns the hub Argo CD into a principal without its own controller.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In the <a href="/gitopscollection/2026-10-24-acm-policies-with-gitops/">last part</a>, we turn the integration around: Argo CD deploys ACM policies.</p>
</div>
<div class="paragraph">
<p>And as always: <strong>If it is not in Git, it does not exist.</strong></p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The diagrams in this article have been manually drawn on a whiteboard. AI then generated the SVGs from photos and made them look equal in all articles.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17/html/gitops/gitops-overview" rel="noopener" target="_blank">ACM 2.17: GitOps (registering clusters, push and pull model, GitOps add-on, Argo CD Agent)</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.22/html/release_notes/gitops-release-notes" rel="noopener" target="_blank">Red Hat OpenShift GitOps 1.22 release notes</a></p>
</li>
<li>
<p><a href="https://www.redhat.com/en/blog/manage-clusters-and-applications-scale-argo-cd-agent-red-hat-openshift-gitops" rel="noopener" target="_blank">Red Hat blog: Manage clusters and applications at scale with the Argo CD Agent</a></p>
</li>
<li>
<p><a href="/gitopscollection/2026-01-14-argocd-agent/">[Ep.15] OpenShift GitOps - Argo CD Agent</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.18] OpenShift GitOps or Advanced Cluster Management? Choosing the right tool</title><link>https://blog.stderr.at/gitopscollection/2026-10-20-openshift-gitops-vs-acm/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-10-20-openshift-gitops-vs-acm/</guid><pubDate>Tue, 20 Oct 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><category>Advanced Cluster Management</category><description>Compare OpenShift GitOps and Advanced Cluster Management: what each tool does, where they overlap, how they work together and when to choose which.</description><content:encoded><![CDATA[<div class="paragraph">
<p>At customer engagements where I support the implementation of a GitOps process, I often hear the question: &#34;<em>Should we use OpenShift GitOps (Argo CD) or Advanced Cluster Management (Open Cluster Management)</em>?&#34; The honest answer is: it is the wrong question. Both tools solve different problems, they overlap in one specific area, and in larger environments with numerous clusters they are designed to work together.</p>
</div>
<div class="paragraph">
<p>In this article I will try to explain what each tool is (and also what it is not), where they overlap, how they integrate, and I will walk through an example, so that you can decide for yourself which tool fits which job.</p>
</div>
<div class="paragraph">
<p>The topic turned out to be too big for a single article, so I have split it into multiple parts and maybe I should have split into even more. This is the first:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>[Ep.18] OpenShift GitOps or Advanced Cluster Management?</strong> (this article): what each tool does, where they overlap and a decision guide.</p>
</li>
<li>
<p><a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">[Ep.19] ACM and OpenShift GitOps: push, pull and the Argo CD Agent</a>: how ACM registers clusters in Argo CD, and how to set up each of the three delivery models.</p>
</li>
<li>
<p><a href="/gitopscollection/2026-10-24-acm-policies-with-gitops/">[Ep.20] Managing ACM Policies with OpenShift GitOps</a>: policies as code, the PolicyGenerator, hub templates and bootstrapping Argo CD with a policy.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Everything in this series was written against <strong>OpenShift GitOps 1.22</strong> (Argo CD 3.5) and <strong>Advanced Cluster Management 2.17</strong> (Open Cluster Management). Technology Preview and GA states move quickly in both products, so check the release notes of your versions before you commit to a design.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
While I am using the term &#34;Advanced Cluster Management&#34; in this article, I am referring to the product formerly known as Open Cluster Management. Same counts for Argo CD and OpenShift GitOps.
</td>
</tr>
</tbody></table>
</div>
<div class="sect1">
<h2 id="_the_short_answer">The short answer</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>OpenShift GitOps</strong> (Argo CD) answers the question: <em>&#34;Is the state in Git the state on my cluster(s)?&#34;</em> It is a delivery engine.</p>
</li>
<li>
<p><strong>Advanced Cluster Management</strong> (ACM) answers the question: <em>&#34;Which clusters do I have, how are they doing, and do they comply with my rules?&#34;</em> It is a fleet management platform.</p>
</li>
<li>
<p>ACM does not replace Argo CD. For application delivery, ACM <strong>uses</strong> OpenShift GitOps. What ACM adds is the knowledge about the fleet: which clusters exist, which labels they carry, which ones are healthy.</p>
</li>
<li>
<p>The real overlap is <strong>cluster configuration</strong>: you can configure clusters with Argo CD Applications or with ACM Policies. Choose what fits best, and never let both tools manage the same object.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Or, in one sentence I like to use with customers: <strong>ACM decides <em>where</em> and checks <em>compliance</em>. Argo CD decides <em>what</em> and keeps it <em>in sync</em>.</strong></p>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
Other features ACM offers are an automated cluster deployment and centralized observability. But these are not the focus of this article.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_openshift_gitops_is">What OpenShift GitOps is</h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenShift GitOps is Red Hat’s distribution of <strong>Argo CD</strong>, delivered and lifecycle-managed by the OpenShift GitOps Operator. It is included in the OpenShift subscription. At the time of writing, the current version is 1.22, which ships Argo CD 3.5. New releases and features come quickly, always check the release notes of your version first.</p>
</div>
<div class="paragraph">
<p>The core job of Argo CD is <strong>reconciliation</strong>: it renders manifests (plain YAML, Kustomize, Helm, etc.), compares them with the live state of a cluster and syncs differences. Everything else (ApplicationSets, sync waves, hooks, RBAC via AppProjects, the UI) is built around that job.</p>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
If you want to dig into the details of the GitOps process, <a href="/gitopscollection/2023-12-11-gitops-intro/">Ep.1</a> is a good introduction to the topic.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>What OpenShift GitOps does <strong>not</strong> do:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>It does not create, upgrade, or destroy clusters. A cluster has to exist, and someone has to register it in Argo CD.</p>
</li>
<li>
<p>It does not report <em>compliance</em>. It tells you that an (Argo CD) Application is <strong>Synced</strong> and <strong>Healthy</strong>. It does not tell you that three out of 40 clusters violate your NIST 800-53 baseline.</p>
</li>
<li>
<p>It has no fleet-wide view of anything that is not an Argo CD Application: no search across clusters, no metrics, no inventory.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>That is perfectly fine. Argo CD was never meant to do any of these things.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_advanced_cluster_management_is">What Advanced Cluster Management is</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Red Hat Advanced Cluster Management for Kubernetes is a hub-and-spoke platform. You install it on a <strong>hub</strong> cluster and import or create <strong>managed clusters</strong>. It is a separate subscription, or part of <strong>OpenShift Platform Plus</strong>. At the time of writing, the current version is 2.17. The open source equivalent is called <a href="https://open-cluster-management.io" rel="noopener" target="_blank">Open Cluster Management</a>.</p>
</div>
<div class="paragraph">
<p>ACM is built around five pillars:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 75%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Pillar</th>
<th class="tableblock halign-left valign-top">What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Cluster lifecycle</strong> (multicluster engine)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Create, import, upgrade, and destroy clusters: Installer Provided Infrastructure (IPI) on cloud providers, Hosted Control Planes, Assisted/Agent-based installs on bare metal, ROSA/ARO, import clusters and so on.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Governance</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies that check (inform) or enforce configuration on managed clusters, with compliance status reported back to the hub. Integrates with Gatekeeper, the Compliance Operator and certificate checks.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Application lifecycle</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Deploy applications to many clusters. It uses Argo CD in the background for this task.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Observability</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Centralized metrics and Grafana dashboards across the fleet.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Search and fleet views</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Search any resource across all managed clusters, including a dedicated view for virtual machines from OpenShift Virtualization.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The building blocks you will meet everywhere in ACM are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>ManagedCluster</strong> – the cluster that is managed, the representation of a spoke on the hub, carrying labels (for example <code>environment=production</code>, <code>region=eu-central</code>).</p>
</li>
<li>
<p><strong>ManagedClusterSet</strong> – a group of clusters, used for RBAC and scoping.</p>
</li>
<li>
<p><strong>ManagedClusterSetBinding</strong> – makes a cluster set usable from a namespace on the hub.</p>
</li>
<li>
<p><strong>Placement</strong> – a dynamic selection of clusters based on labels, etc. It defines the scope of a policy or application.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Below is a more detailed description of the different objects</strong></p>
</div>
<div class="paragraph">
<p>The Placement is the important concept for this series. Argo CD selects clusters by looking at labels on cluster <em>secrets</em> that someone created. ACM selects clusters by looking at the actual fleet, including whether a cluster is available right now.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
ACM also has its own, older application model based on <strong>Channels</strong> and <strong>Subscriptions</strong> objects. That model is deprecated and will be removed in a future release.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_side_by_side_comparison">Side-by-side comparison</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let’s do a side-by-side comparison of the two tools:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 37.5%;"/>
<col style="width: 37.5%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Topic</th>
<th class="tableblock halign-left valign-top">OpenShift GitOps</th>
<th class="tableblock halign-left valign-top">Advanced Cluster Management</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Primary purpose</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Continuous delivery from Git</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Fleet management: lifecycle, governance, visibility</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Scope</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">One or more clusters, registered manually</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hundreds or thousands of managed clusters</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Cluster creation and upgrades</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No (cluster upgrades only via a ClusterVersion manifest, see <a href="/gitopscollection/2024-06-07-update-cluster-version-with-gitops/">Ep.10</a>)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (including upgrades with pre/post hooks)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Source of truth</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Git (or Helm/OCI repository)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The hub cluster. The hub objects themselves can (and should) come from Git, so maybe it is still Git after all.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Configuration management</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Applications, ApplicationSets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies (ConfigurationPolicy, OperatorPolicy, …​)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>&#34;Inform only&#34; / audit mode</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Partly, shows OutOfSync of managed resources</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (<code>remediationAction: inform</code>)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Compliance reporting</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes, per policy, per cluster, with history</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Per-cluster templating</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ApplicationSet generators, Helm values</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub templates and managed-cluster templates in policies</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Behaviour when the hub is unreachable</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Push model: nothing is reconciled. Agent/pull model: local reconciliation continues</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies keep being evaluated and enforced on the managed cluster</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Licensing</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Included in OpenShift. Clusters running the Argo CD Agent need OpenShift Platform Plus</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Separate subscription or OpenShift Platform Plus</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="_who_does_what_in_a_combined_setup">Who does what in a combined setup</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When both tools are in place, the question is no longer &#34;which one&#34;, but &#34;which one for which task&#34;. This is the split I would like to recommend:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 37.5%;"/>
<col style="width: 37.5%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Area</th>
<th class="tableblock halign-left valign-top">ACM</th>
<th class="tableblock halign-left valign-top">Argo CD</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Cluster lifecycle</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Create, import, upgrade, hibernate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">–</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Fleet inventory and selection</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ManagedCluster labels, ManagedClusterSets, Placements</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Consumes them (GitOpsCluster, cluster decision generator)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Governance / Compliance</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policies (inform/enforce), compliance history</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Deploys the policies from Git to the hub. Can show health status.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Cluster configuration</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Possible with ConfigurationPolicies</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Preferred</strong>: richer diff, sync waves, health</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Application delivery</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Placement of Applications, pull transport</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The delivery engine (push, pull, agent)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Observability</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Multicluster observability, search</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Sync and health status only</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Bootstrapping Argo CD on new clusters</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policy or GitOps add-on installs it everywhere</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">–</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="_where_they_overlap_cluster_configuration">Where they overlap: cluster configuration</h2>
<div class="sectionbody">
<div class="paragraph">
<p>While application deployment is clearly the responsibility of Argo CD, creating new clusters or upgrading existing ones is clearly ACM territory.
The grey zone is <strong>cluster configuration</strong>: Operators, OAuth, RBAC, network policies, the compliance baseline. Both tools can do it, but you should choose what fits best.</p>
</div>
<div class="paragraph">
<p>To make the difference visible, let’s implement the same requirement twice:</p>
</div>
<div class="paragraph">
<p><em>&#34;Every production cluster must run the Compliance Operator from the stable channel.&#34;</em></p>
</div>
<div class="sect2">
<h3 id="_option_1_argo_cd_with_an_applicationset">Option 1: Argo CD with an ApplicationSet</h3>
<div class="paragraph">
<p>Without ACM, Argo CD needs to know the target clusters. That means a cluster secret per cluster, carrying the labels we want to select on and the token to access the cluster:</p>
</div>
<div class="listingblock linenums">
<div class="title">Cluster secret for a production cluster</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: cluster-prod-eu-01
  namespace: openshift-gitops
  labels:
    argocd.argoproj.io/secret-type: cluster <i class="conum" data-value="1"></i><b>(1)</b>
    environment: production <i class="conum" data-value="2"></i><b>(2)</b>
type: Opaque
stringData:
  name: prod-eu-01
  server: https://api.prod-eu-01.example.com:6443
  config: | <i class="conum" data-value="3"></i><b>(3)</b>
    {
      &#34;bearerToken&#34;: &#34;&lt;token-of-a-service-account-on-the-spoke&gt;&#34;,
      &#34;tlsClientConfig&#34;: {
        &#34;insecure&#34;: false,
        &#34;caData&#34;: &#34;&lt;base64-encoded-ca&gt;&#34;
      }
    }</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Marks this secret as a cluster definition for Argo CD.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Our own label. The ApplicationSet uses it for the selection.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Access configuration for the cluster.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The ApplicationSet then uses the <strong>cluster generator</strong> to create one Application per matching cluster:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Other generators are available too, but for simplicity only the cluster generator is used here.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock linenums">
<div class="title">ApplicationSet with cluster generator</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: compliance-operator
  namespace: openshift-gitops
spec:
  goTemplate: true
  goTemplateOptions: [&#34;missingkey=error&#34;]
  generators:
    - clusters:
        selector:
          matchLabels:
            environment: production <i class="conum" data-value="1"></i><b>(1)</b>
  template:
    metadata:
      name: &#39;compliance-operator-{{ .name }}&#39;
    spec:
      project: default
      source:
        repoURL: https://github.com/tjungbauer/openshift-clusterconfig-gitops.git
        targetRevision: main
        path: clusters/all/setup-compliance-operator
      destination:
        server: &#39;{{ .server }}&#39; <i class="conum" data-value="2"></i><b>(2)</b>
      syncPolicy:
        automated:
          prune: true
          selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Selects all cluster secrets with this label.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Argo CD on the hub pushes the manifests directly to the API of each spoke.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This works well and it is exactly what I do in my own demo environment. The catch is in the details:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The token in the cluster secret must be created, rotated and stored securely. For 5 clusters that is fine, for 200 clusters it is a project of its own.</p>
</li>
<li>
<p>The hub needs network access to the API of every spoke.</p>
</li>
<li>
<p>Whoever controls this Argo CD instance effectively has the permissions of every token it holds.</p>
</li>
<li>
<p>The result is &#34;Synced/Healthy&#34;. There is no compliance report you can hand to an auditor.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_option_2_acm_with_an_operatorpolicy">Option 2: ACM with an OperatorPolicy</h3>
<div class="paragraph">
<p>With ACM, the same requirement is a policy. A <strong>Placement</strong> selects the clusters, a <strong>PlacementBinding</strong> connects the policy with the Placement:</p>
</div>
<div class="listingblock linenums">
<div class="title">Policy, Placement and PlacementBinding</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: compliance-operator
  namespace: acm-policies
  annotations:
    policy.open-cluster-management.io/standards: NIST SP 800-53
    policy.open-cluster-management.io/categories: CM Configuration Management
    policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
spec:
  disabled: false
  remediationAction: enforce <i class="conum" data-value="1"></i><b>(1)</b>
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy <i class="conum" data-value="2"></i><b>(2)</b>
        metadata:
          name: compliance-operator-namespace
        spec:
          severity: high
          object-templates:
            - complianceType: musthave
              objectDefinition:
                apiVersion: v1
                kind: Namespace
                metadata:
                  name: openshift-compliance
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1beta1
        kind: OperatorPolicy <i class="conum" data-value="3"></i><b>(3)</b>
        metadata:
          name: compliance-operator
        spec:
          severity: high
          complianceType: musthave
          subscription:
            name: compliance-operator
            namespace: openshift-compliance
            channel: stable
            source: redhat-operators
            sourceNamespace: openshift-marketplace
          upgradeApproval: Automatic <i class="conum" data-value="4"></i><b>(4)</b>
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: production-clusters
  namespace: acm-policies
spec:
  clusterSets:
    - production <i class="conum" data-value="5"></i><b>(5)</b>
  predicates:
    - requiredClusterSelector:
        labelSelector:
          matchLabels:
            environment: production
---
apiVersion: policy.open-cluster-management.io/v1
kind: PlacementBinding <i class="conum" data-value="6"></i><b>(6)</b>
metadata:
  name: compliance-operator
  namespace: acm-policies
placementRef:
  name: production-clusters
  apiGroup: cluster.open-cluster-management.io
  kind: Placement
subjects:
  - name: compliance-operator
    apiGroup: policy.open-cluster-management.io
    kind: Policy</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Set this to <code>inform</code> and ACM only reports whether the clusters comply, without changing anything.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>A ConfigurationPolicy ensures that an object exists (<code>musthave</code>), matches exactly (<code>mustonlyhave</code>) or does not exist (<code>mustnothave</code>).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The OperatorPolicy handles the OLM details: OperatorGroup, Subscription, install plan approval and the health of the CSV.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Controls whether new versions are approved automatically. With <code>None</code>, ACM does not approve upgrades. With <code>spec.complianceConfig</code>, the policy can additionally report available upgrades, since ACM 2.17 even minor version upgrades on other channels.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The Placement can only see clusters of cluster sets that are bound to the namespace <code>acm-policies</code> via a ManagedClusterSetBinding (see below).</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The PlacementBinding connects the policy with the Placement.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
One important difference to Argo CD I maybe should have mentioned earlier: Argo CD can manage objects it knows. It has no concept of &#34;delete an object completely that cannot compare with Git&#34;. For example, delete the secret &#34;kubeadmin&#34;. ACM is able to do that, you can create a policy that ensures the secret is deleted.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The <code>ManagedClusterSetBinding</code> mentioned in callout 5 looks like the following. It binds the cluster set <code>production</code> to the namespace <code>acm-policies</code>.</p>
</div>
<div class="listingblock linenums">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding <i class="conum" data-value="1"></i><b>(1)</b>
metadata:
  name: production
  namespace: acm-policies
spec:
  clusterSet: production</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The ManagedClusterSetBinding binds the cluster set <code>production</code> to the namespace <code>acm-policies</code>.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_object_model_of_acm_together_with_argo_cd">Object model of ACM together with Argo CD</h3>
<div class="paragraph">
<p>Even after working with ACM for a while, I still find it difficult to understand the object model or to explain it to others. Therefore, I tried to create a visual representation of the objects and their relationships here, to help you to understand and to remind myself when I forget. :)</p>
</div>
<div class="paragraph">
<p>How do these objects play together? The easiest way to understand it is to follow a few clusters through the chain. In the following example, four clusters are imported into ACM. Each step narrows the selection down:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Every imported cluster is a <strong>ManagedCluster</strong> on the hub. The labels are what everything else selects on.</p>
</li>
<li>
<p>The <strong>ManagedClusterSet</strong> <code>production</code> groups clusters. <code>dev-eu-01</code> belongs to another cluster set and is ignored.</p>
</li>
<li>
<p>The <strong>ManagedClusterSetBinding</strong> makes the cluster set usable in a namespace, here <code>openshift-gitops</code>. Without this binding, a Placement in that namespace does not find a single cluster, which is the most common reason for an empty selection.</p>
</li>
<li>
<p>The <strong>Placement</strong> selects from the bound cluster sets only. It asks for <code>environment=prod</code>, so <code>prod-eu-02</code> (a test cluster) is ignored as well.</p>
</li>
<li>
<p>The <strong>PlacementDecision</strong> is the result: <code>prod-eu-01</code> and <code>prod-us-01</code>. ACM keeps it up to date when clusters join, leave or change their labels.</p>
</li>
</ol>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-18/ep18-acm-placement-selection.png?width=1000px" alt="Four example clusters are narrowed down step by step: the cluster set drops dev-eu-01" width="the Placement drops prod-eu-02" height="the PlacementDecision lists prod-eu-01 and prod-us-01"/>
</div>
<div class="title">Figure 1. How ACM selects clusters: from ManagedCluster to PlacementDecision</div>
</div>
<div class="paragraph">
<p>The <code>PlacementDecision</code> itself does not deploy anything. It is just a list and the point where it is handed over to the consumers (Argo CD). Other objects in the same namespace read it and act on it:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The <strong>GitOpsCluster</strong> registers the selected managed clusters automatically in Argo CD by creating a cluster secret for each of them. ACM rotates the tokens automatically, therefore you do not need to take care of that.</p>
</li>
<li>
<p>An <strong>ApplicationSet</strong> creates one Application per selected cluster and uses these cluster secrets as destinations.</p>
</li>
<li>
<p>For governance, a <strong>PlacementBinding</strong> connects a Policy with a Placement. ACM then puts a copy of the Policy into the hub namespace of each selected cluster, where it gets picked up.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Clusters that are not part of the decision receive nothing: no Application, no Policy.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-18/ep18-acm-placement-consumers.png?width=1000px" alt="GitOpsCluster creates Argo CD cluster secrets" width="the ApplicationSet creates one Application per selected cluster" height="the PlacementBinding propagates the Policy; only the selected clusters receive anything"/>
</div>
<div class="title">Figure 2. What uses the PlacementDecision</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Consumers can only reference a Placement in their own namespace. Policies usually live in a different namespace (for example <code>acm-policies</code>), so they need their own ManagedClusterSetBinding and Placement there, typically with the same selection.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
<div class="sect2">
<h3 id="_what_is_the_advantage_now">What is the advantage now?</h3>
<div class="paragraph">
<p>So after all these different objects and relationships, which look rather complex at the beginning, what is the advantage of ACM?</p>
</div>
<div class="ulist">
<ul>
<li>
<p>No extra credentials per cluster: the managed clusters are already registered with the hub. The policy is pulled by the policy addon on the spoke and evaluated locally. ACM takes care of the tokens automatically.</p>
</li>
<li>
<p>The hub does not need to reach the API of the spoke.</p>
</li>
<li>
<p>If the hub is unreachable, the spoke keeps enforcing the last known policy because it is stored locally. Good for edge clusters with unstable connectivity.</p>
</li>
<li>
<p>A compliance view: <em>&#34;compliance-operator: 37 compliant, 3 non-compliant&#34;</em>, with the reason per cluster and a history.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_the_rule_of_thumb">The rule of thumb</h3>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="ulist">
<ul>
<li>
<p><strong>Applications and everything owned by application teams</strong>: → Argo CD.</p>
</li>
<li>
<p><strong>Baseline configuration that must be audited</strong> (security settings, mandatory Operators, certificates, &#34;this must never exist&#34;): → ACM Policies.</p>
</li>
<li>
<p><strong>Platform configuration that is complex to render</strong> (a full logging stack, a service mesh control plane): → Argo CD, optionally wrapped by an ACM Policy that only <em>checks</em> (<code>inform</code>) the result.</p>
</li>
</ul>
</div>
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_the_anti_pattern_two_controllers_one_object">The anti-pattern: two controllers, one object</h3>
<div class="paragraph">
<p>One thing I have seen more than once: Argo CD manages an object with <code>selfHeal: true</code>, and an ACM policy <code>enforces</code> the same object with a slightly different value. Each controller &#34;fixes&#34; the drift caused by the other one. The object flips back and forth.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Every object must have exactly <strong>one</strong> owner. If an ACM Policy and Argo CD should both care about an object, let Argo CD own it and use the policy of ACM in <code>inform</code> mode only.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_bootstrap_question_who_installs_argo_cd">The bootstrap question: who installs Argo CD?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>GitOps needs one first imperative step: somebody has to install the OpenShift GitOps Operator and apply the first (root) Application. Everything after that comes from Git. This is also a question where ACM and Argo CD meet:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 37.5%;"/>
<col style="width: 37.5%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Approach</th>
<th class="tableblock halign-left valign-top">Good for</th>
<th class="tableblock halign-left valign-top">Watch out</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Script or <code>oc apply</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">PoC, a handful of clusters, workshops</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A manual step per cluster. Version and document the script.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Automation (Ansible, Terraform, …​)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Customers with Automation environment</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A second tool to maintain. Keep it to the bootstrap only.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Install-time manifests</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Repeatable on-premises installations (agent-based installer)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Must tolerate CRD timing until the operator is up.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ACM Policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Fleets: every imported cluster is bootstrapped automatically</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Policy and Argo CD must not fight over the same objects.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ACM GitOpsCluster</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Hub Argo CD (push) or GitOps add-on (pull/agent) targets the cluster</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The hub becomes part of the critical path.</p></td>
</tr>
</tbody>
</table>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
My recommendation: fewer than five clusters, use a script or Ansible. For a fleet that is managed by ACM, use a policy or the GitOpsCluster. Never: &#34;we click it in the console once&#34;. The bootstrap policy is shown in <a href="/gitopscollection/2026-10-24-acm-policies-with-gitops/">Ep.20</a>.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_working_together_acm_as_the_brain_for_argo_cd">Working together: ACM as the brain for Argo CD</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As mentioned above, ACM can register its managed clusters in OpenShift GitOps automatically. You no longer maintain cluster secrets by hand: ACM creates them, based on a Placement, rotates the credentials automatically and removes the secrets when a cluster is removed from the Placement.</p>
</div>
<div class="paragraph">
<p>The bridge between the two worlds is the <strong>GitOpsCluster</strong> custom resource. On top of it, ACM offers three options to get an Argo CD Application onto a managed cluster:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 14.2857%;"/>
<col style="width: 42.8571%;"/>
<col style="width: 42.8572%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Model</th>
<th class="tableblock halign-left valign-top">How it works</th>
<th class="tableblock halign-left valign-top">Use it when</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Push</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Argo CD on the hub pushes manifests to the spoke API, like option 1 above. ACM creates and rotates the cluster secrets.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A moderate number of clusters, good connectivity from hub to spokes, and you want <strong>one UI with full visibility</strong>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Pull</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Applications are created on the hub but not reconciled there. Instead the target cluster pulls it and a local Argo CD instance on the target cluster reconciles it.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Many clusters, outbound-only networks, or the hub must not hold credentials for the spokes.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Argo CD Agent</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ACM deploys the Argo CD Agent to the spokes via the GitOps add-on. Applications are defined on the hub, the agent reconciles locally and synchronises the full status back.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The direction for large fleets and edge sites.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The following diagram shows how the three models fit together.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-18/ep18-delivery-models.png?width=1000px" alt="Push reconciles on the hub" width="pull and the Argo CD Agent reconcile on the managed cluster"/>
</div>
<div class="title">Figure 3. Three ways an Argo CD Application reaches a managed cluster</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Yes, you read that right, the version will jump from 2.17 to 5.0 for ACM in the next release, to harmonize with OpenShift versioning.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>What each model actually is, how the data flows in which direction and how to set it up step by step is the topic of the next part: <a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">[Ep.19] ACM and OpenShift GitOps: push, pull and the Argo CD Agent</a>.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_decision_guide">Decision guide</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The following are the scenarios I saw in real projects and what I personally would recommend. Verify if these fit your situation.</p>
</div>
<div class="paragraph">
<p>A quick summary of the scenarios is shown in the following slide I was using for a workshop (more details below):</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-18/ep18-decision-guide.png?width=1000px" alt="Three questions lead to the scenarios A to E"/>
</div>
<div class="title">Figure 4. Decision guide: OpenShift GitOps alone or together with ACM</div>
</div>
<div class="sect2">
<h3 id="_scenario_a_one_to_three_clusters_one_platform_team">Scenario A: one to three clusters, one platform team</h3>
<div class="paragraph">
<p><em>Example: a single production cluster plus a test cluster.</em></p>
</div>
<div class="paragraph">
<p><strong>OpenShift GitOps only.</strong> ACM would add a hub, an additional component to operate and additional cost, without solving a real problem. Configure the clusters with Argo CD as described in the earlier episodes of this series, with either one Argo CD instance per cluster or a central Argo CD on a management cluster (recommended). If you need compliance reports, the Compliance Operator gives you scan results per cluster without ACM.</p>
</div>
</div>
<div class="sect2">
<h3 id="_scenario_b_3_to_20_clusters_all_reachable_created_by_another_team_or_process">Scenario B: 3 to 20 clusters, all reachable, created by another team or process</h3>
<div class="paragraph">
<p><em>Example: dev, test, prod in two data centres, installed by the infrastructure team.</em></p>
</div>
<div class="paragraph">
<p><strong>OpenShift GitOps is usually sufficient.</strong> A central Argo CD with an ApplicationSet cluster generator, or decentralised Argo CD instances per cluster. Start thinking about ACM when one of these questions comes up:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>&#34;Who rotates the cluster tokens in the Argo CD secrets?&#34;</p>
</li>
<li>
<p>&#34;Can you show us which clusters are not compliant?&#34;</p>
</li>
<li>
<p>&#34;Can we have one search, one observability view across all clusters?&#34;</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_scenario_c_20_to_several_hundred_clusters">Scenario C: 20 to several hundred clusters</h3>
<div class="paragraph">
<p><em>Example: clusters per business unit, factory or per tenant, created on demand.</em></p>
</div>
<div class="paragraph">
<p><strong>ACM plus OpenShift GitOps. Push for smaller fleets, pull or agent for larger fleets.</strong> ACM creates the clusters, labels them and adds them to cluster sets. The GitOpsCluster registers them in Argo CD automatically. Applications and complex platform components come via ApplicationSets driven by ACM Placements. A new cluster receives its full configuration without anybody touching Argo CD. Around 20 clusters is also where a single push hub usually needs sharding, and where the &#34;hub holds all the credentials&#34; discussion with the security team starts. <strong>The pull model or the Argo CD Agent become serious options here.</strong></p>
</div>
</div>
<div class="sect2">
<h3 id="_scenario_d_regulated_environment">Scenario D: regulated environment</h3>
<div class="paragraph">
<p><em>Example: banking or public sector, regular audits, a defined security baseline.</em></p>
</div>
<div class="paragraph">
<p><strong>ACM Policies for the baseline, Argo CD for the rest.</strong> The baseline lives as policies in Git, deployed by Argo CD to the hub, enforced and reported by ACM. Start in <code>inform</code> mode on existing clusters, check the compliance dashboard, then switch to <code>enforce</code>.</p>
</div>
</div>
<div class="sect2">
<h3 id="_scenario_e_edge_and_disconnected_sites">Scenario E: edge and disconnected sites</h3>
<div class="paragraph">
<p><em>Example: hundreds of small clusters (SNO, compact clusters) in stores, factories or vehicles with unstable connectivity.</em></p>
</div>
<div class="paragraph">
<p><strong>ACM plus OpenShift GitOps in pull or agent mode.</strong> The push model fails here: the hub cannot reliably reach the spokes. Policies are evaluated locally and continue to work when the connection is down. Applications are reconciled by a local Argo CD or the Argo CD Agent. Two things to keep in mind: every spoke still needs to reach its sources (Git or an OCI registry, often a local mirror), and every cluster that runs the Argo CD Agent needs an OpenShift Platform Plus subscription.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_frequently_asked_questions">Frequently asked questions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Just some questions I heard from customers during the last years:</p>
</div>
<div class="paragraph">
<p><strong>Can ACM replace Argo CD?</strong>
For applications, no. ACM’s application lifecycle is built on OpenShift GitOps. The older Channel and Subscription model still exists, but it is deprecated. I would not start a new project with Channels and Subscriptions.</p>
</div>
<div class="paragraph">
<p><strong>Can Argo CD replace ACM?</strong>
For delivery to existing, reachable clusters, yes. For cluster lifecycle, compliance reporting, fleet search and observability, no.</p>
</div>
<div class="paragraph">
<p><strong>Do we need ACM to do multi-cluster GitOps?</strong>
No. Argo CD handles multiple clusters on its own, and with the Argo CD Agent even in a hub-and-spoke model with local reconciliation (see <a href="/gitopscollection/2026-01-14-argocd-agent/">Ep.15</a>). ACM makes it easier to operate at scale, because the cluster registration, the token rotation and the agent installation are automated.</p>
</div>
<div class="paragraph">
<p><strong>Should the ACM hub itself be managed by Argo CD?</strong>
Yes. The MultiClusterHub, the policies, Placements, cluster sets, GitOpsCluster resources: all of it belongs in Git. The hub is just another cluster.</p>
</div>
<div class="paragraph">
<p><strong>Should I configure the cluster with Argo CD or with policies?</strong>
See the rule of thumb above. And whatever you choose always keep in mind: one owner per object.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>So, which one is better? Neither. They are not competitors, they are layers.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>OpenShift GitOps</strong> is the delivery engine. It makes sure that what is in Git is running on a cluster. It is included in OpenShift and should be your default for applications and complex platform components, no matter how many clusters you have.</p>
</li>
<li>
<p><strong>Advanced Cluster Management</strong> is the fleet layer on top. It knows which clusters exist, creates and upgrades them, enforces and reports compliance, and feeds Argo CD with the list of clusters via Placements.</p>
</li>
<li>
<p>The real decision is not &#34;GitOps or ACM&#34;, but &#34;do I need fleet management?&#34; For a handful of clusters, usually not. For many clusters, dynamic cluster creation, regulated environments or edge sites, almost certainly yes.</p>
</li>
<li>
<p>Where both tools can do the same job, cluster configuration, use policies for the audited baseline and Argo CD for everything that needs rendering, and keep exactly one owner per object.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In the <a href="/gitopscollection/2026-10-23-acm-gitops-push-pull-agent/">next part</a>, we look under the hood of the integration: push, pull and the Argo CD Agent.</p>
</div>
<div class="paragraph">
<p>And as always: <strong>If it is not in Git, it does not exist.</strong></p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The diagrams in this article have been manually drawn on a whiteboard. AI then generated the SVGs from photos and made them look equal in all articles.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.22/html/release_notes/gitops-release-notes" rel="noopener" target="_blank">Red Hat OpenShift GitOps 1.22 release notes</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17" rel="noopener" target="_blank">Red Hat Advanced Cluster Management for Kubernetes 2.17 documentation</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.17/html/gitops/gitops-overview" rel="noopener" target="_blank">ACM 2.17: GitOps overview</a></p>
</li>
<li>
<p><a href="https://www.redhat.com/en/blog/manage-clusters-and-applications-scale-argo-cd-agent-red-hat-openshift-gitops" rel="noopener" target="_blank">Red Hat blog: Manage clusters and applications at scale with the Argo CD Agent</a></p>
</li>
<li>
<p><a href="https://opengitops.dev/" rel="noopener" target="_blank">OpenGitOps principles</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.17] Closing the gap between CI and CD with the Argo CD Image Updater</title><link>https://blog.stderr.at/gitopscollection/2026-09-15-argocd-image-updater/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-09-15-argocd-image-updater/</guid><pubDate>Tue, 15 Sep 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>GitOps</category><category>OpenShift</category><description>Walk through the Argo CD Image Updater on OpenShift GitOps 1.21: close the CI/CD gap by updating image tags in Git, with a small test image you can build.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Argo CD is very good at one thing: making sure that whatever is stored in Git is what is running on the cluster. It compares both things and updates the cluster accordingly. It is not good at noticing that a CI pipeline has just published a new container image (into the registry). That is the gap between Continuous Integration and Continuous Delivery, and most of us have closed it with a small piece of glue: a pipeline task that clones the configuration repository, patches a tag and pushes the change. I did exactly that in <a href="/securesupplychain/2023-06-23-securesupplychain-step8">Step 8 of the Secure Supply Chain series</a> with a Tekton task.</p>
</div>
<div class="paragraph">
<p>With OpenShift GitOps 1.21 the <strong>Argo CD Image Updater</strong> became generally available. This controller aims to close the gap between CI and CD.</p>
</div>
<div class="paragraph">
<p>Instead of a hand-written pipeline task, you describe what you would like to do in an <code>ImageUpdater</code> custom resource: which applications to watch, which images to track, which versions are acceptable and where the result should be written.</p>
</div>
<div class="paragraph">
<p>I tried to create a full walkthrough with this article. We will build a tiny container image, deploy it with Argo CD, let the Image Updater track it, and then push a new version and watch what happens.</p>
</div>
<div class="sect1">
<h2 id="_what_the_image_updater_does">What the Image Updater does</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <strong>Image Updater</strong> is a controller running next to Argo CD. It runs a reconciliation loop that watches the Argo CD applications you selected and queries the container registries for newer tags of the images you configured. When it finds a version that satisfies your constraints, it instructs Argo CD to use the new image.</p>
</div>
<div class="paragraph">
<p>There are two properties that should be considered before we start.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The Image Updater does not deploy anything. It only changes the desired state, <strong>either</strong> the <strong>Application</strong> resource or a file in Git. Whether that change is rolled out depends on the sync policy of your application. With an automated sync policy the new image goes live. Without it, the application turns <strong>OutOfSync</strong> and waits for manual input.</p>
</li>
<li>
<p>The Image Updater needs <strong>a parameterised manifest</strong>, such as Kustomize or Helm. Plain YAML with a hard-coded image in a Deployment is not supported, because there is no parameter for the controller to <strong>override</strong>.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The supported registries that can be observed for changes, include Docker Hub, Red Hat Quay, GitHub Container Registry, GitLab Container Registry, Google Container Registry, Azure Container Registry, JFrog Artifactory and anything else that implements the Docker Registry v2 API.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_not_just_use_a_pipeline_task">Why not just use a pipeline task?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A pipeline task that patches a tag and pushes the change works. I used it myself and it is fine for a single pipeline. But as the number of applications and environments grows, the approach has a few rough edges:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>The CI pipeline needs write access to the configuration repository.</strong> That is a privilege most pipelines should not have. A compromised build could push any image tag it wants. With the Image Updater, only the controller writes to the configuration repository and the CI pipeline only needs push access to the registry.</p>
</li>
<li>
<p><strong>Every pipeline has to carry the same glue code.</strong> Cloning a second repository, running <code>kustomize edit set image</code> or <code>yq</code>, committing and pushing: that logic lives in every pipeline, often copy-pasted, and it drifts over time. The Image Updater replaces all of it with a single custom resource.</p>
</li>
<li>
<p><strong>The pipeline only runs when you trigger it.</strong> If somebody pushes an image outside of the pipeline, nothing happens. The Image Updater polls the registry independently, so it catches every new tag that matches the constraint, no matter who pushed it.</p>
</li>
<li>
<p><strong>Version constraints are built in.</strong> A pipeline task blindly writes the tag it just built. The Image Updater evaluates semantic version ranges, tag filters and ignore lists before it acts. You define what is acceptable once and the controller enforces it.</p>
</li>
<li>
<p><strong>Pull request support comes for free.</strong> Opening a pull request from a pipeline task means scripting the GitHub or GitLab API. The Image Updater has it built in.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In short: the pipeline task is imperative glue that couples CI to the configuration repository. The Image Updater is a declarative controller that removes that coupling.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_a_word_about_the_setup">A word about the setup</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Everything below was done on a single OpenShift cluster with the default <strong>openshift-gitops</strong> Argo CD instance. You need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenShift Container Platform with the Red Hat OpenShift GitOps Operator 1.21 or later. The <code>ImageUpdater</code> custom resource does not exist in earlier versions.</p>
</li>
<li>
<p><strong>cluster-admin</strong> privileges, or at least permission to modify the <strong>ArgoCD</strong> custom resource.</p>
</li>
<li>
<p>A Git repository for the configuration. I use <a class="bare" href="https://github.com/tjungbauer/argocd-image-updater-demo.git">https://github.com/tjungbauer/argocd-image-updater-demo.git</a> in this article. Replace it with your own.</p>
</li>
<li>
<p>A registry account you can push to. I use Quay.io, because you can create a public repository in a few clicks and push a new tag whenever you want to trigger an update.</p>
</li>
<li>
<p><strong>podman</strong> (or <strong>docker</strong>) on your workstation.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do not run OpenShift GitOps 1.21.0. Several issues relevant to this article, including a goroutine leak in the Image Updater, were fixed in 1.21.1. Check your version with <strong>oc get csv -n openshift-gitops-operator | grep gitops</strong>.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_building_a_test_image">Building a test image</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The first thing we need to see an update happen is an image whose tags we can control. This can be any image. I have created a simple image for testing purposes: BusyBox with its built-in HTTP server, serving a single page that displays its own version.</p>
</div>
<div class="listingblock">
<div class="title">Containerfile</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-dockerfile hljs" data-lang="dockerfile">FROM docker.io/library/busybox:1.37

ARG APP_VERSION=0.0.0 <i class="conum" data-value="1"></i><b>(1)</b>

RUN mkdir -p /www &amp;&amp; \
    printf &#39;&lt;html&gt;&lt;body style=&#34;font-family:sans-serif&#34;&gt;\n&lt;h1&gt;simple-app&lt;/h1&gt;\n&lt;p&gt;version: %s&lt;/p&gt;\n&lt;/body&gt;&lt;/html&gt;\n&#39; \
      &#34;${APP_VERSION}&#34; &gt; /www/index.html &amp;&amp; \
    chmod 0755 /www &amp;&amp; chmod 0644 /www/index.html <i class="conum" data-value="2"></i><b>(2)</b>

EXPOSE 8080

USER 1001 <i class="conum" data-value="3"></i><b>(3)</b>

ENTRYPOINT [&#34;/bin/busybox&#34;, &#34;httpd&#34;, &#34;-f&#34;, &#34;-v&#34;, &#34;-p&#34;, &#34;8080&#34;, &#34;-h&#34;, &#34;/www&#34;] <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The version is baked in at build time so that you can see in the browser which image is running.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The files must be readable by any user ID. OpenShift runs the container with a random UID from the namespace range, not with the UID from the image.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>A non-root user. OpenShift would enforce this anyway through the restricted-v2 security context constraint, but declaring it makes the image usable elsewhere as well.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>BusyBox httpd in foreground mode on port 8080. Ports below 1024 would require root privileges, which you do not get.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Build and push the first version. Replace <strong>&lt;tjungbau&gt;</strong> with your own namespace. (If you use a different registry, replace the registry name accordingly):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman build --build-arg APP_VERSION=1.0.0 --platform linux/amd64 -t quay.io/tjungbau/simple-app:1.0.0 .
podman push quay.io/tjungbau/simple-app:1.0.0</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Make the Quay repository public. A private repository works too, but then you need a pull secret for the cluster and registry credentials for the Image Updater, which adds two moving parts to the first test. There is a section on private registries further down.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify that the image runs locally before you involve a cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman run --rm -p 8080:8080 quay.io/tjungbau/simple-app:1.0.0
curl -s http://localhost:8080</code></pre>
</div>
</div>
<div class="paragraph">
<p>It should return the HTML page with the version number.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">&lt;html&gt;&lt;body style=&#34;font-family:sans-serif&#34;&gt;
&lt;h1&gt;simple-app&lt;/h1&gt;
&lt;p&gt;version: 1.0.0&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_kubernetes_manifests">The Kubernetes manifests</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The configuration repository <a class="bare" href="https://github.com/tjungbauer/argocd-image-updater-demo.git">https://github.com/tjungbauer/argocd-image-updater-demo.git</a> holds a Kustomize overlay. The layout is deliberately small:</p>
</div>
<div class="listingblock">
<div class="title">Repository layout</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">argocd-image-updater-demo/
└── overlays
    └── dev
        ├── deployment.yaml
        ├── service.yaml
        ├── route.yaml
        └── kustomization.yaml</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Change the repository URL to your own, if you want to use a different repository.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="title">overlays/dev/deployment.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps/v1
kind: Deployment
metadata:
  name: simple-app
  labels:
    app: simple-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: simple-app
  template:
    metadata:
      labels:
        app: simple-app
    spec:
      containers:
        - name: simple-app
          image: quay.io/tjungbau/simple-app:1.0.0 <i class="conum" data-value="1"></i><b>(1)</b>
          ports:
            - name: http
              containerPort: 8080
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
            requests:
              cpu: 10m
              memory: 16Mi
            limits:
              cpu: 100m
              memory: 64Mi
          securityContext: <i class="conum" data-value="2"></i><b>(2)</b>
            allowPrivilegeEscalation: false
            runAsNonRoot: true
            capabilities:
              drop:
                - ALL
            seccompProfile:
              type: RuntimeDefault</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The tag written here is only the starting point. Kustomize overrides it, and later the Image Updater overrides the Kustomize value.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>This block satisfies the <strong>restricted-v2</strong> security context constraint explicitly. OpenShift would inject most of it, but if the namespace enforces the restricted Pod Security Standard, the manifest has to carry it.</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="title">overlays/dev/service.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Service
metadata:
  name: simple-app
spec:
  selector:
    app: simple-app
  ports:
    - name: http
      port: 8080
      targetPort: http</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">overlays/dev/route.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: simple-app
spec:
  to:
    kind: Service
    name: simple-app
  port:
    targetPort: http
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">overlays/dev/kustomization.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: image-updater-demo
resources:
  - deployment.yaml
  - service.yaml
  - route.yaml
images: <i class="conum" data-value="1"></i><b>(1)</b>
  - name: quay.io/tjungbau/simple-app
    newTag: &#34;1.0.0&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>This is the parameter the Image Updater will modify. Without an <strong>images</strong> section, Kustomize has nothing to override and the Image Updater has nothing to write to.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Be sure that the above manifests are pushed to your repository.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_argo_cd_application">The Argo CD application</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Argo CD application is a normal one. No annotations, no special fields. As repository, we use the one we just created.</p>
</div>
<div class="listingblock">
<div class="title">Argo CD Application</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: image-updater-demo
  namespace: openshift-gitops <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  project: default
  source:
    repoURL: https://github.com/tjungbauer/argocd-image-updater-demo.git
    targetRevision: main
    path: overlays/dev
  destination:
    server: https://kubernetes.default.svc
    namespace: image-updater-demo
  syncPolicy:
    automated: <i class="conum" data-value="2"></i><b>(2)</b>
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Remember this namespace. The <strong>ImageUpdater</strong> resource has to live in the same namespace as the applications it references.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>With an automated sync policy an image update is rolled out immediately. Leave it out if you want a human to press the button.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply the application and check that it comes up:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f application.yaml
oc get application image-updater-demo -n openshift-gitops
oc get pods,route -n image-updater-demo</code></pre>
</div>
</div>
<div class="paragraph">
<p>Open the route in a browser. It should show <code>version: 1.0.0</code>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_enabling_the_argo_cd_image_updater">Enabling the Argo CD Image Updater</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The controller is enabled per Argo CD instance in the <strong>ArgoCD</strong> custom resource. By default, it is not enabled.</p>
</div>
<div class="listingblock">
<div class="title">Enable the Image Updater</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  imageUpdater:
    enabled: true <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Deploys the Image Updater controller for this Argo CD instance.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>If you manage the Argo CD instance declaratively, and you should (see <a href="/gitopscollection/2024-02-02-setup-argocd">Ep.3</a>), add the block to your existing manifest. For a quick test, patch the resource:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc patch argocd openshift-gitops -n openshift-gitops \
  --type merge \
  -p &#39;{&#34;spec&#34;:{&#34;imageUpdater&#34;:{&#34;enabled&#34;:true}}}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Wait for the controller to appear. The Operator names the deployment after the Argo CD instance, so for the default instance it is <strong>openshift-gitops-argocd-image-updater-controller</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get deployment -n openshift-gitops | grep image-updater</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">Example output</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">openshift-gitops-argocd-image-updater-controller   1/1     1     1     2m</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you use a differently named Argo CD instance, the deployment name changes with it. The commands in this article use the default name. Store it in a variable if you work on a custom instance.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Keep the log open in a second terminal for the rest of this article:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc logs -n openshift-gitops \
  deployment/openshift-gitops-argocd-image-updater-controller -f</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="_which_namespaces_are_watched">Which namespaces are watched</h3>
<div class="paragraph">
<p>By default the controller only looks at the namespace it was installed in. As soon as you use applications in any namespace, you have to tell it where else to look. This is done with environment variables in the same block:</p>
</div>
<div class="listingblock">
<div class="title">Watching several namespaces and tuning the controller</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  imageUpdater:
    enabled: true
    env:
      - name: IMAGE_UPDATER_LOGLEVEL <i class="conum" data-value="1"></i><b>(1)</b>
        value: info
      - name: IMAGE_UPDATER_WATCH_NAMESPACES <i class="conum" data-value="2"></i><b>(2)</b>
        value: &#34;openshift-gitops,image-updater-demo&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Log level of the controller. Valid values are <strong>debug</strong>, <strong>info</strong>, <strong>warn</strong> and <strong>error</strong>. Set it to <strong>debug</strong> while you build your first <strong>ImageUpdater</strong> resources. It tells you which tags were considered and why they were rejected.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Comma-separated list of namespaces watched for <strong>ImageUpdater</strong> resources and for Argo CD applications.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_first_imageupdater_resource">The first ImageUpdater resource</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <strong>ImageUpdater</strong> custom resource answers three questions:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>which applications</p>
</li>
<li>
<p>which images</p>
</li>
<li>
<p>where does the result go</p>
</li>
</ol>
</div>
<div class="listingblock">
<div class="title">imageupdater.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
  name: image-updater-demo
  namespace: openshift-gitops <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  applicationRefs:
    - namePattern: &#34;image-updater-demo&#34; <i class="conum" data-value="2"></i><b>(2)</b>
      images:
        - alias: &#34;simple-app&#34; <i class="conum" data-value="3"></i><b>(3)</b>
          imageName: &#34;quay.io/tjungbau/simple-app:~1.0&#34; <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The controller uses <strong>metadata.namespace</strong> to decide where to search for applications. A resource in <strong>openshift-gitops</strong> will never find an application in <strong>image-updater-demo</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Glob pattern matching the application name.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>A name for this image inside the resource. You need it when you map Helm parameters later.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The image, including a version constraint. <strong>~1.0</strong> allows patch releases inside 1.0, so 1.0.1 and 1.0.7 are accepted while 1.1.0 is not.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply it and check the status:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f imageupdater.yaml
oc get imageupdater image-updater-demo -n openshift-gitops -o yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>Check how many applications the resource matched:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get imageupdater image-updater-demo -n openshift-gitops \
  -o jsonpath=&#39;{.status.applicationsMatched}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>If this returns <strong>1</strong>, the selector works. If it returns <strong>0</strong> or nothing, the resource is in the wrong namespace or the name pattern does not match.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Always set a version constraint. Without one, the Image Updater may move to any newer version it finds, including a major release. In 1.21 the field <strong>spec.namespace</strong> was removed from this API. A resource that still contains it fails validation.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
A second rule that is easy to break in a large repository: never let two <strong>ImageUpdater</strong> resources match the same application. Both will update it and overwrite each other, and the image version will keep flipping back and forth.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_triggering_the_first_update">Triggering the first update</h3>
<div class="paragraph">
<p>Now build and push a new patch version:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman build --build-arg APP_VERSION=1.0.1 --platform linux/amd64 -t quay.io/tjungbau/simple-app:1.0.1 .
podman push quay.io/tjungbau/simple-app:1.0.1</code></pre>
</div>
</div>
<div class="paragraph">
<p>The controller polls the registry, so the update appears after the reconciliation interval. Watch the log, then confirm the result on the <strong>Application</strong> resource:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get application image-updater-demo -n openshift-gitops \
  -o jsonpath=&#39;{.spec.source.kustomize.images}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">Example output</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-text hljs" data-lang="text">[&#34;quay.io/tjungbau/simple-app:1.0.1&#34;]</code></pre>
</div>
</div>
<div class="paragraph">
<p>This is the default write-back method at work: the controller wrote a Kustomize parameter override into the <strong>Application</strong> resource on the cluster. Because the application has an automated sync policy, Argo CD rolls it out. Reload the route and the page shows <strong>version: 1.0.1</strong>.</p>
</div>
<div class="paragraph">
<p>The update history in the status tells you what happened and when:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get imageupdater image-updater-demo -n openshift-gitops -o jsonpath=&#39;{.status.recentUpdates}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="listingblock">
<div class="title">Example output</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">[{&#34;alias&#34;:&#34;simple-app&#34;,&#34;applicationsUpdated&#34;:1,&#34;image&#34;:&#34;quay.io/tjungbau/simple-app&#34;,&#34;message&#34;:&#34;Updated from 1.0.0 to 1.0.1.&#34;,&#34;newVersion&#34;:&#34;1.0.1&#34;,&#34;updatedAt&#34;:&#34;2026-09-15T15:36:07Z&#34;}]</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now look at the repository. Nothing changed there. The <code>kustomization.yaml</code> still says <code>1.0.0</code>, and the cluster runs <code>1.0.1</code>. Argo CD simply overrides the value with the new one. That is the reason the next section exists.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_write_back_methods">Write-back methods</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_method_1_argo_cd_api_the_default">Method 1: Argo CD API, the default</h3>
<div class="paragraph">
<p>The controller writes the new image into the <strong>Application</strong> resource, which is what you just saw. No configuration is needed. If you omit <strong>writeBackConfig</strong>, this is what you get.</p>
</div>
<div class="paragraph">
<p><strong>It is quick and it is simple</strong>. It also has a failure mode that costs people an afternoon: if the <strong>Application</strong> itself is managed in Git, for example through an App-of-Apps pattern (see <a href="/gitopscollection/2024-04-02-configure_app_of_apps">Ep.4</a>), the next sync from Git overwrites the parameter override. The cluster falls back to the old image and the reason is not obvious.</p>
</div>
<div class="paragraph">
<p>Use this method for applications created through the UI or the CLI, and for experiments like the one above.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Do not treat this method as a production-ready solution.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_method_2_git_write_back">Method 2: Git write-back</h3>
<div class="paragraph">
<p>The Git method fits the idea that the repository is the single source of truth. The controller clones the repository, checks out the branch, writes the change and pushes it.</p>
</div>
<div class="paragraph">
<p>Here a secret must be created that holds credentials with <strong>write access</strong> to the configuration repository. For HTTPS the secret needs the keys <strong>username</strong> and <strong>password</strong>, and the password should be a personal access token:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create secret generic git-creds -n openshift-gitops \
  --from-literal=username=my-bot-user \
  --from-literal=password=&lt;personal_access_token&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Then extend the <code>ImageUpdater</code>:</p>
</div>
<div class="listingblock">
<div class="title">Git write-back</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argocd-image-updater.argoproj.io/v1alpha1
kind: ImageUpdater
metadata:
  name: my-app-updater
  namespace: openshift-gitops
spec:
  applicationRefs:
    - namePattern: &#34;my-app-dev&#34;
      images:
        - alias: &#34;simple-app&#34;
          imageName: &#34;quay.io/tjungbau/simple-app:~1.0&#34;
  writeBackConfig:
    method: &#34;git:secret:openshift-gitops/git-creds&#34; <i class="conum" data-value="1"></i><b>(1)</b>
    gitConfig:
      repository: &#34;https://github.com/tjungbauer/argocd-image-updater-demo.git&#34; <i class="conum" data-value="2"></i><b>(2)</b>
      branch: &#34;main&#34; <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Use the Git method with the credentials from the referenced secret. Plain <strong>method: &#34;git&#34;</strong> reuses the credentials Argo CD already has for the repository, which are often read-only.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The repository that receives the commit.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The target branch.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
The secret has to live in the same namespace as the <strong>ImageUpdater</strong> resource (here: <strong>openshift-gitops</strong>). Cross-namespace references are rejected, so that a team cannot read a secret it does not own.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Push version 1.0.2 and watch the repository:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman build --build-arg APP_VERSION=1.0.2 --platform linux/amd64 -t quay.io/tjungbau/simple-app:1.0.2 .
podman push quay.io/tjungbau/simple-app:1.0.2</code></pre>
</div>
</div>
<div class="paragraph">
<p>By default the controller does not touch your <strong>kustomization.yaml</strong>. It creates or updates a file called <strong>.argocd-source-image-updater-demo.yaml</strong> in the application path. That file contains a parameter override which Argo CD merges on top of the rendered manifests. Your own files stay untouched, which is safe, but it also means the repository now contains two statements about the image version: <strong>kustomization.yaml</strong> says 1.0.0 and the generated file says 1.0.2.</p>
</div>
<div class="paragraph">
<p>If you prefer the commit to change the source of truth itself, set a write-back target:</p>
</div>
<div class="listingblock">
<div class="title">Kustomize write-back</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  writeBackConfig:
    method: &#34;git:secret:openshift-gitops/git-creds&#34;
    gitConfig:
      repository: &#34;https://github.com/mycompany/my-app-config.git&#34;
      branch: &#34;main&#34;
      writeBackTarget: &#34;kustomization&#34; <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The change is committed as a <code>kustomize edit set image</code> operation, so <code>kustomization.yaml</code> carries the new tag.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>For Helm applications the equivalent target is a values file:</p>
</div>
<div class="listingblock">
<div class="title">Helm write-back</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  writeBackConfig:
    method: &#34;git:secret:openshift-gitops/git-creds&#34;
    gitConfig:
      branch: &#34;main&#34;
      writeBackTarget: &#34;helmvalues:/helm/config/values.yaml&#34;</code></pre>
</div>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
after switching from the API method to a Git method, remove the leftover override from the <strong>Application</strong> resource once, otherwise the old value stays in <strong>spec.source.kustomize.images</strong> and keeps winning: <strong>oc patch application my-app-dev -n openshift-gitops --type json -p &#39;[{&#34;op&#34;:&#34;remove&#34;,&#34;path&#34;:&#34;/spec/source/kustomize/images&#34;}]&#39;</strong>
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_method_3_pull_request_or_merge_request">Method 3: Pull request or merge request</h3>
<div class="paragraph">
<p>If your <strong>main</strong> branch is protected, which makes sense, the controller cannot push to it. The pull request method extends the Git method. The commit goes to a generated branch named <strong>image-updater-&lt;namespace&gt;-&lt;appName&gt;-&lt;sha256&gt;</strong>, and a pull or merge request is opened against the base branch. If a request for the same branch pair already exists, no duplicate is created.</p>
</div>
<div class="listingblock">
<div class="title">GitHub pull request</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  writeBackConfig:
    method: &#34;git:secret:openshift-gitops/git-creds&#34;
    gitConfig:
      repository: &#34;https://github.com/mycompany/my-app-config.git&#34;
      branch: &#34;main&#34;
      pullRequest:
        github: {} <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>For GitLab, use <strong>gitlab: {}</strong> instead.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Push version 1.0.3 and watch the repository:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman build --build-arg APP_VERSION=1.0.3 --platform linux/amd64 -t quay.io/tjungbau/simple-app:1.0.3 .
podman push quay.io/tjungbau/simple-app:1.0.3</code></pre>
</div>
</div>
<div class="paragraph">
<p>And once the Controller has created the pull request, you can see it in the GitHub UI:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/ep-17-git-pullrequest.png?width=800" alt="Pull Request"/>
</div>
</div>
<div class="paragraph">
<p>This pull request can now be reviewed and merged (or rejected).</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Creating a pull request requires credentials with a bearer token, so a personal access token or GitHub App credentials. SSH keys do not work here, because the controller has to call the SCM API over HTTP and an SSH key provides no token for that.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_choosing_a_method">Choosing a method</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;"/>
<col style="width: 40%;"/>
<col style="width: 40%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Use it when</th>
<th class="tableblock halign-left valign-top">Consequence</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Argo CD API</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Playgrounds, demos, applications not managed in Git</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A sync from Git reverts the update</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Git, direct push</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Development and test environments</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A bot account with write access to the configuration repository</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Git, pull request</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Production and protected branches</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Somebody has to merge the request, otherwise nothing is deployed</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_update_strategies">Update strategies</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A tag like <code>v1.0.0-3f2a1b</code> is not a semantic version, and <code>latest</code> never changes its name. Four strategies are available, configured with <strong>commonUpdateSettings.updateStrategy</strong>:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 75%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Strategy</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>semver</strong> (default)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Updates to the highest version matching the semantic version constraint. The right choice when the pipeline produces release tags, as in the example above.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>newest-build</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Updates to the tag with the most recent creation timestamp, regardless of version numbering. This is the strategy for pipelines that tag with a build ID or a commit SHA.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>alphabetical</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Updates to the last tag when sorted alphabetically. Useful for date-based tags such as <code>2026-09-06</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>digest</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Tracks a mutable tag such as <code>latest</code> by its SHA256 digest and updates when the digest changes.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>In practice a strategy is combined with a tag filter, because registries contain plenty of tags you usually do not want to deploy:</p>
</div>
<div class="listingblock">
<div class="title">newest-build with a tag filter</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  applicationRefs:
    - namePattern: &#34;image-updater-demo&#34;
      images:
        - alias: &#34;simple-app&#34;
          imageName: &#34;quay.io/tjungbau/simple-app&#34;
          commonUpdateSettings:
            updateStrategy: &#34;newest-build&#34; <i class="conum" data-value="1"></i><b>(1)</b>
            allowTags: &#34;regexp:^build-[0-9]+$&#34; <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Take the most recently built image instead of the highest number.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Only tags matching this regular expression are considered.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Two parameters control the filtering:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>allowTags</strong></dt>
<dd>
<p>A match function applied to every tag. Supports <strong>regexp:&lt;expression&gt;</strong> and <strong>any</strong>, which is the default.</p>
</dd>
<dt class="hdlist1"><strong>ignoreTags</strong></dt>
<dd>
<p>A comma-separated list of glob patterns that are excluded.</p>
</dd>
</dl>
</div>
<div class="listingblock">
<div class="title">Allowing release tags and ignoring release candidates</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">          commonUpdateSettings:
            allowTags: &#34;regexp:^[0-9]+\\.[0-9]+\\.[0-9]+$&#34;
            ignoreTags: &#34;*-rc*&#34;</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
If a filter does not behave as expected, set <strong>IMAGE_UPDATER_LOGLEVEL</strong> to <strong>debug</strong>. The log shows which tags were fetched and which ones survived the filter. That is faster than guessing at the regular expression.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>To try the <strong>newest-build</strong> strategy with the demo image, push a few tags in a row:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">for i in 1 2 3; do
  podman build --build-arg APP_VERSION=&#34;build-${i}&#34; -t quay.io/tjungbau/simple-app:build-${i} .
  podman push quay.io/tjungbau/simple-app:build-${i}
done</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_selecting_applications">Selecting applications</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Name patterns are convenient, but in a fleet generated by an ApplicationSet, labels scale better:</p>
</div>
<div class="listingblock">
<div class="title">Selecting applications by label</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  applicationRefs:
    - labelSelectors:
        matchLabels:
          tier: &#34;frontend&#34;
        matchExpressions:
          - key: env
            operator: In
            values:
              - staging
              - production
      images:
        - alias: &#34;simple-app&#34;
          imageName: &#34;quay.io/&lt;your_quay_account&gt;/simple-app:~1.0&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Name pattern and label selector can be combined, in which case both have to match.</p>
</div>
<div class="paragraph">
<p>There is a third variant meant for ApplicationSets. If every generated application should carry its own image configuration, set <strong>useAnnotations: true</strong>. The controller then reads the configuration from the <strong>argocd-image-updater.argoproj.io/image-list</strong> annotation of each application instead of from the resource:</p>
</div>
<div class="listingblock">
<div class="title">Reading the image configuration from the applications</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  applicationRefs:
    - namePattern: &#34;generated-app-*&#34;
      useAnnotations: true <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>With this enabled, an <strong>images</strong> block in the resource is ignored for this <strong>applicationRef</strong>. Only <strong>namePattern</strong> and <strong>labelSelectors</strong> remain effective.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Combining <code>useAnnotations: true</code> with <code>namePattern: &#34;*&#34;</code> and no label selector means every application in the namespace is processed. That works, but it costs performance on a large instance.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_private_registries">Private registries</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Public registries work without configuration. For a private one you have two options.</p>
</div>
<div class="paragraph">
<p>Per image, reference a pull secret in the <code>ImageUpdater</code>:</p>
</div>
<div class="listingblock">
<div class="title">Using a pull secret for one image</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  applicationRefs:
    - namePattern: &#34;my-app-dev&#34;
      images:
        - alias: &#34;simple-app&#34;
          imageName: &#34;registry.example.com/mycompany/simple-app:~1.0&#34;
          pullSecret: &#34;pullsecret:openshift-gitops/myregistry-pull-secret&#34; <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Uses a Docker-style pull secret with a <strong>.dockerconfigjson</strong> key.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The well-known registries are supported out of the box.</p>
</div>
<div class="paragraph">
<p>For a registry that is not known out of the box, describe it once in the <strong>argocd-image-updater-config</strong> config map in the namespace of the Argo CD instance:</p>
</div>
<div class="listingblock">
<div class="title">Registering a custom registry</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-image-updater-config
  namespace: openshift-gitops
data:
  registries.conf: |
    registries:
    - name: My Private Registry
      prefix: myregistry.example.com <i class="conum" data-value="1"></i><b>(1)</b>
      api_url: https://myregistry.example.com <i class="conum" data-value="2"></i><b>(2)</b>
      credentials: secret:openshift-gitops/registry-creds#creds <i class="conum" data-value="3"></i><b>(3)</b>
      default: false <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The prefix that image names start with.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The registry API endpoint.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Credentials for querying the registry API.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Whether this registry is used for images without a registry prefix.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_practical_considerations">Practical considerations</h2>
<div class="sectionbody">
<div class="paragraph">
<p>These are the questions that come up in customer workshops.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>Who is committing to our repository?</strong></dt>
<dd>
<p>A bot account with a personal access token. Treat it like any other privileged identity: a dedicated account, minimal scope, rotated regularly, and no administrator rights. If branch protection requires signed commits, the git command line inside the controller has to sign them, which means providing a GPG or SSH signing key to the pod. Upstream this is configured with <strong>git.commit-signing-key</strong> and <strong>git.commit-signing-method</strong> in the <strong>argocd-image-updater-config</strong> config map. I was not able to test this yet, but it should be considered for production use.</p>
</dd>
<dt class="hdlist1"><strong>Does this break our Secure Supply Chain?</strong></dt>
<dd>
<p>No, but it changes where the gate sits. Previously the pipeline was the only writer, and it had already verified signatures, scanned the image with ACS and generated an SBOM (see <a href="/securesupplychain/2023-06-15-securesupplychain-intro">the Secure Supply Chain series</a>). If the Image Updater now picks images directly from the registry, the tag itself becomes the contract. Let the pipeline push a release tag such as <strong>1.2.3</strong> only after all checks passed, and restrict the Image Updater with <code>allowTags: &#34;regexp:^<span class="0-9">\.[0-9]</span>\.[0-9]+$&#34;</code>. Everything that failed a check never gets a tag that the Image Updater accepts.</p>
</dd>
<dt class="hdlist1"><strong>Can we roll back?</strong></dt>
<dd>
<p>With a Git write-back method, a rollback is a <strong>git revert</strong>. With the API method there is nothing to revert.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_limitations">Limitations</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>Only Kustomize-rendered and Helm-rendered manifests are supported. A Helm chart has to expose parameters for the image.</p>
</li>
<li>
<p>Image pull secrets have to exist on the cluster where the controller runs.</p>
</li>
<li>
<p>One application has to be targeted by exactly one <strong>ImageUpdater</strong> resource.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Argo CD Image Updater replaces a piece of glue that most of us wrote ourselves, and it does so declaratively. An <strong>ImageUpdater</strong> resource states which applications are watched, which images are tracked, which versions are acceptable and where the result is persisted. Since OpenShift GitOps 1.21 it is generally available and enabled with one flag in the <strong>ArgoCD</strong> custom resource.</p>
</div>
<div class="paragraph">
<p>If you take one thing from this article, let it be the write-back decision. The default API method is the fastest way to a working demo and the fastest way to a confusing incident. For anything that matters, write back to Git: directly on a development branch, and through a pull request wherever the branch is protected. The repository stays the source of truth, a rollback stays a <strong>git revert</strong>, and the audit trail stays intact.</p>
</div>
<div class="paragraph">
<p>And as always: <strong>If it is not in Git, it does not exist.</strong></p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.16] Tuning OpenShift GitOps for performance at scale</title><link>https://blog.stderr.at/gitopscollection/2026-03-27-openshift-gitops-performance-tuning/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-03-27-openshift-gitops-performance-tuning/</guid><pubDate>Wed, 15 Apr 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>GitOps</category><category>OpenShift</category><description>Performance tuning for OpenShift GitOps at scale: controller reconcile settings, sharding, repo-server cache and how the ArgoCD CR maps upstream.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Argo CD is a powerhouse for GitOps. It is easy to get started with and helps you manage clusters and applications. As the number of clusters, applications, and repositories grows, performance can suffer: refreshes take longer, the UI may feel sluggish, and the experience turns frustrating.</p>
</div>
<div class="paragraph">
<p>This article is about performance tuning: which options exist, which scenarios matter, and which settings might help in your environment.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>GitOps has become a common way to manage configuration drift, and Argo CD is one of the most widely used tools for it. It keeps the desired state defined in Git aligned with what actually runs in the cluster. On Kubernetes you can use Argo CD to manage multiple clusters from a single management cluster (other topologies exist) and to synchronise multiple repositories. A typical pattern is two Argo CD instances: one for cluster configuration and one for application rollout (though many variants work).</p>
</div>
<div class="paragraph">
<p>What holds across setups is that Argo CD tends to slow down as its configuration grows and as the repositories it syncs from get larger and busier.</p>
</div>
<div class="paragraph">
<p>For example, imagine you have a single repository with thousands of commits. By default, Argo CD synchronises the whole repository, including the history. This is one screw that can be tightened.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_argo_cd_components">Argo CD Components</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Argo CD is made up of several cooperating components. In rough data-flow order, they are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Repo Server</strong>: Connects to Git repositories, clones and syncs them, and generates manifests (for example with Helm or Kustomize). It uses <strong>Redis</strong> for caching.</p>
</li>
<li>
<p><strong>Redis</strong>: Caches generated manifests and other data the other components reuse (default 24h).</p>
</li>
<li>
<p><strong>Server</strong>: Exposes the API and UI; it reads from Redis to verify if it is still valid.</p>
</li>
<li>
<p><strong>ApplicationSet Controller</strong>: Reconciles <code>ApplicationSet</code> resources and creates <code>Application</code> objects that the application controller picks up.</p>
</li>
<li>
<p><strong>Application Controller</strong>: Reconciles desired state with live state in the cluster—creating, updating, and deleting resources as needed.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
You may also see extra pods (for example Dex or a GitOps plugin). They are not central to the core sync path covered here; tuning them is mostly a matter of resources and replicas.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_tldr_an_overview">TL;DR: an overview</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When starting with this article, I did not expect to fall down into the rabbit hole. The article became bigger and bigger and I am pretty sure that there will be settings that I missed, even though I search the actual source code.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you find anything missing, please let me know. I am happy to add it.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following overview table summarises the settings discussed in this article. <strong>Default</strong> and <strong>example recommended</strong> values are indicative—always validate in your environment. If you want a quick overview, start here.</p>
</div>
<table class="tableblock frame-all grid-all stretch settings-overview">
<colgroup>
<col style="width: 18%;"/>
<col style="width: 12%;"/>
<col style="width: 13%;"/>
<col style="width: 22%;"/>
<col style="width: 35%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Setting</th>
<th class="tableblock halign-left valign-top">Default</th>
<th class="tableblock halign-left valign-top">Recommended</th>
<th class="tableblock halign-left valign-top">Standalone Argo CD</th>
<th class="tableblock halign-left valign-top">OpenShift GitOps (ArgoCD CR)</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-git-depth">Git shallow clone (depth)</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Full history</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Repository Secret with stringData.depth / data.depth (base64).</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: my-repo
  namespace: openshift-gitops
  labels:
    argocd.argoproj.io/secret-type: repository
stringData:
  url: https://github.com/org/repo.git
  depth: &#34;1&#34;
  type: git
type: Opaque</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-repo-parallelism-limit">ARGOCD_REPO_SERVER_PARALLELISM_LIMIT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0 (unlimited)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20 then tune (avoid OOM)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cmd-params-cm</code> → reposerver.parallelism.limit, or env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  repo:
    env:
      - name: ARGOCD_REPO_SERVER_PARALLELISM_LIMIT
        value: &#34;20&#34;</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-git-ls-remote-parallelism">ARGOCD_GIT_LS_REMOTE_PARALLELISM_LIMIT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0 (unlimited)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20 when Git rate limits bite</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment (or <code>argocd-cmd-params-cm</code> if your version maps it).</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  repo:
    env:
      - name: ARGOCD_GIT_LS_REMOTE_PARALLELISM_LIMIT
        value: &#34;20&#34;</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-exec-timeout">ARGOCD_EXEC_TIMEOUT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">90s</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">180s or higher for heavy Helm/Kustomize</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  repo:
    env:
      - name: ARGOCD_EXEC_TIMEOUT
        value: 180s</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-exec-fatal-timeout">ARGOCD_EXEC_FATAL_TIMEOUT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10s</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Leave default unless you change SIGTERM→SIGKILL grace</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  repo:
    env:
      - name: ARGOCD_EXEC_FATAL_TIMEOUT
        value: 10s</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-git-attempts-count">ARGOCD_GIT_ATTEMPTS_COUNT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3–5 on flaky networks</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  repo:
    env:
      - name: ARGOCD_GIT_ATTEMPTS_COUNT
        value: &#34;3&#34;</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-repo-cache-expiration">ARGOCD_REPO_CACHE_EXPIRATION</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">24h</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Often keep 24h; shorten only with care</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  repo:
    env:
      - name: ARGOCD_REPO_CACHE_EXPIRATION
        value: 24h</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-revision-cache-lock-timeout">ARGOCD_REVISION_CACHE_LOCK_TIMEOUT</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10s</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Raise if large charts hit lock timeouts (e.g. 30s)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-repo-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  repo:
    env:
      - name: ARGOCD_REVISION_CACHE_LOCK_TIMEOUT
        value: 30s</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-server-repo-timeout">ARGOCD_SERVER_REPO_SERVER_TIMEOUT_SECONDS</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">60</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Align with repo render time (e.g. 180)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Env on <code>argocd-server</code> Deployment.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  server:
    env:
      - name: ARGOCD_SERVER_REPO_SERVER_TIMEOUT_SECONDS
        value: &#34;180&#34;</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-controller-sharding">Application Controller Sharding</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Disabled / single replica</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable for multi-cluster; algorithm + replicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">HA StatefulSet, argocd-cmd-params-cm controller.sharding.algorithm, ARGOCD_CONTROLLER_REPLICAS / ARGOCD_CONTROLLER_SHARD on pods.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    env:
      - name: ARGOCD_CONTROLLER_SHARDING_ALGORITHM
        value: round-robin
    sharding:
      enabled: true
      replicas: 3
      minShards: 2
      maxShards: 5</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-timeout-reconciliation">timeout.reconciliation</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">3m</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">600s–3600s with webhooks</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cm</code> data.timeout.reconciliation.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  extraConfig:
    timeout.reconciliation: 600s</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-timeout-reconciliation-jitter">timeout.reconciliation.jitter</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">60s (if unset, controller default applies)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Keep a fraction of timeout.reconciliation (often tens of seconds); 0s = no random spread</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cm</code> data.timeout.reconciliation.jitter → env ARGOCD_RECONCILIATION_JITTER on the controller.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  extraConfig:
    timeout.reconciliation: 600s
    timeout.reconciliation.jitter: 60s</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-status-processors">controller.status.processors</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">50–100 at large scale</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cmd-params-cm</code> controller.status.processors.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    processors:
      status: 50</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-operation-processors">controller.operation.processors</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">10</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Raise when the sync queue backs up</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cmd-params-cm</code> controller.operation.processors.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    processors:
      operation: 25</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-controller-repo-server-timeout">ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS + controller.repo.server.timeout.seconds</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">60</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">120–300 for slow manifest RPCs</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cmd-params-cm</code> controller.repo.server.timeout.seconds (or env ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS on the controller).</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    env:
      - name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS
        value: &#34;180&#34;</code></pre>
</div>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#setting-kubectl-parallelism">ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT + controller.kubectl.parallelism.limit</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">20</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Match or slightly below operation processors (e.g. 50)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>argocd-cmd-params-cm</code> controller.kubectl.parallelism.limit.</p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="listingblock nolangbadge">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    env:
      - name: ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT
        value: &#34;50&#34;</code></pre>
</div>
</div></div></td>
</tr>
</tbody>
</table>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<strong>Standalone Argo CD</strong> uses <code>argocd-cm</code>, <code>argocd-cmd-params-cm</code>, and environment variables on the upstream Deployments / StatefulSets. The <strong>OpenShift GitOps</strong> column shows <code>spec</code> fragments merged into the <code>ArgoCD</code> CR (<code>metadata.name</code> / <code>metadata.namespace</code> <code>openshift-gitops</code>); use the same <code>spec</code> under <code>metadata.name</code> / <code>namespace</code> <code>argocd</code> for a community <strong>Argo CD Operator</strong> install. Repository <code>depth</code> is always a <code>Secret</code>, not a field on <code>ArgoCD</code>.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_lets_start_tuning">Let’s start tuning</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before we discuss the obvious settings, like increasing replicas, resources, or configuring sharding, let’s take a look at the often-overlooked settings.</p>
</div>
<div class="sect2">
<h3 id="setting-git-depth">Repo-Server: Git shallow cloning</h3>
<div class="paragraph">
<p>By default Argo CD will clone the whole repository including the history. Depending on the repository size this can take a long time. By limiting the commit history downloaded by the argocd-repo-server, you can drastically reduce fetch times, bandwidth, and resource consumption, especially for large monorepos.</p>
</div>
<div class="paragraph">
<p>To configure <strong>Git shallow cloning</strong>, set the <code>depth</code> parameter to the number of commits you want to clone. For example, to clone only the latest commit, set the <code>depth</code> parameter to <code>1</code>. This setting applies at the repository level, so you must configure it in the Secret object for each repository.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
When you work with <strong>public</strong> repositories you might not have this Secret object. In that case you need to create that Secret object for the public repository.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Here is an example of a Secret object for a <strong>public repository</strong>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: Secret
apiVersion: v1
metadata:
  name: repo-2960947011
  namespace: openshift-gitops
  labels:
    argocd.argoproj.io/secret-type: repository <i class="conum" data-value="1"></i><b>(1)</b>
  annotations:
    managed-by: argocd.argoproj.io
stringData:
  depth: 1 <i class="conum" data-value="2"></i><b>(2)</b>
  type: Git
  url: https://github.com/tjungbauer/openshift-clusterconfig-gitops <i class="conum" data-value="3"></i><b>(3)</b>
type: Opaque</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The label is used to identify the Secret object as a repository secret.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The depth parameter is the number of commits you want to clone.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The url field is the repository URL.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In the logs of the repo server we can see the different calls to the Git repository:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-log hljs" data-lang="log"># Without depth parameter
time=&#34;2026-04-12T02:42:44Z&#34; level=info msg=&#34;Initializing https://github.com/tjungbauer/openshift-clusterconfig-gitops to /tmp/_argocd-repo/991f2e97-c2ca-4fd0-8988-b9af2f1b228e&#34;
[...truncated...]
time=&#34;2026-04-12T02:42:45Z&#34; level=info msg=Trace args=&#34;[git fetch origin --tags --force --prune]&#34; dir=/tmp/_argocd-repo/991f2e97-c2ca-4fd0-8988-b9af2f1b228e operation_name=&#34;exec git&#34; time_ms=1011.528864 <i class="conum" data-value="1"></i><b>(1)</b>

# With depth parameter
time=&#34;2026-04-12T02:45:23Z&#34; level=info msg=&#34;Initializing https://github.com/tjungbauer/openshift-clusterconfig-gitops to /tmp/_argocd-repo/fcd62851-9f0f-4c0b-aa61-039327adc256&#34;
[...truncated...]
time=&#34;2026-04-12T02:45:23Z&#34; level=info msg=Trace args=&#34;[git fetch origin 0a2f72afe511023aa2a86560de24f6046644c286 --depth 1 --force --prune]&#34; dir=/tmp/_argocd-repo/fcd62851-9f0f-4c0b-aa61-039327adc256 operation_name=&#34;exec git&#34; time_ms=559.205253 <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Without a <code>depth</code> value, the whole history of the repository is fetched, which takes almost twice as long.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>With <code>depth</code> set, Git fetches only the requested shallow history.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Do not forget that the <code>depth</code> parameter must be added to the Secret. If you use a public repository you might need to create the Secret object manually.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#shallow-clone" rel="noopener" target="_blank">Argo CD: Shallow clone</a></p>
</div>
<hr/>
</div>
<div class="sect2">
<h3 id="_repo_server_environment_variables_to_boost_performance">Repo-Server: Environment variables to boost performance</h3>
<div class="paragraph">
<p>The repo server container can be configured with environment variables to boost performance.
When you use the OpenShift GitOps Operator, set these variables in the <code>spec.repo.env</code> section of the <code>ArgoCD</code> custom resource, for example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
[...truncated...]
  repo:
    env:
      - name: ENV_NAME
        value: &#34;VALUE&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you prefer to use a ConfigMap (or Secret) instead, you can do so by setting a reference:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    env:
      - valueFrom:
          configMapKeyRef:
            name: my-configmap
            key: my-key
            optional: true</code></pre>
</div>
</div>
<div class="paragraph">
<p>The variables are passed as a simple list to the container.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
If you do not use the operator you can set these values in the repo server deployment or the Argo CD ConfigMap.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following environment variables might be considered:</p>
</div>
<div class="sect3">
<h4 id="setting-repo-parallelism-limit">ARGOCD_REPO_SERVER_PARALLELISM_LIMIT (Default: 0)</h4>
<div class="paragraph">
<p>This variable defines the <strong>maximum number of parallel fetches</strong> of the Git repository. The most common issue arises when the repo server crashes with <strong>OOM</strong> errors. By default this variable is set to <code>0</code>, which means no limit.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Imagine you have a single repository with 500 applications. If you push new code to the repo, Argo CD detects the change and tries to generate the manifests for all applications at once. That can mean a large number of <code>helm template</code> or <code>kustomize build</code> commands running concurrently, which results in:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>High CPU spikes</p>
</li>
<li>
<p>Very high memory use, leading to <code>OOMKilled</code> containers and possibly a crash loop for the repo server</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>When you set a value greater than <code>0</code> (for example, <code>20</code>), you configure a strict worker pool (a semaphore).</p>
</div>
<div class="paragraph">
<p>If 500 requests arrive, the repo server only processes 20 at a time. The remaining 480 requests wait in a queue until a worker is free.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Applications might take a few extra seconds to sync during large bursts of activity.</p>
</li>
<li>
<p>Advantage: Your argocd-repo-server stays stable, remains online, and avoids repeated OOM kills.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
There is no one-size-fits-all value here. The best approach is to start with a modest number such as <code>20</code> and monitor the behaviour of the repo server.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/base/repo-server/argocd-repo-server-deployment.yaml#L62" rel="noopener" target="_blank">Argo CD: Repo server deployment</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-git-ls-remote-parallelism">ARGOCD_GIT_LS_REMOTE_PARALLELISM_LIMIT (Default: 0)</h4>
<div class="paragraph">
<p>While the previous setting protects your Kubernetes cluster, this setting <strong>protects your Git service</strong> from being overwhelmed by too many concurrent requests. Argo CD periodically runs <code>git ls-remote</code> to check for new commits.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Imagine that we still have 500 applications pointing to a single repository and branch (for example, main). When reconciliation runs, Argo CD runs <code>git ls-remote</code> for each of the 500 applications at the same time to check for new commits. If your Git provider enforces a strict rate limit, this might lead to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Request throttling by the Git provider</p>
</li>
<li>
<p>Your repository or organisation being completely blocked by the Git provider</p>
</li>
<li>
<p>Applications left in an <code>Unknown</code> state in Argo CD</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Setting this value adds a second limit. When you set a value greater than 0 (for example, <code>20</code>), the repo server opens at most 20 concurrent connections to the Git provider. The remaining requests wait in a queue until a connection is free.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Slower reconciliation for applications that are not yet synced.</p>
</li>
<li>
<p>Advantage: You are less likely to hit rate limits on your Git provider.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do not set the value too low. For example, a value of <code>2</code> might cause timeouts in the application controller if requests wait too long in the queue.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/base/repo-server/argocd-repo-server-deployment.yaml#L236" rel="noopener" target="_blank">Argo CD: Repo server deployment</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-exec-timeout">ARGOCD_EXEC_TIMEOUT (Default: 90s)</h4>
<div class="paragraph">
<p>Sets the <strong>maximum time for child processes</strong> (Helm, Kustomize, additional plugins, etc.). The repo server uses these tools to generate the final Kubernetes manifests for your applications. When the value is too low, it might lead to timeouts for slow charts.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Imagine you are deploying applications that rely on very large or complex Helm charts and Kustomize overlays. Because these charts take longer to render, the child process might need more than the default 90 seconds to complete.
If the timeout expires before rendering finishes, you may see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Timeouts in the application controller for slow charts.</p>
</li>
<li>
<p>Applications failing to sync and throwing rendering errors.</p>
</li>
<li>
<p>Frustration when heavy but valid configurations break simply because they need more time to render.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>By adjusting this value (for example, configuring it to 180s) you give the repo server more time to finish rendering complex manifests. It tells Argo CD to wait longer before killing the child process.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: A higher timeout means a genuinely hung process holds resources longer before Argo CD finally terminates it.</p>
</li>
<li>
<p>Advantage: Complex, large, or slow-rendering charts have enough time to generate manifests successfully.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do not set the value too high. An excessively high timeout stops Argo CD from failing fast under severe load or when a rendering process hangs.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#argocd-repo-server" rel="noopener" target="_blank">Argo CD: High Availability Guide</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-exec-fatal-timeout">ARGOCD_EXEC_FATAL_TIMEOUT (Default: 10s)</h4>
<div class="paragraph">
<p>This setting complements <code>ARGOCD_EXEC_TIMEOUT</code>. It is used to <strong>forcibly terminate a child process</strong> (such as Helm, Kustomize, etc.) if it cannot exit gracefully.
When execution exceeds ARGOCD_EXEC_TIMEOUT, Argo CD sends <code>SIGTERM</code>. If the process still has not exited when the fatal timeout elapses, Argo CD sends <code>SIGKILL</code>.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Imagine a scenario where a manifest generation tool or a custom plugin gets completely stuck in an unresponsive state.
When the standard <code>ARGOCD_EXEC_TIMEOUT</code> is reached, Argo CD asks the process to stop gracefully. If the child process ignores that request or is fully deadlocked, you may see:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Zombie processes consuming memory and CPU on the repo server.</p>
</li>
<li>
<p>The repo server eventually running out of resources.</p>
</li>
<li>
<p>Subsequent application syncs failing or hanging indefinitely because the underlying tools are locked up.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Setting this value adds a strict fallback limit. When configured (for example, setting it to 120s if your regular timeout is 90s), it tells Argo CD to intervene and mercilessly terminate the process if it hasn’t exited by this hard deadline.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Force-killing a process prevents it from cleaning up after itself.</p>
</li>
<li>
<p>Advantage: It guarantees that a hung process will not permanently lock up the repo server’s compute resources.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
I personally would <strong>not set this value</strong> if it is not absolutely necessary. The default 10 seconds should be enough for most cases.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#argocd-repo-server" rel="noopener" target="_blank">Argo CD: High Availability Guide</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-git-attempts-count">ARGOCD_GIT_ATTEMPTS_COUNT (Default: 1)</h4>
<div class="paragraph">
<p>This variable sets the <strong>maximum number of retry attempts</strong> for failed Git repository requests. When Argo CD interacts with your Git provider, network hiccups, temporary outages, or rate limiting or throttling by the provider can cause a Git request to fail unexpectedly.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>For example, if multiple concurrent requests hit the provider, the provider might randomly reset the connection (often seen as a connection reset by peer or ssh: handshake failed error in the logs). With the default setting of one attempt, Argo CD fails the sync or reconciliation immediately when this happens, leaving applications in an <code>Unknown</code> state or surfacing a sync error.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Increasing this value (for example, to <code>3</code>, <code>5</code>, or even <code>10</code> in heavily throttled environments) configures Argo CD to retry the failed Git operation automatically before surfacing a hard error.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: If your Git provider is genuinely down (for example, a major GitHub outage) or your credentials have expired, the repo server wastes time retrying an operation that cannot succeed.</p>
</li>
<li>
<p>Advantage: It improves resilience against flaky network paths, temporary DNS issues, and provider rate limiting.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Avoid setting this to an unrealistically high value (such as <code>50</code>) unless you are addressing a specific, known throttling problem. A very high retry count can leave the repo server tied up on a bad repository for minutes, and you will still hit <code>ARGOCD_EXEC_TIMEOUT</code> in the end. In practice, values between <code>3</code> and <code>5</code> are a good balance for stability.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#argocd-repo-server" rel="noopener" target="_blank">Argo CD: High Availability Guide</a></p>
</div>
<hr/>
</div>
</div>
<div class="sect2">
<h3 id="_repo_server_caching_optimizations">Repo-Server: Caching optimizations</h3>
<div class="paragraph">
<p>The following additional environment variables are focused on caching optimizations.</p>
</div>
<div class="sect3">
<h4 id="setting-repo-cache-expiration">ARGOCD_REPO_CACHE_EXPIRATION (Default: 24h)</h4>
<div class="paragraph">
<p>This setting <strong>controls the time-to-live (TTL) for cached repository states</strong> and generated manifests in the repo server (stored in Redis). When that TTL expires, the cache is invalidated and the repo server downloads the repository and generates the manifests again.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
For most environments, the default of <code>24h</code> is a good balance between performance and freshness. You can still trigger a manual refresh when you need newer content.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>When the repo server downloads a Git repository and generates Kubernetes manifests, doing so is resources expensive.</p>
</div>
<div class="paragraph">
<p>If the repo server has already downloaded a repository and the remote Git branch has not received any new commits, there is no need to re-download and re-render the same YAML. However, if you use floating tags (such as <code>latest</code> or <code>main</code>) or rely on remote Helm repositories where a chart can change without a version bump, an overly long cache TTL would stop Argo CD from seeing updates promptly.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>This value sets how long the repo server trusts its cached data before it forces a fresh download and re-renders manifests to confirm nothing changed upstream.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: If set too high (for example, <code>48h</code>), developers who use mutable image tags or update remote Helm charts without bumping versions will find that Argo CD does not pick up their changes quickly enough.</p>
</li>
<li>
<p>Advantage: Keeps the repo server fast and efficient by serving pre-rendered manifests from Redis for most sync operations.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
<strong>Do not lower</strong> this value (for example, to <code>5m</code>) only to pick up floating tags sooner. Doing so forces the repo server to discard its cache and re-render manifests from scratch far more often, which severely degrades performance.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/base/repo-server/argocd-repo-server-deployment.yaml#L104" rel="noopener" target="_blank">Argo CD: Repo server deployment</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-revision-cache-lock-timeout">ARGOCD_REVISION_CACHE_LOCK_TIMEOUT (Default: 10s)</h4>
<div class="paragraph">
<p>This variable sets the TTL used to deduplicate concurrent work on the same revision (<code>0</code> disables deduplication). It reduces duplicate manifest generation when many applications refresh at once.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Imagine you have 100 applications pointing to the same Git repository and commit. When a webhook fires, all 100 applications try to sync at once. To save CPU, Argo CD generates the manifests for that commit once, caches the result in Redis, and serves it to every application. The first worker locks the cache key while it renders; everyone else waits.</p>
</div>
<div class="paragraph">
<p>If rendering takes a long time (for example, a very large Helm chart) and exceeds the default lock timeout, waiting workers assume the first attempt failed and all start rendering the same commit themselves, causing a sharp CPU spike. That pattern is often called a <strong>cache stampede</strong>.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Increasing this lock timeout gives the first worker more time to finish rendering and populate the cache. Other workers stay in the queue instead of duplicating the work.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: If the first worker hangs or exits without releasing the lock, the others remain blocked until this longer timeout elapses.</p>
</li>
<li>
<p>Advantage: Reduces cache stampedes where many workers render the same Git commit unnecessarily, which protects the repo server from sudden CPU spikes during mass reconciliations.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
As with <code>ARGOCD_EXEC_TIMEOUT</code>, tune this value based on how long your slowest Helm chart or Kustomize overlay actually takes to render. The default of <code>10s</code> is adequate for many environments; large charts or complex overlays may need a higher value.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/base/repo-server/argocd-repo-server-deployment.yaml#L224" rel="noopener" target="_blank">Argo CD: Repo server deployment</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-server-repo-timeout">ARGOCD_SERVER_REPO_SERVER_TIMEOUT_SECONDS (Default: 60)</h4>
<div class="paragraph">
<p>This variable sets the maximum time the Argo CD <strong>API server waits for a response</strong> from the repo server.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>When you open the Argo CD Web UI or click on an application, the API Server has to make an internal gRPC call to the Repo Server and say, &#34;Hey, please render these manifests and send them back to me so I can show them to the user.&#34;</p>
</div>
<div class="paragraph">
<p>If you have very large Helm charts or complex Kustomize builds, the repo server might take a long time to render them.
However, this API server timeout defaults to 60 seconds, so the UI can give up, drop the connection, and show a <strong>context deadline exceeded</strong> error even though the repo server is still rendering in the background.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>By increasing this value you tell the API Server to be more patient. It will keep the loading spinner going until the repo server finally finishes rendering and returns the data.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: If the repo server genuinely hangs or crashes, users will sit staring at a spinning wheel in the UI for a much longer time before finally receiving an error message.</p>
</li>
<li>
<p>Advantage: Eliminates false-positive UI and CLI errors when viewing complex applications, ensuring users can actually see the manifests and diffs for heavy deployments.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Align this timeout with <code>ARGOCD_EXEC_TIMEOUT</code> on the repo server. If the repo server may spend 180 seconds rendering a chart but the API server gives up after 60 seconds, the UI will keep failing for slow applications.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://github.com/argoproj/argo-cd/blob/master/manifests/base/server/argocd-server-deployment.yaml#L133" rel="noopener" target="_blank">Argo CD: Server deployment</a></p>
</div>
<hr/>
</div>
</div>
<div class="sect2">
<h3 id="setting-controller-sharding">Application controller: Sharding (horizontal scaling)</h3>
<div class="paragraph">
<p>When you investigate performance issues, <strong>sharding</strong> is often one of the first topics you meet. Sharding scales the application controller horizontally by distributing work across multiple controller replicas automatically.</p>
</div>
<div class="paragraph">
<p>When a single application controller reconciles too many applications across too many clusters, it becomes the bottleneck: high CPU and memory use, long reconcile queues, Kubernetes API throttling, and pressure on the repo server.
Sharding splits that work across <strong>multiple controller replicas</strong>. Each replica has a <strong>shard index</strong> and reconciles only <strong>applications whose destination clusters map to that shard</strong>.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Implicitly, this means that sharding only makes sense if you have more than one cluster in your environment.
</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_how_it_works_conceptually">How it works (conceptually)</h4>
<div class="ulist">
<ul>
<li>
<p>You run <strong>N</strong> application-controller replicas (typically a StatefulSet so each pod has a stable identity).</p>
</li>
<li>
<p>Argo CD assigns every registered cluster (including the in-cluster deployment) to <strong>exactly one shard</strong> using a <strong>distribution function</strong>. The controller for shard K ignores clusters that are not mapped to K.</p>
</li>
<li>
<p>Applications are processed by the shard that owns their <strong>destination cluster</strong>.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_distribution_algorithms">Distribution algorithms</h4>
<div class="paragraph">
<p>The following algorithms are supported. Configure them with the <strong>ARGOCD_CONTROLLER_SHARDING_ALGORITHM</strong> (at spec.controller.env) environment variable when you use the OpenShift GitOps Operator, or with <strong>controller.sharding.algorithm</strong> in argocd-cmd-params-cm ConfigMap:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong><code>legacy</code></strong> — stable hash from cluster ID; simple, but shards can be unbalanced (some busier than others). Kept for compatibility.</p>
</li>
<li>
<p><strong><code>round-robin</code></strong> — tends to spread clusters more evenly across shards; often a better default when you scale out.</p>
</li>
<li>
<p><strong><code>consistent-hashing</code></strong> — can improve balance further in some large, multi-cluster setups; cluster placement can reshuffle when the number of shards changes.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The OpenShift GitOps documentation does not explicitly mention <code>consistent-hashing</code>, which often indicates limited or unsupported use on that distribution. If you set <code>ARGOCD_CONTROLLER_SHARDING_ALGORITHM</code> under <code>spec.controller.env</code>, Argo CD still reads whatever value you supply—verify against your operator version before relying on it in production.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect3">
<h4 id="_why_it_improves_performance">Why it improves performance</h4>
<div class="ulist">
<ul>
<li>
<p>Parallelism across nodes: More controller pods mean more CPU and memory headroom in aggregate.</p>
</li>
<li>
<p>Smaller per-shard work: Each replica handles fewer clusters and fewer applications.</p>
</li>
<li>
<p>Better fit for hub-and-spoke: On a management cluster with many spoke clusters, sharding is the usual way to scale past what one controller can sustain.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_trade_offs">Trade-offs</h4>
<div class="ulist">
<ul>
<li>
<p>Operational complexity: More pods to monitor; you must ensure every shard stays healthy.</p>
</li>
<li>
<p>Not a substitute for repo-server tuning: If manifest generation or Git is the bottleneck, sharding the controller alone will not fix it.</p>
</li>
<li>
<p>Only useful if you have more than one cluster in your environment.</p>
</li>
</ul>
</div>
</div>
<div class="sect3">
<h4 id="_configure_sharding">Configure Sharding</h4>
<div class="sect4">
<h5 id="_openshift_gitops_argo_cd_custom_resource">OpenShift GitOps (Argo CD custom resource)</h5>
<div class="paragraph">
<p>The OpenShift GitOps Operator lets you configure sharding in the Argo CD custom resource.</p>
</div>
<div class="paragraph">
<p>The following snippet shows a typical sharding configuration, including the algorithm.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
  controller:
    env:
      - name: ARGOCD_CONTROLLER_SHARDING_ALGORITHM
        value: round-robin <i class="conum" data-value="1"></i><b>(1)</b>
    sharding:
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      replicas: 3 <i class="conum" data-value="3"></i><b>(3)</b>
      minShards: 2 <i class="conum" data-value="4"></i><b>(4)</b>
      maxShards: 5 <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The algorithm to use for sharding</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Sharding must be enabled explicitly.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Number of application-controller replicas (shards)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Minimum number of shards</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Maximum number of shards</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Sharding applies to the <strong>application controller</strong> only. The <strong>repo server</strong>, <strong>Redis</strong>, and <strong>Argo CD server</strong> scale on their own and are sized separately.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
<div class="sect4">
<h5 id="_standalone_argo_cd">Standalone Argo CD</h5>
<div class="ulist">
<ul>
<li>
<p>Install the high-availability layout so the application controller is a StatefulSet (not a single-replica Deployment).</p>
</li>
<li>
<p>Set <strong>replicas</strong> on that StatefulSet to the number of shards you want - each replica is one shard.</p>
</li>
<li>
<p>Configure <strong><code>controller.sharding.algorithm</code></strong> in <strong><code>argocd-cmd-params-cm</code></strong> (for example <code>round-robin</code>).</p>
</li>
<li>
<p>Ensure each pod receives <strong><code>ARGOCD_CONTROLLER_REPLICAS</code></strong> (total shard count) and <strong><code>ARGOCD_CONTROLLER_SHARD</code></strong> (this pod’s index).</p>
</li>
</ul>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_controller_performance_tuning_configmap">Controller: Performance tuning (ConfigMap)</h3>
<div class="paragraph">
<p>The controller container can also be configured with environment variables. However, you configure it slightly differently from the repo server. The configuration comes from a ConfigMap: either you edit that ConfigMap directly, or, if you use the OpenShift GitOps Operator, you set <code>spec.extraConfig</code> or the appropriate setting under <code>spec.controller</code>. Those values eventually become environment variables in the controller container.</p>
</div>
<div class="paragraph">
<p>When you use the OpenShift GitOps Operator with the Argo CD custom resource, set <code>spec.extraConfig</code>. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  extraConfig: <i class="conum" data-value="1"></i><b>(1)</b>
    timeout.reconciliation: 180s</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Special extraConfig key with an example setting</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The operator will automatically merge the <code>spec.extraConfig</code> with the <code>argocd-cm</code> ConfigMap.</p>
</div>
<div class="paragraph">
<p>However, to keep it confusing, some parameters are set under <code>spec.controller</code>. For example, <code>spec.controller.processors.status</code> and <code>spec.controller.processors.operation</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    processors:
      status: 50</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you do not use the Operator, set the parameter directly in the ConfigMap.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: ConfigMap
apiVersion: v1
metadata:
  name: argocd-cm <i class="conum" data-value="1"></i><b>(1)</b>
  namespace: openshift-gitops
data:
[...truncated...]
  timeout.reconciliation: 180s <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Special ConfigMap name for the Argo CD configuration</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Special timeout.reconciliation key with an example setting</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Several ConfigMaps are involved in controller configuration. The <code>argocd-cm</code> ConfigMap is the main ConfigMap for the Argo CD instance. The <code>argocd-cmd-params-cm</code> ConfigMap supplies controller command-line parameters. Each subsection below states which ConfigMap applies. When you use the Operator, map these keys through the appropriate section where noted.
</td>
</tr>
</tbody></table>
</div>
<hr/>
<div class="sect3">
<h4 id="setting-timeout-reconciliation">timeout.reconciliation (Default: 3m)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cm</strong></p>
</li>
<li>
<p>ArgoCD: <strong>spec.extraConfig</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>With this setting you control the <strong>default polling interval</strong> for Argo CD. It defines how often Argo CD wakes up to compare the desired state in Git with the live state in your Kubernetes cluster.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>If you do not have Git webhooks configured, Argo CD relies on a pull-based mechanism. By default, every three minutes the application controller connects to the repo server to check Git for new commits. In a cluster with thousands of applications, polling every three minutes creates a sustained, heavy baseline load on both the application controller (CPU and memory) and the repo server (network and Git API traffic), even when nothing has changed in your repositories.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>By increasing this value (for example, <code>600s</code> for 10 minutes, or even <code>3600s</code> for one hour), you reduce that background load and CPU overhead on the controller and repo server.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<strong>In combination with Git webhooks</strong>, this setting is one of the most important performance tweaks you can apply.
</td>
</tr>
</tbody></table>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: If you do not use Git webhooks, new commits are detected and applied more slowly (by up to the reconciliation interval).</p>
</li>
<li>
<p>Advantage: A large reduction in baseline CPU, memory, and network usage—a crucial performance tweak for large clusters.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Only increase this value if you have <strong>Git webhooks</strong> configured so Argo CD is notified as soon as changes are pushed. With webhooks in place, the controller does not need to poll as aggressively, so longer reconciliation intervals are usually safe.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/faq/#how-often-does-argo-cd-check-for-changes-to-my-git-or-helm-repository" rel="noopener" target="_blank">Argo CD: FAQ</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-timeout-reconciliation-jitter">timeout.reconciliation.jitter (Default: 60s)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cm</strong></p>
</li>
<li>
<p>ArgoCD: <strong>spec.extraConfig</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This setting works together with <a href="#setting-timeout-reconciliation">timeout.reconciliation</a>. It defines the <strong>maximum random delay</strong> (a jitter) that Argo CD may add when scheduling each application’s periodic Git poll. The controller picks a value between zero and this maximum so that not every Application wakes up at the same instant.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>If thousands of applications share the same base reconciliation interval, their refresh work can <strong>align in time</strong>. That creates <strong>periodic spikes</strong> of load on the application controller, the repo server, and your Git provider — even when nothing has changed.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Keep a <strong>non-zero</strong> jitter that is a reasonable fraction of timeout.reconciliation (upstream examples often use 60s jitter alongside a 120s base interval; see the <a href="https://argo-cd.readthedocs.io/en/stable/faq/#how-often-does-argo-cd-check-for-changes-to-my-git-or-helm-repository" rel="noopener" target="_blank">FAQ</a>). When you increase the poll interval for performance, adjust jitter so you still spread work rather than synchronizing every long interval.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Each app’s next poll is a bit less predictable.</p>
</li>
<li>
<p>Advantage: Smoother average load and fewer peak loads than setting jitter to 0s.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/faq/#how-often-does-argo-cd-check-for-changes-to-my-git-or-helm-repository" rel="noopener" target="_blank">Argo CD: FAQ</a></p>
</div>
<hr/>
</div>
</div>
<div class="sect2">
<h3 id="_controller_performance_tuning_command_line_parameters">Controller: Performance tuning (Command line parameters)</h3>
<div class="paragraph">
<p>For a while I was unsure where to place the following settings, because the Operator configures them differently from a plain install. I ended up giving command-line parameters their own subsection.</p>
</div>
<div class="paragraph">
<p>If you are <strong>not</strong> using the Operator, configure these values in the <code>argocd-cmd-params-cm</code> ConfigMap. That part is straightforward.</p>
</div>
<div class="paragraph">
<p>If you use the Operator, set them under <code>spec.controller.processors</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  controller:
    processors: <i class="conum" data-value="1"></i><b>(1)</b>
      status: 20
      operation: 10</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Special processors key with the default settings</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This differs from the section above, where such parameters were set at <code>spec.extraConfig</code>.
The reason is, that the Operator sets these parameters directly as a switch in the execution command of the container and does not read it from the ConfigMap.</p>
</div>
<div class="paragraph">
<p>I am sure there is a design decision behind this …​</p>
</div>
<div class="sect3">
<h4 id="setting-status-processors">controller.status.processors (Default: 20)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cmd-params-cm</strong> (if not using the Operator)</p>
</li>
<li>
<p>ArgoCD: <strong>spec.controller.processor.status</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This setting controls the <strong>number of concurrent status processors</strong>. That is, how many applications the controller can compare at once.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>If you have 500 applications, a default of 20 processors means the controller evaluates only 20 at a time. During a mass reconciliation (for example, a webhook firing for a monorepo), the remaining 480 applications wait in the reconciliation queue.
You will notice drift detection becoming very slow.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Increase this value (for example, to <code>50</code> or <code>100</code> when you run more than 1,000 applications) so the controller can drain the queue faster, especially if refreshes in the UI feel slow.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Higher CPU and memory use on the application controller Pod.</p>
</li>
<li>
<p>Advantage: Argo CD detects drift and refreshes status in the UI much faster in large environments.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argocd-operator.readthedocs.io/en/latest/reference/argocd/#controller-options" rel="noopener" target="_blank">Argo CD Operator: Reference</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-operation-processors">controller.operation.processors (Default: 10)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cmd-params-cm</strong> (if not using the Operator)</p>
</li>
<li>
<p>ArgoCD: <strong>spec.controller.processor.operation</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>While status processors compare desired and live state, this setting controls the <strong>number of concurrent operation processors</strong> for actual sync runs.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>If you trigger a mass sync of 100 applications at once but only 10 operation processors are configured, Argo CD runs 10 syncs, waits for them to finish, starts the next 10, and so on.
Applications stay in <code>Waiting</code> or <code>Pending</code> in the UI until their turn starts.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Increase this value when many applications sync or run operations at the same time and the operation queue backs up (pending syncs, slow operation phase). Monitor controller CPU and memory — you need headroom for the extra parallelism.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: Higher CPU and memory use on the application controller Pod.</p>
</li>
<li>
<p>Advantage: Argo CD can apply manifests to the Kubernetes API for many applications at the same time.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This is independent of status processors: you might have heavy refresh traffic (status) and lighter sync traffic (operations), or the opposite—tune each side to match your workload.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argocd-operator.readthedocs.io/en/latest/reference/argocd/#controller-options" rel="noopener" target="_blank">Argo CD Operator: Reference</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-controller-repo-server-timeout">ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS - controller.repo.server.timeout.seconds (Default: 60)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cmd-params-cm</strong> (if not using the Operator)</p>
</li>
<li>
<p>ArgoCD: <strong>spec.controller.env</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This sets <strong>how long the application controller waits</strong> for the repo server to finish generating manifests before it stops and returns a <strong>context deadline exceeded</strong> error.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Do not put this key in <code>spec.extraConfig</code>. On OpenShift GitOps, set it under <code>spec.controller.env</code> in the Argo CD custom resource.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>Heavy charts, large repositories, slow Git, or a busy repo server may need more than 60 seconds for a single <code>GenerateManifests</code> (or similar) RPC. If the deadline is too short, applications show comparison failures even when the repo server would eventually succeed.
If you raised <code>ARGOCD_EXEC_TIMEOUT</code> on the repo server so a chart can render for 180 seconds, but leave this controller deadline at 60 seconds, the controller cancels the request while the repo server is still working, and the sync fails.</p>
</div>
<div class="paragraph">
<p><strong>Solution</strong></p>
</div>
<div class="paragraph">
<p>Raise the value (for example to <strong><code>180</code></strong>) so legitimately slow manifest generation can finish. Size it so the controller allows at least as long as the <strong>worst-case repo-server work</strong> you expect for one RPC.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: A hung repo server holds work longer before the client fails.</p>
</li>
<li>
<p>Advantage: Fewer false failures from an overly aggressive deadline; large environments often use <strong>120–300</strong> seconds or more.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This controls only the <strong>controller → repo-server</strong> gRPC client. It does <strong>not</strong> replace <strong><code>ARGOCD_EXEC_TIMEOUT</code></strong> (child processes on the repo server) or <strong><code>ARGOCD_REPO_SERVER_PARALLELISM_LIMIT</code></strong> (concurrent manifest work).
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/argocd-cmd-params-cm-yaml/" rel="noopener" target="_blank">Argo CD: Command line parameters</a></p>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="setting-kubectl-parallelism">ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT - controller.kubectl.parallelism.limit (Default: 20)</h4>
<div class="ulist">
<ul>
<li>
<p>ConfigMap: <strong>argocd-cmd-params-cm</strong> (if not using the Operator)</p>
</li>
<li>
<p>ArgoCD: <strong>spec.controller.env</strong> (if using the Operator)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This setting controls the <strong>maximum number of concurrent <code>kubectl</code> child processes</strong> the application controller may spawn at once.</p>
</div>
<div class="paragraph">
<p><strong>Problem</strong></p>
</div>
<div class="paragraph">
<p>If you raise <code>controller.operation.processors</code> (for example to <code>50</code> to run 50 syncs at once), you can hit a hidden bottleneck. This <code>kubectl</code> limit defaults to <code>20</code>, so the extra operation processors wait for a free slot.
Without any limit, running dozens of concurrent <code>kubectl</code> processes could spike memory and CPU and risk OOM-killing the controller Pod.</p>
</div>
<div class="paragraph">
<p>If you increase <code>controller.operation.processors</code> to speed up mass syncs, raise this limit to match or sit slightly below that value (for example set it to <code>50</code>). That lets the controller run sync commands in parallel without stalling on the process limit.
Raise the limit in steps (for example <code>50</code>, or <code>100</code> at very large scale). After each change, watch the Kubernetes API server (request rate and latency), etcd, and application-controller CPU and memory.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Disadvantage: More overlapping <code>kubectl</code> work increases API traffic and process pressure. On a stressed control plane that can make things worse.</p>
</li>
<li>
<p>Advantage: Less time waiting for a free <code>kubectl</code> slot when the cluster can absorb the extra concurrency.</p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do not set this far above <code>controller.operation.processors</code>; extra headroom does not increase throughput and only wastes memory. The two settings are meant to move together.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><code>References</code>: <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/argocd-cmd-params-cm-yaml/" rel="noopener" target="_blank">Argo CD: Command line parameters</a></p>
</div>
<hr/>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenShift GitOps performance is rarely fixed by a single knob. The repo server, application controller, API server, Redis, and your Git provider all interact: a slow manifest render stresses the repo server; an aggressive client timeout fails the UI even when rendering would succeed; unbounded parallelism can OOM the repo server; tight kubectl concurrency can leave sync operations queued on an otherwise healthy controller.</p>
</div>
<div class="paragraph">
<p>A practical approach is to work in order of leverage: reduce unnecessary Git and render work (for example shallow clones, cache TTLs, and webhooks so you are not polling blindly), then align related timeouts (ARGOCD_EXEC_TIMEOUT, controller and API server deadlines to the repo server), then bound concurrency (repo-server parallelism, Git ls-remote limits, status and operation processors, kubectl parallelism) before you scale out with sharding and replicas.</p>
</div>
<div class="paragraph">
<p>On OpenShift GitOps, the same upstream settings appear in different places spec.repo.env, spec.controller.env, spec.extraConfig, spec.controller.processors, and spec.controller.sharding so always map each variable to the right field in the Argo CD custom resource (or the equivalent ConfigMaps in a plain install).</p>
</div>
<div class="paragraph">
<p>Finally, treat tuning as evidence-led: change one major setting at a time, watch controller and repo-server memory, reconcile duration, API rates, and Git rate limits. What works for a small instance will not automatically transfer to thousands of applications or many managed clusters.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/reconcile/" rel="noopener" target="_blank">Argo CD — Reconcile optimization</a></p>
</li>
<li>
<p><a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/" rel="noopener" target="_blank">Argo CD — High availability / scaling</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.20/html-single/managing_resource_use/" rel="noopener" target="_blank">Red Hat OpenShift GitOps 1.20 — Managing resource use</a></p>
</li>
<li>
<p><a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.20/html-single/argo_cd_instance/index/" rel="noopener" target="_blank">Red Hat OpenShift GitOps 1.20 — Argo CD instance / CR properties</a></p>
</li>
<li>
<p><a href="https://argocd-operator.readthedocs.io/en/stable/usage/extra-config/" rel="noopener" target="_blank">Argo CD Operator — ExtraConfig</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>The Guide to OpenBao - Initialisation, Unsealing, and Auto-Unseal - Part 6</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-05-openbao-part-6-auto-unsealing/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-05-openbao-part-6-auto-unsealing/</guid><pubDate>Thu, 05 Mar 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><category>GitOps</category><description>Configuring OpenBao for automatic unsealing with a Key Management Service, static key, or transit seal; manual and GitOps-friendly approaches</description><content:encoded><![CDATA[<div class="paragraph">
<p>After deploying OpenBao via GitOps (<a href="/openshift-platform/security/secrets-management/openbao/2026-02-20-openbao-part-5-gitops-deployment/">Part 5</a>), OpenBao must be initialised and then unsealed before it becomes functional. You usually do not want to do this unsealing manually, since this is not scalable especially in bigger, productive environments. This article explains how to handle initialisation and unsealing, and possible options to configure an <strong>auto-unseal</strong> process so that OpenBao unseals itself on every restart without manual key entry.</p>
</div>
<div class="sect1">
<h2 id="_what_is_happening">What is happening?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenBao starts in a <strong>sealed</strong> state. You must:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Initialise (once): run <code>bao operator init</code> to generate unseal keys (or recovery keys when using auto-unseal).</p>
</li>
<li>
<p>Unseal (after each restart): provide a threshold of unseal keys so each node can decrypt the root key. In the previous articles, we used a threshold of 3 (out of 5). This means that you need to run <strong>bao operator unseal</strong> three times with different keys on every node after every start before the service becomes available.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Unseal workflow (assuming a threshold of 3 and 5 nodes and initialisation already happened):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code center"="" class="language-mermaid {align=" data-lang="mermaid {align=" hljs"="" zoom="true" }="" }"="">---
title: &#34;Unseal Workflow&#34;
config:
  theme: &#39;dark&#39;
---
flowchart LR
  A[&#34;openbao-0 starts → 3× unseal using different keys&#34;]
  A --&gt; B[&#34;openbao-1 starts → 3× unseal using different keys&#34;]
  B --&gt; C[&#34;openbao-2 starts → 3× unseal using different keys&#34;]
  C --&gt; D[OpenBao is ready]</code></pre>
</div>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
This is a chicken-egg problem: you need to start somewhere, but you cannot start without the keys.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Manual unsealing does not scale very well and for production, <strong>auto-unseal</strong> is recommended.</p>
</div>
<div class="paragraph">
<p>This article covers:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Practical approaches to initialisation and unsealing (manual, Jobs, init containers).</p>
</li>
<li>
<p>Potential auto-unseal options: with AWS KMS, static key, and transit seal.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_handling_initialisation_and_unsealing">Handling Initialisation and Unsealing</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The challenge with GitOps is that initialisation and unsealing are one-off or stateful operations. Below are several approaches. The problem is always the same: where do you start? You must have the unseal keys available to start the process. Do you keep them locally, do you keep them in a Kubernetes Secret, do you use an external Key Management System (KMS)? The most robust for production in my opinion is auto-unseal using a KMS (see <a href="#_approach_3_auto_unseal_with_key_management_service_kms_recommended_for_production">Approach 3: Auto-unseal with Key Management Service KMS (recommended for production)</a> and the following sections). It uses an external Key Management System (KMS) to store the keys. This way, the keys are not stored in the cluster and are not exposed to the risk of being compromised.</p>
</div>
<div class="paragraph">
<p>Let’s have a look at the different options.</p>
</div>
<hr/>
<div class="sect2">
<h3 id="_approach_1_manual_initialisation_simplest">Approach 1: Manual Initialisation (simplest)</h3>
<div class="paragraph">
<p>While manual initialisation and unsealing is the simplest approach, it is not recommended for production. Still, I would like to mention it here for completeness and at least provide a simple for loop to unseal the OpenBao service (on Kubernetes/OpenShift).</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Manual unsealing is still a valid option when you have a small cluster and assume that it is not required often.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>After Argo CD deploys OpenBao, the first pod, openbao-0, will not become ready until it is initialised and unsealed. Once done, the next pod, openbao-1, will try to start and wait until it is unsealed, and then the third pod, and so on.</p>
</div>
<div class="paragraph">
<p>The following, simplified script will go through the pods and unseal them one by one. It initialises the first pod and stores the unseal keys in the file <strong>openbao-init.json</strong> locally on your machine. From there it takes three different keys and unseals the OpenBao service.
Since it takes a while until other pods are pulling the image and starting, we will use a sleep timer of 30 seconds between each pod. This may or may not be enough depending on your network and cluster speed. As said, this is a very simplified script:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The CLI tool <strong>oc</strong> can be replaced by <strong>kubectl</strong> in case you are using a different cluster. In addition, you will need the jq command line tool to parse the JSON file.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
If your OpenBao was initialised previously, you can remove the first three commands and start with the unseal commands.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Initialise the first pod, assuming the Pod openbao-0 is already running.
# You can skip this if OpenBao was initialised previously.
echo &#34;Initialising OpenBao on openbao-0 (keys will be saved to openbao-init.json)...&#34;
oc exec -it openbao-0 -n openbao -- bao operator init \
  -key-shares=5 -key-threshold=3 -format=json &gt; openbao-init.json <i class="conum" data-value="1"></i><b>(1)</b>
echo &#34;Init complete. Unseal keys and root token are in openbao-init.json.&#34;

# Unseal each pod (three times each with different keys)
echo &#34;Unsealing pods openbao-0, openbao-1, openbao-2 (3 key steps each)...&#34;
for i in 0 1 2; do
  sleep_timer=30
  SLEEPER_TMP=1

  echo &#34;Unsealing openbao-$i...&#34;
  for j in 1 2 3; do <i class="conum" data-value="2"></i><b>(2)</b>
    KEY=$(cat openbao-init.json | jq -r &#34;.unseal_keys_b64[$((j-1))]&#34;)
    oc exec -it openbao-$i -n openbao -- bao operator unseal $KEY
  done

  echo &#34;openbao-$i unsealed. Waiting ${sleep_timer}s for next pod to be ready...&#34;

  while [[ $SLEEPER_TMP -le &#34;$sleep_timer&#34; ]]; do <i class="conum" data-value="3"></i><b>(3)</b>
    if (( SLEEPER_TMP % 10 == 0 )); then
      echo -n &#34;$SLEEPER_TMP&#34;
    else
      echo -n &#34;.&#34;
    fi
    sleep 1
    SLEEPER_TMP=$((SLEEPER_TMP + 1))
  done

  echo &#34;&#34;

done

echo &#34;All pods unsealed. Store init data securely (e.g. in a password manager).&#34;
# Store init data securely (e.g. in a password manager)</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Initialise the first pod, assuming the Pod openbao-0 is already running. This will store the keys (including the root token) in the file <strong>openbao-init.json</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Unseal each pod (three times each with different keys). The keys are taken from the <strong>openbao-init.json</strong> file.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Wait 30 seconds between each pod to give the other pods time to start and pull the image …​ super-fancy sleep timer.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The unseal keys as well as the root token are stored in the <strong>openbao-init.json</strong> file. This file is stored locally on your machine. Make sure to store it securely and do not share it with anyone.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
<div class="sect2">
<h3 id="_approach_2_kubernetes_job_for_initialisation">Approach 2: Kubernetes Job for initialisation</h3>
<div class="paragraph">
<p>A Job can run after OpenBao is deployed, initialise it if needed, and store the init output (unseal keys and root token) in a Kubernetes Secret. You can then unseal manually or with a second Job that reads from that Secret. This section assumes the init output is stored in a Kubernetes Secret and explains how to create that Secret from the Job and how to use it.</p>
</div>
<div class="sect3">
<h4 id="_how_the_secret_is_created">How the Secret is created</h4>
<div class="paragraph">
<p>The init Job runs <code>bao operator init</code> and then creates the Secret using <code>oc</code> (or <code>kubectl</code>). The Secret name and key used here are <code>openbao-init-data</code> and <code>init.json</code> (the file contains the JSON output of <code>bao operator init</code>, including <code>unseal_keys_b64</code> and <code>root_token</code>). One advantage of this approach is that you can integrate it into your GitOps pipeline. However, we can argue whether it is a good idea to store the unseal keys and the root token as a Secret in the same cluster where OpenBao is running.</p>
</div>
<div class="paragraph">
<p><strong>Example structure of <code>init.json</code></strong>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
  &#34;unseal_keys_b64&#34;: [
    &#34;key1&#34;,
    &#34;key2&#34;,
    &#34;key3&#34;,
    &#34;key4&#34;,
    &#34;key5&#34;
  ],
  &#34;unseal_keys_hex&#34;: [
    &#34;hex1&#34;,
    &#34;hex2&#34;,
    &#34;hex3&#34;,
    &#34;hex4&#34;,
    &#34;hex5&#34;
  ],
  &#34;unseal_shares&#34;: 5,
  &#34;unseal_threshold&#34;: 3,
  &#34;recovery_keys_b64&#34;: null,
  &#34;recovery_keys_hex&#34;: null,
  &#34;recovery_keys_shares&#34;: 0,
  &#34;recovery_keys_threshold&#34;: 0,
  &#34;root_token&#34;: &#34;root.token&#34;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>You need at least <code>unseal_threshold</code> keys (e.g. 3) from <code>unseal_keys_b64</code> to unseal each node. Store this file securely; anyone with access can unseal OpenBao and the <code>root_token</code> has full admin access.</p>
</div>
</div>
<div class="sect3">
<h4 id="_rbac_configuration">RBAC Configuration</h4>
<div class="paragraph">
<p>The Job’s service account (<code>openbao-init</code>) must be allowed to create (and optionally get/update) Secrets in the <code>openbao</code> namespace. Create a Role and RoleBinding:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: ServiceAccount
metadata:
  name: openbao-init <i class="conum" data-value="1"></i><b>(1)</b>
  namespace: openbao
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: openbao-init-secret-writer
  namespace: openbao
rules: <i class="conum" data-value="2"></i><b>(2)</b>
  - apiGroups: [&#34;&#34;]
    resources: [&#34;secrets&#34;]
    verbs: [&#34;create&#34;, &#34;get&#34;, &#34;update&#34;, &#34;patch&#34;]
  - apiGroups: [&#34;&#34;] <i class="conum" data-value="3"></i><b>(3)</b>
    resources: [&#34;pods&#34;]
    verbs: [&#34;get&#34;, &#34;list&#34;]
  - apiGroups: [&#34;&#34;] <i class="conum" data-value="4"></i><b>(4)</b>
    resources: [&#34;pods/exec&#34;]
    verbs: [&#34;create&#34;]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding <i class="conum" data-value="5"></i><b>(5)</b>
metadata:
  name: openbao-init-secret-writer
  namespace: openbao
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: openbao-init-secret-writer
subjects:
  - kind: ServiceAccount
    name: openbao-init
    namespace: openbao</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The ServiceAccount is used by the Job(s) to create the Secret and unseal the OpenBao pods.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The Role is used by the Job to create the Secret. The rules might be extended to include the permission to execute into the pods to unseal the OpenBao service (see below).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Permissions to get and list the Pods, required for the unseal process later</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Permissions to execute into the Pods, required for the unseal process later</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The RoleBinding is used by the Job to create the Secret.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The Job must also be able to reach the OpenBao API (e.g. <code>openbao.openbao.svc:8200</code>). This is usually possible when running in the same namespace as the OpenBao service.</p>
</div>
<div class="paragraph">
<p>The example below shows a working Job manifest that will perform the initialisation and the creation of the Secret in the <code>openbao</code> namespace. The manifest is already prepared for Argo CD with useful annotations.
It runs an init container to initialise the OpenBao service and a main container to create the Secret. The init container writes (using the OpenBao CLI) the init.json file to a shared volume and the main container (using the kubectl command) creates the Secret from that file.
In addition, the Secret containing the CA certificate is mounted as a volume and the BAO_CACERT environment variable is set to the path of the CA certificate.</p>
</div>
</div>
<div class="sect3">
<h4 id="_init_job_that_creates_the_secret">Init Job that creates the Secret</h4>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: batch/v1
kind: Job
metadata:
  name: openbao-init
  namespace: openbao
  annotations: <i class="conum" data-value="1"></i><b>(1)</b>
    argocd.argoproj.io/sync-wave: &#34;30&#34;
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
spec:
  template:
    spec:
      serviceAccountName: openbao-init <i class="conum" data-value="2"></i><b>(2)</b>
      initContainers: <i class="conum" data-value="3"></i><b>(3)</b>
        - name: openbao-init
          image: ghcr.io/openbao/openbao:latest
          command: <i class="conum" data-value="4"></i><b>(4)</b>
            - /bin/sh
            - -c
            - |
              if [ -f /etc/openbao-ca/ca.crt ]; then
                export BAO_CACERT=/etc/openbao-ca/ca.crt
                export BAO_ADDR=https://openbao:8200
                echo &#34;Using TLS CA from /etc/openbao-ca/ca.crt&#34;
              else
                export BAO_ADDR=http://openbao:8200
                echo &#34;Using plain HTTP&#34;
              fi

              until bao status 2&gt;&amp;1 | grep -q &#34;Initialized&#34;; do
                echo &#34;Waiting for OpenBao...&#34;
                sleep 5
              done

              if bao status | grep -q &#34;Initialized.*false&#34;; then
                echo &#34;Initialising OpenBao...&#34;
                bao operator init -key-shares=5 -key-threshold=3 \
                  -format=json &gt; /shared/init.json
                echo &#34;Init complete; init.json written to shared volume.&#34;
              else
                echo &#34;OpenBao already initialised (skipping init).&#34;
              fi
          volumeMounts:
            - name: openbao-ca
              mountPath: /etc/openbao-ca
              readOnly: true
            - name: shared
              mountPath: /shared
      containers: <i class="conum" data-value="5"></i><b>(5)</b>
        - name: create-secret
          image: bitnami/kubectl:latest
          command:
            - /bin/sh
            - -c
            - |
              if [ -f /shared/init.json ]; then
                echo &#34;Creating Secret openbao-init-data from init.json...&#34;
                kubectl create secret generic openbao-init-data \
                  --from-file=init.json=/shared/init.json \
                  -n openbao --dry-run=client -o yaml | kubectl apply -f -
                echo &#34;Initialisation complete!&#34;
              else
                echo &#34;No init.json (OpenBao already initialised or init skipped).&#34;
              fi
          volumeMounts:
            - name: shared
              mountPath: /shared
              readOnly: true
      volumes:
        - name: openbao-ca
          secret:
            secretName: openbao-ca-secret
            optional: true
        - name: shared <i class="conum" data-value="6"></i><b>(6)</b>
          emptyDir: {}
      restartPolicy: Never
  backoffLimit: 3</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The annotations are used by Argo CD to trigger the Job after the OpenBao deployment.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The ServiceAccount is used by the Job to initialise the OpenBao service.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The init container runs the OpenBao CLI (wait for API, then operator init) and writes init.json to a shared volume.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The command is used to initialise the OpenBao service.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The main container runs kubectl to create the Secret from that file. This avoids needing a single image that bundles both <code>bao</code> and <code>kubectl</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The shared volume is used to store the init.json file.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
As a result the secret <code>openbao-init-data</code> is created in the <code>openbao</code> namespace. It contains the unseal keys and the root token.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect3">
<h4 id="_using_the_secret_in_a_job_unseal">Using the Secret in a Job (unseal)</h4>
<div class="paragraph">
<p>A second Job can use the Secret <code>openbao-init-data</code> that was created by the init Job to unseal each OpenBao pod. A lot is happening here:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The init container extracts the unseal keys from the Secret using <code>jq</code> and writes them to a shared volume.</p>
</li>
<li>
<p>The main container is reading the unseal keys from the shared volume and unseals the first pod</p>
</li>
<li>
<p>Then the process is waiting for 30 seconds, to give the next pod time to pull the image and start</p>
</li>
<li>
<p>The process is repeated for the next pod and so on until all pods are unsealed.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>First of all, the unseal Job needs permission to <code>exec</code> into the OpenBao pods. Add a Role that grants the Job’s service account <code>create</code> on <code>pods/exec</code> in the <code>openbao</code> namespace.
To make it easier, we can extend the Role <code>openbao-init-secret-writer</code> that was created in the init Job.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
These rules were already applied with the configuration for the init Job, but we will repeat them here for completeness.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">rules: <i class="conum" data-value="1"></i><b>(1)</b>
  - apiGroups: [&#34;&#34;]
    resources: [&#34;pods&#34;]
    verbs: [&#34;get&#34;, &#34;list&#34;]
  - apiGroups: [&#34;&#34;]
    resources: [&#34;pods/exec&#34;]
    verbs: [&#34;create&#34;]</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The role <code>openbao-init-secret-writer</code> must be extended to include the permission to execute into the pods to unseal the OpenBao service.</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: batch/v1
kind: Job
metadata:
  name: openbao-unseal
  namespace: openbao
  annotations:
    argocd.argoproj.io/sync-wave: &#34;35&#34;
    argocd.argoproj.io/hook: PostSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded
spec:
  template:
    spec:
      serviceAccountName: openbao-init <i class="conum" data-value="1"></i><b>(1)</b>
      initContainers:
        - name: extract-keys
          image: quay.io/codefreshplugins/curl-jq
          command:
            - /bin/sh
            - -c
            - |
              if [ ! -f /secrets/init.json ]; then
                echo &#34;Secret not found; run init Job first.&#34;
                exit 1
              fi
              for i in 0 1 2; do
                jq -r &#34;.unseal_keys_b64[$i]&#34; /secrets/init.json | tr -d &#39;\n&#39; &gt; &#34;/shared/key$i&#34; <i class="conum" data-value="2"></i><b>(2)</b>
              done
              echo &#34;Unseal keys extracted to shared volume.&#34;
          volumeMounts:
            - name: init-secret
              mountPath: /secrets
              readOnly: true
            - name: shared
              mountPath: /shared
      containers: <i class="conum" data-value="3"></i><b>(3)</b>
        - name: unseal
          image: bitnami/kubectl:latest
          command: <i class="conum" data-value="4"></i><b>(4)</b>
            - /bin/sh
            - -c
            - |
              if [ -f /etc/openbao-ca/ca.crt ]; then
                export BAO_CACERT=/etc/openbao-ca/ca.crt
                export BAO_ADDR=https://openbao:8200
                echo &#34;Using TLS CA from /etc/openbao-ca/ca.crt&#34;
              else
                export BAO_ADDR=http://openbao:8200
                echo &#34;Using plain HTTP&#34;
              fi

              sleep_timer=30

              if [ ! -f /shared/key0 ]; then
                echo &#34;Keys not found; extract-keys init container may have failed.&#34;
                exit 1
              fi

              echo &#34;Unsealing pods openbao-0, openbao-1, openbao-2 (3 key steps each), ${sleep_timer}s delay between pods...&#34;
              for pod in openbao-0 openbao-1 openbao-2; do
                echo &#34;Unsealing $pod...&#34;
                for i in 0 1 2; do
                  key=$(cat &#34;/shared/key$i&#34; | tr -d &#39;\n&#39;)
                  kubectl exec -n openbao &#34;$pod&#34; -- sh -c &#39;bao operator unseal &#34;$1&#34;&#39; _ &#34;$key&#34; || true
                done
                echo &#34;$pod unsealed.&#34;
                if [ &#34;$pod&#34; != &#34;openbao-2&#34; ]; then
                  echo &#34;Waiting ${sleep_timer}s for next pod to be ready...&#34;
                  SLEEPER_TMP=1
                  while [ &#34;$SLEEPER_TMP&#34; -le &#34;$sleep_timer&#34; ]; do
                    if [ $(( SLEEPER_TMP % 10 )) -eq 0 ]; then
                      echo -n &#34;$SLEEPER_TMP&#34;
                    else
                      echo -n &#34;.&#34;
                    fi
                    sleep 1
                    SLEEPER_TMP=$(( SLEEPER_TMP + 1 ))
                  done
                  echo &#34;&#34;
                fi
              done
              echo &#34;Unseal complete.&#34;
          volumeMounts:
            - name: shared
              mountPath: /shared
              readOnly: true
            - name: openbao-ca
              mountPath: /etc/openbao-ca
              readOnly: true
      volumes: <i class="conum" data-value="5"></i><b>(5)</b>
        - name: init-secret
          secret:
            secretName: openbao-init-data
        - name: shared
          emptyDir: {}
        - name: openbao-ca
          secret:
            secretName: openbao-ca-secret
            optional: true
      restartPolicy: Never
  backoffLimit: 2</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The ServiceAccount is used by the Job to unseal the OpenBao pods. Here we are using the same ServiceAccount as the one used to initialise the OpenBao service.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The init container extracts unseal keys from init.json using jq and writes them to a shared volume.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The main container runs kubectl to exec into each OpenBao pod and run <code>bao operator unseal</code> (the OpenBao image is used inside the target pods).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The command is used to unseal the OpenBao service.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The volumes that are mounted: init-secret (contains the unseal keys), shared (contains the extracted unseal keys, shared between containers), openbao-ca (contains the CA certificate).</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Both Jobs are using the same ServiceAccount and therefore the same RBAC rules. It is also possible to use a different ServiceAccount for the unseal Job.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Store init data securely. Keeping unseal keys in a cluster Secret is convenient but less secure than auto-unseal or an external secrets manager. Restrict access to the <code>openbao-init-data</code> Secret (e.g. RBAC and network policies) and consider rotating or moving keys to a more secure store after bootstrap.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect2">
<h3 id="_approach_3_auto_unseal_with_key_management_service_kms_recommended_for_production">Approach 3: Auto-unseal with Key Management Service KMS (recommended for production)</h3>
<div class="paragraph">
<p>Configure a KMS (e.g. AWS KMS, Azure Key Vault, GCP Cloud KMS, Transit etc.) so that OpenBao unseals itself on every restart. You initialise <strong>once</strong> and thereafter no manual unseal step is needed.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The rest of this article will mention the different options. However, I can only demonstrate a real example using the AWS KMS option.
</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_auto_unseal_options_overview">Auto-unseal options overview</h4>
<div class="paragraph">
<p>Without auto-unseal, you must run <code>bao operator unseal</code> with a threshold of keys after each restart. With auto-unseal, OpenBao uses a seal backend to protect the root key and unseals itself on startup.</p>
</div>
<div class="paragraph">
<p>Supported options:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
<col style="width: 50%;"/>
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Option</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Use case</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Notes</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1. AWS KMS</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">AWS (EKS, OpenShift on AWS)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">IRSA or IAM user; no keys in cluster with IRSA.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">2. Azure Key Vault</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Azure (AKS, OpenShift on Azure)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Service principal or managed identity.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">3. Google Cloud KMS</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">GCP (GKE)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Service account key or Workload Identity.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">5. Transit</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Existing Vault/OpenBao as root of trust; or a <strong>dedicated seal-only OpenBao</strong> that exists only to unseal production</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">External transit engine; token in a Secret.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="_why_use_openbao_when_the_seal_is_in_kms_why_not_keep_all_secrets_in_kms_and_skip_openbao">Why use OpenBao when the seal is in KMS? Why not keep all secrets in KMS and skip OpenBao?</h4>
<div class="paragraph">
<p>When using a cloud KMS (or Key Vault) for auto-unseal, a natural question is: why not store and retrieve <strong>all</strong> secrets from the KMS and run without OpenBao at all? OpenBao remains useful for operators and applications for several reasons:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>KMS is for keys, not a full secrets platform.</strong> AWS KMS, Azure Key Vault keys, and GCP Cloud KMS are built to encrypt and decrypt small blobs (e.g. data encryption keys, or OpenBao’s seal blob). They are not a general-purpose secrets store with versioning, path-based access, dynamic credentials, and per-request audit. OpenBao provides that layer: applications request secrets by path, get short-lived tokens, and you get a single place to define who can read what.</p>
</li>
<li>
<p><strong>Dynamic secrets.</strong> OpenBao can generate short-lived credentials on demand (e.g. database users, cloud IAM roles, PKI certificates). The KMS does not create or rotate such credentials; it only holds keys. If you need “give this pod a DB password that expires in 1 hour,” that is OpenBao’s domain, not the KMS.</p>
</li>
<li>
<p><strong>Fine-grained, identity-aware access.</strong> OpenBao supports auth methods (Kubernetes, OIDC, AppRole, LDAP) and path-based policies. You can say “this service account may read only <code>secret/data/myapp/*</code>.” The KMS has IAM or Key Vault RBAC, but not the same model of “one API, many identities, many paths” that applications and operators use day to day.</p>
</li>
<li>
<p><strong>Audit and compliance.</strong> OpenBao logs every secret read and write with identity and path. That gives a clear audit trail of who accessed which secret and when. KMS audit logs key usage, which is different from “which application read which secret at what time” in a unified way.</p>
</li>
<li>
<p><strong>Abstraction and portability.</strong> Applications talk to OpenBao’s API. You can move the seal or the storage backend (or even the cloud) without changing how applications request secrets. If you put everything directly in a cloud KMS, you tie every app to that vendor’s API and limits.</p>
</li>
<li>
<p><strong>Encryption as a service (Transit).</strong> OpenBao’s Transit secrets engine lets applications encrypt data with a key without ever seeing the key—useful for application-level encryption and key rotation. KMS can do something similar, but OpenBao integrates that with the same auth and audit as the rest of your secrets.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In short: the KMS is the <strong>root of trust</strong> for the seal (so OpenBao can unseal itself). OpenBao is the <strong>secrets management platform</strong> that applications and operators use for storing, retrieving, generating, and auditing secrets. Both layers complement each other.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>General flow (same for all options):</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Set up the seal backend (KMS key, Key Vault, static key, or transit server).</p>
</li>
<li>
<p>Add the appropriate <code>seal &#34;…​&#34;</code> stanza to OpenBao configuration (e.g. in Helm <code>server.ha.raft.config</code>).</p>
</li>
<li>
<p>Deploy OpenBao; pods start and remain sealed until initialised.</p>
</li>
<li>
<p>Run one-time initialisation: <code>bao operator init -recovery-shares=5 -recovery-threshold=3</code>.</p>
</li>
<li>
<p>From then on, restarts are automatically unsealed.</p>
</li>
</ol>
</div>
</div>
<div class="sect3">
<h4 id="_option_aws_kms">Option: AWS KMS</h4>
<div class="paragraph">
<p>Best for: EKS, OpenShift on AWS (ROSA), or any Kubernetes on AWS.</p>
</div>
<div class="sect4">
<h5 id="_create_a_kms_key">Create a KMS key</h5>
<div class="paragraph">
<p>Create a <strong>symmetric</strong> KMS key used only for the OpenBao seal (do not use for application data).</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>AWS WebUI:</strong></p>
<div class="ulist">
<ul>
<li>
<p>search for: KMS → Create key → Symmetric, Encrypt/Decrypt</p>
</li>
<li>
<p>Optionally set an alias (e.g. <code>openbao-unseal</code>).</p>
</li>
<li>
<p>OPTIONAL: Define key administrative permissions</p>
</li>
<li>
<p>OPTIONAL: Define key usage permissions</p>
</li>
<li>
<p>Edit key policy</p>
</li>
</ul>
</div>
</li>
<li>
<p><strong>AWS CLI:</strong> (requires the AWS CLI to be installed and configured)</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">aws kms create-key \
  --description &#34;OpenBao auto-unseal key&#34; \
  --key-usage ENCRYPT_DECRYPT

aws kms create-alias \
  --alias-name openbao-unseal \
  --target-key-id &lt;key-id-from-above&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note the <strong>Key ID</strong> or <strong>Alias</strong> and the <strong>region</strong> (e.g. <code>us-west-1</code>) from the output of the command.</p>
</div>
</li>
</ul>
</div>
</div>
<div class="sect4">
<h5 id="_key_policy_for_openbao">Key policy for OpenBao</h5>
<div class="paragraph">
<p>The OpenBao process needs permission to use the key. Create an IAM policy. In the UI you can configure this directly when creating the key. When using the CLI, create a <code>policy.json</code> file with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
  &#34;Version&#34;: &#34;2012-10-17&#34;,
  &#34;Statement&#34;: [
    {
      &#34;Effect&#34;: &#34;Allow&#34;,
      &#34;Action&#34;: [
        &#34;kms:Encrypt&#34;,
        &#34;kms:Decrypt&#34;,
        &#34;kms:DescribeKey&#34;
      ],
      &#34;Resource&#34;: &#34;arn:aws:kms:&lt;REGION&gt;:&lt;ACCOUNT_ID&gt;:key/&lt;KEY_ID&gt;&#34; <i class="conum" data-value="1"></i><b>(1)</b>
    }
  ]
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Replace <code>&lt;REGION&gt;</code>, <code>&lt;ACCOUNT_ID&gt;</code>, and <code>&lt;KEY_ID&gt;</code> with your values (or use the key ARN).</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect4">
<h5 id="_create_an_iam_user_for_the_seal">Create an IAM user for the seal</h5>
<div class="paragraph">
<p>When using static credentials (e.g. on OpenShift or when IRSA is not available), create a dedicated IAM user that has permission only to use the KMS key above. Use that user’s access keys in the Kubernetes Secret.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>AWS WebUI:</strong></p>
<div class="ulist">
<ul>
<li>
<p>search for: IAM → Users → Create user</p>
</li>
<li>
<p>User name: e.g. <code>openbao-seal</code></p>
</li>
<li>
<p>DO NOT select &#34;Provide user access to the AWS Management Console&#34; (programmatic access only)</p>
</li>
<li>
<p>Create user</p>
</li>
<li>
<p>Open the created user → Permissions → Add permissions → Create inline policy (or Attach policies → Create policy)</p>
</li>
<li>
<p>In the policy editor, choose JSON and paste the policy from <a href="#_key_policy_for_openbao">Key policy for OpenBao</a>, replacing <code>&lt;REGION&gt;</code>, <code>&lt;ACCOUNT_ID&gt;</code>, and <code>&lt;KEY_ID&gt;</code> with your KMS key ARN or alias</p>
</li>
<li>
<p>Name the policy (e.g. <code>OpenBaoSealKMS</code>) and attach it to the user</p>
</li>
<li>
<p>Security credentials → Create access key → Application running outside AWS (or &#34;Third-party service&#34;) → Create access key</p>
</li>
<li>
<p>Save the Access key ID and Secret access key; you will put them in the Kubernetes Secret <code>openbao-aws-credentials</code>.</p>
</li>
</ul>
</div>
</li>
<li>
<p><strong>AWS CLI:</strong> (requires the AWS CLI to be installed and configured)</p>
<div class="paragraph">
<p>Create a policy file (e.g. <code>openbao-seal-policy.json</code>) with the same JSON as in <a href="#_key_policy_for_openbao">Key policy for OpenBao</a>, then create the user, attach the policy, and create access keys:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Replace REGION, ACCOUNT_ID, and KEY_ID in the policy (or use alias: arn:aws:kms:REGION:ACCOUNT_ID:alias/openbao-unseal)
aws iam create-policy \
  --policy-name OpenBaoSealKMS \
  --policy-document file://openbao-seal-policy.json

aws iam create-user --user-name openbao-seal

aws iam attach-user-policy \
  --user-name openbao-seal \
  --policy-arn arn:aws:iam::ACCOUNT_ID:policy/OpenBaoSealKMS

aws iam create-access-key --user-name openbao-seal</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The last command returns <code>AccessKeyId</code> and <code>SecretAccessKey</code>; store them in the Secret <code>openbao-aws-credentials</code> with key <code>AWS_REGION</code> set to your region (e.g. <code>us-west-1</code>).
</td>
</tr>
</tbody></table>
</div>
</li>
</ul>
</div>
</div>
<div class="sect4">
<h5 id="_create_the_secret">Create the Secret</h5>
<div class="paragraph">
<p>Create the Secret <code>openbao-aws-credentials</code> in the <code>openbao</code> namespace. It contains the access key, secret access key, and region.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: openbao-aws-credentials
  namespace: openbao
type: Opaque
stringData: <i class="conum" data-value="1"></i><b>(1)</b>
  AWS_ACCESS_KEY_ID: &lt;your-access-key&gt;
  AWS_SECRET_ACCESS_KEY: &lt;your-secret-key&gt;
  AWS_REGION: &lt;your-region&gt;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Replace <code>&lt;your-access-key&gt;</code>, <code>&lt;your-secret-key&gt;</code>, and <code>&lt;your-region&gt;</code> with the values from the previous steps.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect4">
<h5 id="_helm_argo_cd_configuration_aws">Helm / Argo CD configuration (AWS)</h5>
<div class="paragraph">
<p>Add the <code>seal &#34;awskms&#34;</code> block inside the same HCL config that contains <code>listener</code>, <code>storage &#34;raft&#34;</code>. In Helm values this is typically under <code>openbao.server.ha.raft.config</code>.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Be sure to update the region and key ID.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The values file we used for Argo CD can be found at: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/openbao/values.yaml" rel="noopener" target="_blank">OpenBao Argo CD values file</a></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">openbao:
  server:

    extraSecretEnvironmentVars: <i class="conum" data-value="1"></i><b>(1)</b>
      - envName: AWS_ACCESS_KEY_ID
        secretName: openbao-aws-credentials
        secretKey: AWS_ACCESS_KEY_ID
      - envName: AWS_SECRET_ACCESS_KEY
        secretName: openbao-aws-credentials
        secretKey: AWS_SECRET_ACCESS_KEY
      - envName: AWS_REGION
        secretName: openbao-aws-credentials
        secretKey: AWS_REGION

    ha:
      raft:
        config: |
          ui = true

          seal &#34;awskms&#34; { <i class="conum" data-value="2"></i><b>(2)</b>
            region     = &#34;us-east-1&#34;
            kms_key_id = &#34;alias/openbao-unseal&#34;
          }

          listener &#34;tcp&#34; {
            tls_disable = 0
            address     = &#34;[::]:8200&#34;
            cluster_address = &#34;[::]:8201&#34;
            tls_cert_file   = &#34;/openbao/tls/openbao-server-tls/tls.crt&#34;
            tls_key_file    = &#34;/openbao/tls/openbao-server-tls/tls.key&#34;
            tls_min_version = &#34;tls12&#34;
          }

          storage &#34;raft&#34; {
            path = &#34;/openbao/data&#34;
          }

          service_registration &#34;kubernetes&#34; {}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>If you use static credentials (e.g. for OpenShift), inject them via a Secret.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>This must be added. Be sure to update your region and key ID.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
The <code>seal &#34;awskms&#34;</code> block alone is not enough. OpenBao must have AWS credentials available at runtime. If you see an error such as <code>NoCredentialProviders: no valid providers in chain</code> or <code>error fetching AWS KMS wrapping key information</code>, the pod has no credentials. You must either inject static credentials from a Secret (see below) or use IRSA so the pod can assume an IAM role.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_approach_4_init_container_with_external_secret_store">Approach 4: Init container with external secret store</h3>
<div class="paragraph">
<p>Another option is to use an init container that retrieves secrets from an external source. Two use cases can be considered here:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Shamir unseal:</strong> The init container fetches the unseal keys from an external secret manager and then runs <code>bao operator unseal</code> (or writes keys to a file used by a sidecar/unseal script). This is the classic “external secret store” idea (e.g. using AWS Secrets Manager, HashiCorp Vault, another Kubernetes cluster).</p>
</li>
<li>
<p><strong>Transit seal token:</strong> The init container fetches the <strong>token</strong> that production OpenBao uses to call the dedicated unseal service (see <a href="#_dedicated_unseal_service_seal_only_openbao">Dedicated unseal service (seal-only OpenBao)</a>). That token is written to a file or shared volume so the main OpenBao process can use it in <code>seal &#34;transit&#34;</code>. The token never lives in a Kubernetes Secret in Git or in plain YAML; it is fetched at pod start from the external store.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Below is a generic placeholder for the init container.</p>
</div>
<div class="sect3">
<h4 id="_option_init_container_example">Option: init Container example</h4>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The following options are generic and more theoretical. Unlike the other options, I could not test them in a real environment yet. This may be covered in a future article.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Generic placeholder (implement according to your secret store):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Additional values for the Helm chart
server:
  extraInitContainers:
    - name: fetch-secrets
      image: registry.access.redhat.com/ubi9/ubi-minimal:latest
      command:
        - /bin/sh
        - -c
        - |
          # Fetch unseal keys OR transit token from external secret manager
          echo &#34;Waiting for OpenBao to be ready...&#34;
          sleep 30
          # Your fetch logic here (e.g. aws secretsmanager get-secret-value, vault kv get, curl to API) <i class="conum" data-value="1"></i><b>(1)</b>
      env:
        - name: EXTERNAL_SECRET_ENDPOINT <i class="conum" data-value="2"></i><b>(2)</b>
          value: &#34;https://your-external-secret-store.example.com&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Replace with your fetch logic.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Replace with your external secret store endpoint.</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
<div class="sect3">
<h4 id="_option_transit_seal">Option: Transit seal</h4>
<div class="paragraph">
<p>When you already have a Vault or OpenBao cluster and want it to act as the root of trust (e.g. central Vault encrypts the seal key), you can use this option.</p>
</div>
<div class="paragraph">
<p>To prepare everything, you need to do the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Enable the <strong>Transit</strong> secrets engine on the external Vault/OpenBao and create a key (e.g. <code>openbao-unseal</code>).</p>
</li>
<li>
<p>Grant the token used by this OpenBao permission to encrypt/decrypt with that key.</p>
</li>
<li>
<p>Store the token in a Kubernetes Secret and inject via <code>extraSecretEnvironmentVars</code></p>
</li>
</ul>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do not put the token in the config file.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following HCL configuration is used to configure the OpenBao cluster to use the transit seal.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-hcl hljs" data-lang="hcl">seal &#34;transit&#34; {
  address         = &#34;https://external-vault.example.com:8200&#34;
  token           = &#34;s.xxx&#34;
  disable_renewal = &#34;false&#34;
  key_name        = &#34;openbao-unseal&#34;
  mount_path      = &#34;transit/&#34;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>See the <a href="https://openbao.org/docs/configuration/seal/transit/" rel="noopener" target="_blank">OpenBao transit seal</a> documentation for further details.</p>
</div>
<div class="sect4">
<h5 id="_dedicated_unseal_service_seal_only_openbao">Dedicated unseal service (seal-only OpenBao)</h5>
<div class="paragraph">
<p>A common and recommended pattern is to run a <strong>separate, standalone OpenBao instance</strong> whose <strong>only</strong> role is to provide the seal for your production OpenBao. In other words: the external OpenBao holds the unseal keys—via its Transit secrets engine—and the production OpenBao cluster uses the transit seal to auto-unseal by calling that external instance. No application secrets or other workloads run on the dedicated instance; it exists solely to unseal the production OpenBao.</p>
</div>
<div class="paragraph">
<p><strong>Why use a dedicated unseal service?</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Separation of concerns:</strong> The root of trust for unsealing lives outside the production cluster. If the production OpenBao is compromised or rebuilt, the seal keys remain in the dedicated instance.</p>
</li>
<li>
<p><strong>Simpler operations:</strong> You unseal and manage only one small, locked-down OpenBao (the seal service). The production OpenBao unseals itself automatically via transit.</p>
</li>
<li>
<p><strong>No cloud KMS required:</strong> On-premise or air-gapped environments can use this pattern instead of AWS KMS, Azure Key Vault, or GCP Cloud KMS.</p>
</li>
<li>
<p><strong>Clear trust boundary:</strong> The dedicated instance can be hardened, network-isolated, and backed up independently.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Architecture (high level):</strong></p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Dedicated unseal service:</strong> A standalone OpenBao (single node is often enough) with the Transit secrets engine enabled and a dedicated transit key (e.g. <code>production-openbao-unseal</code>). This instance is initialised and unsealed once; you keep its unseal keys and root token very secure. It does not store application secrets.</p>
</li>
<li>
<p><strong>Production OpenBao:</strong> Your HA OpenBao cluster (e.g. in Kubernetes) is configured with <code>seal &#34;transit&#34;</code> pointing at the dedicated service URL and a token that has permission only to use that transit key. On startup, each production node asks the dedicated OpenBao to decrypt its seal blob and thus unseals automatically.</p>
</li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_migration_from_shamir_to_auto_unseal">Migration from Shamir to auto-unseal</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You might wonder if you can migrate from Shamir to auto-unseal. The answer is yes, you can.</p>
</div>
<div class="paragraph">
<p>If OpenBao was previously initialised with <strong>Shamir</strong> unseal keys and you want to switch to any auto-unseal backend, you can do the following:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Plan a short maintenance window. Raft HA will tolerate one node at a time.</p>
</li>
<li>
<p>Add the appropriate <code>seal &#34;…​&#34;</code> block to the config and deploy (e.g. via Argo CD).</p>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Do NOT re-run init.
</td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Unseal the <strong>leader</strong> with the existing Shamir unseal keys.</p>
</li>
<li>
<p>Run <strong>seal migration</strong> on the leader:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao operator unseal -migrate</code></pre>
</div>
</div>
</li>
<li>
<p>Restart the leader. It should auto-unseal via the new seal.</p>
</li>
<li>
<p>Update and restart standby nodes. They should auto-unseal as well.</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_resources">Resources</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://openbao.org/docs/concepts/seal/" rel="noopener" target="_blank">OpenBao seal concepts</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/platform/k8s/" rel="noopener" target="_blank">OpenBao on Kubernetes</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/configuration/seal/awskms/" rel="noopener" target="_blank">AWS KMS seal</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/configuration/seal/azurekeyvault/" rel="noopener" target="_blank">Azure Key Vault seal</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/configuration/seal/gcpckms/" rel="noopener" target="_blank">Google Cloud KMS seal</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/configuration/seal/static/" rel="noopener" target="_blank">Static seal</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/configuration/seal/transit/" rel="noopener" target="_blank">Transit seal</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>The Guide to OpenBao - GitOps Deployment with Argo CD - Part 5</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-02-20-openbao-part-5-gitops-deployment/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-02-20-openbao-part-5-gitops-deployment/</guid><pubDate>Fri, 20 Feb 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><category>GitOps</category><description>Deploying and managing OpenBao using GitOps principles with Argo CD for declarative, version-controlled secret management infrastructure</description><content:encoded><![CDATA[<div class="paragraph">
<p>Following the GitOps mantra &#34;If it is not in Git, it does not exist&#34;, this article demonstrates how to deploy and manage OpenBao using Argo CD. This approach provides version control, audit trails, and declarative management for your secret management infrastructure.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Deploying OpenBao via GitOps offers significant advantages:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Version Control</strong>: All configuration changes are tracked in Git</p>
</li>
<li>
<p><strong>Audit Trail</strong>: Who changed what, when, and why</p>
</li>
<li>
<p><strong>Declarative</strong>: Desired state is defined, not imperative commands</p>
</li>
<li>
<p><strong>Reproducible</strong>: Same deployment process across environments</p>
</li>
<li>
<p><strong>Self-healing</strong>: Argo CD ensures actual state matches desired state</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>However, there are challenges specific to secret management:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Initial unsealing requires manual intervention or automationxw</p>
</li>
<li>
<p>Root tokens and unseal keys must be handled carefully</p>
</li>
<li>
<p>Chicken-and-egg problem: How to store OpenBao secrets before OpenBao exists?</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This article will focus on the deployment of the applicaiotns for the OpenBao deployment. The problem with the automatic unsealing will be addressed in the next article.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before you begin, ensure you have:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenShift GitOps (Argo CD) installed and configured</p>
</li>
<li>
<p>A Git repository for your cluster configuration</p>
</li>
<li>
<p>Understanding of the App-of-Apps pattern (see <a href="/gitopscollection/2024-04-02-configure_app_of_apps/">Configure App-of-Apps</a>)</p>
</li>
<li>
<p>The official OpenBao Helm chart from <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_wrapper_helm_chart">The (Wrapper) Helm Chart</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The official OpenBao Helm Chart works well for deploying OpenBao itself. However, additional settings such as certificates are not covered there. Therefore, I created a (wrapper) Helm Chart that includes the official OpenBao Helm Chart, a <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">Cert-Manager Helm Chart</a> that I created a while ago, and allows you to add additional objects in the templates folder.</p>
</div>
<div class="paragraph">
<p>I will follow the same setup as discussed in <a href="/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls">Part 4</a>. This means:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Create Issuer for Cert-Manager</p>
</li>
<li>
<p>Create CA Certificate for OpenBao</p>
</li>
<li>
<p>Create Certificate for OpenBao Server</p>
</li>
<li>
<p>Create Certificate for OpenBao Agent Injector</p>
</li>
<li>
<p>Install OpenBao Helm Chart</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>However, there is <strong>one significant issue</strong> with this approach: we need the certificate details (especially the CA certificate) before we can install the OpenBao Helm Chart, since the certificate must be referenced in the values file. This is a chicken-and-egg problem—particularly if you use self-signed CA certificates.</p>
</div>
<div class="paragraph">
<p>Since you typically create the CA certificate first and only once (or have it already), a separate Application for the CA certificate is a good approach. Once this is synchronised, the OpenBao Application can be updated and deployed.</p>
</div>
<div class="paragraph">
<p>This means we will need two Helm Charts: one for the CA certificate and one for OpenBao itself.</p>
</div>
<div class="sect2">
<h3 id="_helm_chart_for_the_ca_certificate">Helm Chart for the CA Certificate</h3>
<div class="paragraph">
<p>Create a new Helm Chart for the CA certificate. This will use the <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">Cert-Manager Helm Chart</a> as a dependency and will create the:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Issuer for Cert-Manager</p>
</li>
<li>
<p>Request the CA certificate from the Issuer</p>
</li>
<li>
<p>Create the <strong>openbao</strong> namespace</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The example I am using can be found at <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/openbao-ca-certificate" rel="noopener" target="_blank">GitOps openbao-ca-certificate</a>.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Please check the <a href="/gitopscollection/2023-12-28-gitops-repostructure/" rel="noopener" target="_blank">GitOps Repository Structure</a> and subsequent articles for more information on how to structure your Git repository.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In the <strong>Chart.yaml</strong> file you can see two dependencies:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">dependencies:
  - name: tpl
    version: ~1.0.0
    repository: https://charts.stderr.at/
  - name: cert-manager
    version: ~2.0.3 <i class="conum" data-value="1"></i><b>(1)</b>
    repository: https://charts.stderr.at/
    condition: cert-manager.enabled</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The Cert-Manager Helm Chart version must be at least 2.0.3 to support the namespace parameter for the Issuer.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The <strong>tpl</strong> dependency is a library that contains templates for the namespace and other shared components (I keep this library in my <a href="/helm-charts/" rel="noopener" target="_blank">Helm Charts</a> repository). The <strong>cert-manager</strong> dependency is the Cert-Manager Helm Chart.</p>
</div>
<div class="paragraph">
<p>The <strong>values.yaml</strong> file below contains the configuration for the Cert-Manager:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
All settings that are passed to a subchart (cert-manager) must be prefixed with the name of the subchart. In this case, <code>cert-manager.</code>.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">namespace:
  create: true <i class="conum" data-value="1"></i><b>(1)</b>
  name: &#34;openbao&#34;
  description: &#34;OpenBao Namespace&#34;
  displayName: &#34;OpenBao Namespace&#34;
  additionalLabels:
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/audit-version: latest
    pod-security.kubernetes.io/warn: restricted
    pod-security.kubernetes.io/warn-version: latest

cert-manager: <i class="conum" data-value="2"></i><b>(2)</b>
  enabled: true <i class="conum" data-value="3"></i><b>(3)</b>

  issuer:
      # Name of issuer
    - name: openbao-selfsigned <i class="conum" data-value="4"></i><b>(4)</b>

      # -- Syncwave to create this issuer
      syncwave: 5 <i class="conum" data-value="5"></i><b>(5)</b>

      # -- Type can be either ClusterIssuer or Issuer
      type: Issuer

      # -- Enable this issuer.
      # @default -- false
      enabled: true

      # -- Namespace for Issuer (ignored for ClusterIssuer). Defaults to the default namespace when not set.
      namespace: openbao <i class="conum" data-value="6"></i><b>(6)</b>

      # -- Create a selfSigned issuer. The SelfSigned issuer doesn&#39;t represent a certificate authority as such, but instead denotes that certificates will &#34;sign themselves&#34; using a given private key.
      selfSigned: true <i class="conum" data-value="7"></i><b>(7)</b>

  certificates: <i class="conum" data-value="8"></i><b>(8)</b>
    enabled: true

    # List of certificates
    certificate:
      - name: openbao-ca
        enabled: true
        namespace: openbao
        syncwave: &#34;10&#34;
        secretName: openbao-ca-secret

        duration: 87660h

        dnsNames:
          - openbao-ca

        privateKey:
          algorithm: ECDSA
          size: 256
          rotationPolicy: Always

        isCA: true

        # Reference to the issuer that shall be used.
        issuerRef:
          name: openbao-selfsigned
          kind: Issuer</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Create the <strong>openbao</strong> namespace with various settings.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enable the Cert-Manager subchart. All settings below will be passed to the Cert-Manager subchart.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Enables Cert-Manager.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Name of the issuer.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Syncwave for this issuer; it must be lower than the syncwave of the certificate.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Namespace for the issuer; supported since version 2.0.3 of the Cert-Manager Helm Chart.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Creates a self-signed issuer.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The certificate section and all the settings. Verify the <a href="/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls/#_step_1_certificate_authority_ca_for_openbao">Part 4</a> for more information.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This chart creates the <strong>openbao</strong> namespace, which is required for the OpenBao deployment.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_helm_chart_for_the_openbao_deployment">Helm Chart for the OpenBao Deployment</h3>
<div class="paragraph">
<p>Create a new Helm Chart for the OpenBao deployment. This will use the official <a href="https://github.com/openbao/openbao-helm" rel="noopener" target="_blank">OpenBao Helm chart</a> and the <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">Cert-Manager Helm Chart</a> as dependencies and will create the:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenBao deployment (including Route)</p>
</li>
<li>
<p>Issuer for the OpenBao server using the CA certificate</p>
</li>
<li>
<p>Required OpenBao certificates based on the CA certificate</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>I have added the full values.yaml file below. Please check the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/openbao/values.yaml" rel="noopener" target="_blank">GitOps openbao/values.yaml</a> to fetch the full chart.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Besides the two certificates added here in the values.yaml file, I made two further changes: fullnameOverride and nameOverride are both set to <strong>openbao</strong>. This is good practice for setting the name of the deployment when using Argo CD.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
This values file contains the CA certificate in plain text. Whether that is acceptable is debatable—it is a public certificate, and here it is self-signed and used only in my demo environment.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Full values.yaml file for the OpenBao deployment

########################################################
# Cert-Manager
########################################################
cert-manager:
  enabled: true

  issuer:
      # Name of issuer
    - name: openbao-ca-issuer <i class="conum" data-value="1"></i><b>(1)</b>

      # -- Syncwave to create this issuer
      syncwave: &#39;-1&#39;

      # -- Type can be either ClusterIssuer or Issuer
      type: Issuer

      # -- Enable this issuer.
      # @default -- false
      enabled: true

      # -- Namespace for Issuer (ignored for ClusterIssuer). Defaults to the default namespace when not set.
      namespace: openbao

      ca:
        secretName: openbao-ca-secret

  certificates:
    enabled: true

    # List of certificates
    certificate:
      ########################################################
      # OpenBao Server TLS Certificate
      ########################################################
      - name: openbao-server-tls <i class="conum" data-value="2"></i><b>(2)</b>
        enabled: true
        namespace: openbao
        syncwave: &#34;0&#34;
        secretName: openbao-server-tls

        duration: 8760h
        renewBefore: 720h

        dnsNames:
          - openbao.openbao.svc
          - openbao.apps.ocp.aws.ispworld.at # Route host (adjust to your domain)
          - openbao
          - openbao.openbao
          - openbao.openbao.svc
          - openbao.openbao.svc.cluster.local
          - openbao-internal
          - openbao-internal.openbao
          - openbao-internal.openbao.svc
          - openbao-internal.openbao.svc.cluster.local
          - openbao-0.openbao-internal
          - openbao-0.openbao-internal.openbao
          - openbao-0.openbao-internal.openbao.svc
          - openbao-0.openbao-internal.openbao.svc.cluster.local
          - openbao-1.openbao-internal
          - openbao-1.openbao-internal.openbao
          - openbao-1.openbao-internal.openbao.svc
          - openbao-2.openbao-internal
          - openbao-2.openbao-internal.openbao
          - openbao-2.openbao-internal.openbao.svc

        ipAddresses:
          - 127.0.0.1
          - &#34;::1&#34;

        # Reference to the issuer that shall be used.
        issuerRef:
          name: openbao-ca-issuer
          kind: Issuer

      ########################################################
      # Injector TLS Certificate
      ########################################################
      - name: injector-certificate <i class="conum" data-value="3"></i><b>(3)</b>
        enabled: true
        namespace: openbao
        syncwave: &#34;0&#34;
        secretName: injector-tls

        duration: 24h
        renewBefore: 144m

        dnsNames:
          - openbao-agent-injector-svc
          - openbao-agent-injector-svc.openbao
          - openbao-agent-injector-svc.openbao.svc
          - openbao-agent-injector-svc.openbao.svc.cluster.local

        # Reference to the issuer that shall be used.
        issuerRef:
          name: openbao-ca-issuer
          kind: Issuer

########################################################
# OpenBao Deployment
########################################################
openbao: <i class="conum" data-value="4"></i><b>(4)</b>
  # Override the full name of the deployment via Argo CD
  fullnameOverride: openbao
  nameOverride: openbao

  global:
    # Enable OpenShift-specific settings
    openshift: true

    # -- The namespace to deploy to. Defaults to the `helm` installation namespace.
    namespace: openbao

    # Required when TLS is enabled: tells the chart to use HTTPS for readiness/liveness
    # probes and for in-pod API_ADDR (127.0.0.1:8200). Otherwise you get &#34;client sent
    # an HTTP request to an HTTPS server&#34; from the probes.
    tlsDisable: false

  server:
    extraEnvironmentVars:
      BAO_CACERT: /openbao/tls/openbao-server-tls/ca.crt

    # High Availability configuration
    ha:
      enabled: true
      replicas: 3

      # Raft storage configuration
      raft:
        enabled: true
        setNodeId: true

        config: |
          ui = true

          listener &#34;tcp&#34; {
            tls_disable = 0
            address = &#34;[::]:8200&#34;
            cluster_address = &#34;[::]:8201&#34;
            tls_cert_file = &#34;/openbao/tls/openbao-server-tls/tls.crt&#34;
            tls_key_file  = &#34;/openbao/tls/openbao-server-tls/tls.key&#34;
            tls_min_version = &#34;tls12&#34;
            telemetry {
              unauthenticated_metrics_access = &#34;true&#34;
            }
          }

          storage &#34;raft&#34; {
            path = &#34;/openbao/data&#34;

            retry_join {
              leader_api_addr = &#34;https://openbao-0.openbao-internal:8200&#34;
              leader_tls_servername = &#34;openbao-0.openbao-internal&#34;
              leader_ca_cert_file = &#34;/openbao/tls/openbao-server-tls/ca.crt&#34;
            }
            retry_join {
              leader_api_addr = &#34;https://openbao-1.openbao-internal:8200&#34;
              leader_tls_servername = &#34;openbao-1.openbao-internal&#34;
              leader_ca_cert_file = &#34;/openbao/tls/openbao-server-tls/ca.crt&#34;
            }
            retry_join {
              leader_api_addr = &#34;https://openbao-2.openbao-internal:8200&#34;
              leader_tls_servername = &#34;openbao-2.openbao-internal&#34;
              leader_ca_cert_file = &#34;/openbao/tls/openbao-server-tls/ca.crt&#34;
            }
          }

          service_registration &#34;kubernetes&#34; {}

          telemetry {
            prometheus_retention_time = &#34;30s&#34;
            disable_hostname = true
          }

    route:
      enabled: true
      host: openbao.apps.ocp.aws.ispworld.at
      tls:
        # Route terminates client TLS; backend can use reencrypt or passthrough
        termination: reencrypt
        insecureEdgeTerminationPolicy: Redirect
        destinationCACertificate: |
          -----BEGIN CERTIFICATE-----
          MIIBWzCCAQCgAwIBAgIQNdbg4KIu9oi6dDClE8drmjAKBggqhkjOPQQDAjAAMB4X
          DTI2MDIxODA5NDIxNFoXDTM2MDIxODIxNDIxNFowADBZMBMGByqGSM49AgEGCCqG
          SM49AwEHA0IABIeYw35/kEHvyctLtOA5xMlyQNxUtXtfBbZMUfPh6AN5MFjIGuNS
          cn07a3EpSpfY6/3DaPpu+4wYNFlc+/qDNYajXDBaMA4GA1UdDwEB/wQEAwICpDAP
          BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQgyRk5Vv9K0VULcCgga5mRg4O9kTAY
          BgNVHREBAf8EDjAMggpvcGVuYmFvLWNhMAoGCCqGSM49BAMCA0kAMEYCIQCwQ7lZ
          Q0jzUjJFzpTGkQjU2+OB159LIQMSbSQ7dz8nVQIhAIDa7f87tjQxDxbJio+/vJx2
          awFaWnueGOOQpvwCcV/+
          -----END CERTIFICATE-----

    extraVolumes:
      - type: secret
        name: openbao-server-tls
        path: /openbao/tls
        readOnly: true

    extraVolumeMounts:
      - name: openbao-server-tls
        mountPath: /openbao/tls
        readOnly: true

    # Resource requests and limits
    resources:
      requests:
        memory: 256Mi
        cpu: 250m
      limits:
        memory: 1Gi
        cpu: 1000m

    # Persistent volume for data
    dataStorage:
      enabled: true
      size: 10Gi
      # storageClass: &#34;gp3-csi&#34;

  # Injector configuration
  injector:
    enabled: true
    replicas: 2  # HA for the injector too
    certs:
      secretName: injector-tls
      # For a private CA: set caBundle to the CA cert (PEM) so the Kubernetes API server trusts the injector webhook. E.g. oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d
      caBundle:  &#34;LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJXekNDQVFDZ0F3SUJBZ0lRTmRiZzRLSXU5b2k2ZERDbEU4ZHJtakFLQmdncWhrak9QUVFEQWpBQU1CNFgKRFRJMk1ESXhPREE1TkRJeE5Gb1hEVE0yTURJeE9ESXhOREl4TkZvd0FEQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxRwpTTTQ5QXdFSEEwSUFCSWVZdzM1L2tFSHZ5Y3RMdE9BNXhNbHlRTnhVdFh0ZkJiWk1VZlBoNkFONU1GaklHdU5TCmNuMDdhM0VwU3BmWTYvM0RhUHB1KzR3WU5GbGMrL3FETllhalhEQmFNQTRHQTFVZER3RUIvd1FFQXdJQ3BEQVAKQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlFneVJrNVZ2OUswVlVMY0NnZ2E1bVJnNE85a1RBWQpCZ05WSFJFQkFmOEVEakFNZ2dwdmNHVnVZbUZ2TFdOaE1Bb0dDQ3FHU000OUJBTUNBMGtBTUVZQ0lRQ3dRN2xaClEwanpVakpGenBUR2tRalUyK09CMTU5TElRTVNiU1E3ZHo4blZRSWhBSURhN2Y4N3RqUXhEeGJKaW8rL3ZKeDIKYXdGYVdudWVHT09RcHZ3Q2NWLysKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=&#34;
      certName: tls.crt
      keyName: tls.key

  # UI configuration
  ui:
    enabled: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Issuer for OpenBao. The syncwave is set to &#39;-1&#39; to create the issuer before the certificate request and the OpenBao deployment.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Certificate for the OpenBao server, with all DNS names and IP addresses used to reach it. The syncwave is set to &#39;0&#39; so the certificate is created after the issuer.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Certificate for the OpenBao Agent Injector, with all DNS names used to reach it. The syncwave is set to &#39;0&#39; so the certificate is created after the issuer.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>OpenBao deployment configuration; the two overrides fullnameOverride and nameOverride are both set to <strong>openbao</strong>. See <a href="/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls/#_step_5_helm_values_for_server_tls">Part 4</a> for more information.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_creating_argo_cd_applications">Creating Argo CD Applications</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Whilst the Helm Charts are ready, we need to create the Argo CD Applications for the CA certificate and the OpenBao deployment.
If you read our blog carefully, you will notice that these Application resources are created automatically when I add something to the folder clusters/management-cluster :)
This is done by leveraging ApplicationSet resources and is fully described in the <a href="/gitopscollection/2023-12-28-gitops-repostructure/" rel="noopener" target="_blank">GitOps Repository Structure</a> and subsequent articles.</p>
</div>
<div class="paragraph">
<p>For the sake of simplicity, I will show the created Application resources below. The setup is the same for both; they simply target a different path in the Git repository.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Full Application resource for the OpenBao CA Certificate
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: in-cluster-openbao-ca-certificate
  namespace: openshift-gitops
spec:
  destination:
    name: in-cluster <i class="conum" data-value="1"></i><b>(1)</b>
    namespace: default <i class="conum" data-value="2"></i><b>(2)</b>
  info:
    - name: Description
      value: ApplicationSet that Deploys on Management Cluster Configuration (using Git Generator)
  project: in-cluster <i class="conum" data-value="3"></i><b>(3)</b>
  source:
    path: clusters/management-cluster/openbao-ca-certificate <i class="conum" data-value="4"></i><b>(4)</b>
    repoURL: &#39;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#39; <i class="conum" data-value="5"></i><b>(5)</b>
    targetRevision: main
  syncPolicy:
    retry:
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 3m
      limit: 5
---
# Full Application resource for the OpenBao deployment
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: in-cluster-openbao
  namespace: openshift-gitops
spec:
  destination:
    name: in-cluster <i class="conum" data-value="1"></i><b>(1)</b>
    namespace: openbao <i class="conum" data-value="2"></i><b>(2)</b>
  info:
    - name: Description
      value: ApplicationSet that Deploys on Management Cluster Configuration (using Git Generator)
  project: in-cluster <i class="conum" data-value="3"></i><b>(3)</b>
  source:
    path: clusters/management-cluster/openbao <i class="conum" data-value="6"></i><b>(6)</b>
    repoURL: &#39;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#39; <i class="conum" data-value="5"></i><b>(5)</b>
    targetRevision: main
  syncPolicy:
    retry:
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 3m
      limit: 5</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Target cluster; here, the local cluster</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Namespace of the target cluster; here, the OpenBao deployment will be installed.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Argo CD Project (must exist)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Path to the Git repository for the CA certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>URL of the Git repository</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Path to the OpenBao deployment</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will create the following Applications:
- in-cluster-openbao-ca-certificate
- in-cluster-openbao</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The ApplicationSet adds the prefix <strong>in-cluster-</strong> to each Application name so that they remain unique in Argo CD.
</td>
</tr>
</tbody></table>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/logos/part5_openbao_argocd.png" alt="OpenBao Argo CD Applications"/>
</div>
<div class="title">Figure 1. Argo CD: OpenBao Argo CD Applications</div>
</div>
<div class="paragraph">
<p>The first Application to synchronise is <strong>in-cluster-openbao-ca-certificate</strong>.</p>
</div>
<div class="paragraph">
<p>It creates the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Namespace</p>
</li>
<li>
<p>CA Issuer</p>
</li>
<li>
<p>CA Certificate</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Then synchronise <strong>in-cluster-openbao</strong>. It creates:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenBao deployment</p>
</li>
<li>
<p>OpenBao Agent Injector</p>
</li>
<li>
<p>OpenBao Server TLS Certificate</p>
</li>
<li>
<p>OpenBao Agent Injector TLS Certificate</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_openbao_is_runningwhat_next">OpenBao is running—what next?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Deploying OpenBao via GitOps gives you version control and declarative management for your secret management infrastructure.</p>
</div>
<div class="paragraph">
<p>Whilst OpenBao is running and managed by Argo CD, the next step is to configure it: you will need to handle initialisation (for a new cluster) and unsealing (see <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a> and <a href="/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls/">Part 4</a>). That manual approach does not scale. In the next article, I will discuss ways to automate initialisation and unsealing.</p>
</div>
<div class="paragraph">
<p>Key takeaways:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Use sync waves to control deployment order</p>
</li>
<li>
<p>Consider auto-unseal for production (Part 6)</p>
</li>
<li>
<p>Store initialisation data securely outside Git</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_resources">Resources</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="/gitopscollection/2024-04-02-configure_app_of_apps/" rel="noopener" target="_blank">Configure App-of-Apps</a></p>
</li>
<li>
<p><a href="https://argo-cd.readthedocs.io/en/stable/user-guide/helm/" rel="noopener" target="_blank">Argo CD Helm Support</a></p>
</li>
<li>
<p><a href="https://argo-cd.readthedocs.io/en/stable/user-guide/sync-waves/" rel="noopener" target="_blank">Argo CD Sync Waves</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.15] OpenShift GitOps - Argo CD Agent</title><link>https://blog.stderr.at/gitopscollection/2026-01-14-argocd-agent/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2026-01-14-argocd-agent/</guid><pubDate>Wed, 14 Jan 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>GitOps</category><category>OpenShift</category><description>Learn how to install and configure the Argo CD Agent for multi-cluster management with OpenShift GitOps using hub and spoke architecture</description><content:encoded><![CDATA[<div class="paragraph">
<p>OpenShift GitOps based on Argo CD is a powerful tool to manage the infrastructure and applications on an OpenShift cluster. Initially, there were two ways of deployment: centralized and decentralized (or distributed). Both methods had their own advantages and disadvantages. The choice was mainly between scalability and centralization.
With OpenShift GitOps v1.19, the Argo CD Agent was finally generally available. This agent tries to solve this problem by bringing the best of both worlds together. In this quite long article, I will show you how to install and configure the Argo CD Agent with OpenShift GitOps using hub and spoke architecture.</p>
</div>
<div class="sect1">
<h2 id="_classic_deployment_models">Classic Deployment Models:</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Prior to the Argo CD Agent, there were two classic and often used deployment models: <strong>centralized</strong> and <strong>decentralized</strong>.</p>
</div>
<div class="sect2">
<h3 id="_centralized_model">Centralized Model</h3>
<div class="paragraph">
<p>In a centralized deployment, all changes are applied to a single, central Argo CD instance, often installed on a management cluster. This is the traditional way of deploying Argo CD, at least in my opinion. With this model, you have a single pane of glass to manage all your clusters. You have a single UI and will see all your clusters in one place, which makes this model very convenient when you have multiple clusters. However, the scalability of this model is limited. Organizations with a huge number of clusters or Argo CD applications would hit some boundaries at some point. A sharding configuration would help, but only to a certain extent. The performance would degrade significantly. In addition, this model creates a Single Point of Failure. If this instance is down, the company loses the ability to manage their clusters through Argo CD.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
I often saw or used this model for the cluster configuration.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_decentralized_model">Decentralized Model</h3>
<div class="paragraph">
<p>In a decentralized deployment, multiple instances of Argo CD, often one for each cluster, are installed. With this approach, the issue with scalability is solved. Moreover, the Single Point of Failure is eliminated as well, since a broken instance will not affect the other instances. However, the disadvantages of this model are that the complexity for the operational teams will increase, since they need to manage multiple instances now. Also, the single pane of glass for management is lost, as there are multiple UIs to manage.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
I often saw or used this model for the application deployment.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_not_so_secret_argo_cd_agent">The - not so secret - Argo CD Agent</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <strong>Argo CD Agent</strong>, released as generally available in OpenShift GitOps v1.19, is a new way to use Argo CD. It tries to solve the challenges of the classic deployment models by combining the best of both worlds. The Agent allows you to have a single UI in a central control plane, while the application controller is distributed across the fleet of clusters. Agents on the different clusters will communicate with the central Argo CD instance.</p>
</div>
<div class="paragraph">
<p>The Agent model introduces a hub and spoke architecture:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Control plane cluster (hub) - The control plane cluster is the central cluster that manages the configuration for multiple spokes.</p>
</li>
<li>
<p>Workload cluster (spoke) - The workload cluster is the cluster that runs the application workloads deployed by Argo CD.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Each Argo CD Agent on a cluster manages the local Argo CD instance and ensures that applications, AppProjects, and secrets remain synchronized with their source of truth.</p>
</div>
<div class="paragraph">
<p>The official documentation describes a comparison between the classic deployment models and the Argo CD Agent: <a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.19/html/argo_cd_agent_architecture/argocd-agent-architecture#gitops-architecture-argocd-agent-comparison_argocd-agent-architecture-overview" rel="noopener" target="_blank">GitOps Architecture - Argo CD Agent Comparison</a></p>
</div>
<div class="sect2">
<h3 id="_argo_cd_agent_modes">Argo CD Agent Modes</h3>
<div class="paragraph">
<p>The Argo CD Agent supports two modes of operation: Managed and Autonomous.
The mode determines where the authoritative source of truth for the Application .spec field resides.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Managed mode — the control plane/hub defines Argo CD applications and their specifications.</p>
</li>
<li>
<p>Autonomous mode — each workload cluster/spoke defines its own Argo CD applications and their specifications.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
A mixed mode is also possible.
</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_managed_mode">Managed Mode</h4>
<div class="paragraph">
<p>Using the managed mode means that the control plane is the source of truth and is responsible for the Argo CD application resources and their distribution across the different workload clusters.
Any change on the hub cluster will be propagated to the spoke clusters. Any changes made on the spoke/workload cluster will be reverted to match the control plane configuration.</p>
</div>
</div>
<div class="sect3">
<h4 id="_autonomous_mode">Autonomous Mode</h4>
<div class="paragraph">
<p>Using this mode, the Argo CD applications are defined on the workload clusters, which serve as their own source of truth. The applications are synchronized back to the control plane for observability.
Changes made on the workload cluster are not reverted, but will appear on the control plane. On the other hand, you cannot modify applications directly from the control plane.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_security">Security</h3>
<div class="paragraph">
<p>The Argo CD Agent uses mTLS certificates to communicate between the hub and the spoke clusters.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The certificate must be created and managed by the user.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_argo_cd_agent_installation">Argo CD Agent Installation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The agent consists of two components that are responsible to synchronize the Argo CD applications between the hub and the spoke clusters.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Principal - Deployed on the control plane cluster together with Argo CD. Here the central UI (and API) can be found.</p>
</li>
<li>
<p>Agent - Deployed on the workload clusters to synchronize the Argo CD applications.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The installation of both is done differently. But before we dive into the installation, let’s have a look at the terminology to understand the different components and their roles.</p>
</div>
<div class="paragraph">
<p>This is a quote from the official documentation (<a href="https://docs.redhat.com/en/documentation/red_hat_openshift_gitops/1.19/html/argo_cd_agent_installation/argocd-agent-installation#gitops-argocd-agent-terminologiest_argocd-agent-installation" rel="noopener" target="_blank">Argo CD Agent Terminologies</a>)</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Principal namespace</strong> - Specifies the namespace where you install the Principal component. This namespace is not created by default, you must create it before adding the resources in this namespace. In Argo CD Agent CLI commands, this value is provided using the --principal-namespace flag.</p>
</li>
<li>
<p><strong>Agent namespace</strong> - Specifies the namespace hosting the Agent component. This namespace is not created by default, you must create it before adding the resources in this namespace. In Argo CD Agent CLI commands, this value is provided using the --agent-namespace flag.</p>
</li>
<li>
<p><strong>Context</strong> - A context refers to a named configuration in the oc CLI that allows you to switch between different clusters. You must be logged in to all clusters and assign distinct context names for the hub and spoke clusters. Examples for cluster names include principal-cluster, hub-cluster, managed-agent-cluster, or autonomous-agent-cluster.</p>
</li>
<li>
<p><strong>Principal context</strong> - The context name you provide for the hub (control plane) cluster. For example, if you log in to the hub cluster and rename its context to principal-cluster, you specify it in Argo CD Agent CLI commands as --principal-context principal-cluster.</p>
</li>
<li>
<p><strong>Agent context</strong> - The context name you provide for the spoke (workload) cluster. For example, if you log in to a spoke cluster and rename its context to autonomous-agent-cluster, you specify it in Argo CD Agent CLI commands as --agent-context autonomous-agent-cluster.</p>
</li>
</ul>
</div>
<div class="sect2">
<h3 id="_a_word_about_the_setup">A Word about the Setup</h3>
<div class="paragraph">
<p>To create some kind of real customer scenario, I have created two clusters:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The cluster where we installed the Principal component. This will be the Hub/Management/Principal cluster (We have too many words for this…​)</p>
</li>
<li>
<p>A separate cluster that will be the Agent cluster. This will be the Spoke/Workload cluster.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The first one I have installed on AWS, and the second one is a Bare Metal Single node cluster. Both can reach each other via the Internet.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
We are using different contexts for the different clusters for the command line. The <strong>argocd-agentctl</strong> tool knows the flags <strong>--principal-context</strong> and <strong>--agent-context</strong> to switch between the different clusters. Be sure to create the resources on the correct cluster.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_prerequisites">Prerequisites</h3>
<div class="paragraph">
<p>Before we start with the installation of the Principal or Agent component, we need to ensure that the following prerequisites are met:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>We have two OpenShift test clusters.</p>
</li>
<li>
<p>Both clusters can reach each other</p>
</li>
<li>
<p>OpenShift GitOps Operator is already installed (possible configuration modifications are described in the following sections)</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Because of my main focus on OpenShift GitOps, we will try to deploy cluster configurations and not just workload. Therefore, the example Argo CD applications will configure cluster settings. (A banner on the top and bottom of the UI)
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configure_openshift_gitops_subscription_on_the_hub_cluster">Configure OpenShift GitOps Subscription on the Hub Cluster</h3>
<div class="paragraph">
<p>The OpenShift GitOps Operator installs by default an Argo CD instance. In this test we will disable this, as we do not need that instance. Moreover and even more important, we need to tell the Operator for which namespaces it should feel responsible for. In this case, we will tell the Operator to be responsible for all namespaces on the cluster.</p>
</div>
<div class="paragraph">
<p>We need to modify the Subscription <strong>openshift-gitops-operator</strong> and add the following environment variables:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  config:
    env:
      - name: DISABLE_DEFAULT_ARGOCD_INSTANCE <i class="conum" data-value="1"></i><b>(1)</b>
        value: &#39;true&#39;
      - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES <i class="conum" data-value="2"></i><b>(2)</b>
        value: &#39;*&#39;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Optional: Disable the default Argo CD instance.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Tell the Operator for which namespaces it should feel responsible for. In this case, all Namespaces. This is important for a namespace-scoped Argo CD instance, which we will install in the next step.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_activate_the_principal_component">Activate the Principal Component</h3>
<div class="paragraph">
<p>To activate the Principal components we first need a cluster (the Hub) where OpenShift GitOps is installed. On this cluster, there might be a running instance of Argo CD already.
However, at this time an existing Argo CD <strong>cannot</strong> be used. Instead, a new Argo CD instance must be created.  (This is because the controller must not be activated)</p>
</div>
<div class="paragraph">
<p>In my case, I will install the Principal component in the namespace <strong>argocd-principal</strong>.</p>
</div>
<div class="paragraph">
<p>To create an Argo CD instance we need to create the following configuration:</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
At this very stage, the principal component must be installed in a separate Argo CD instance, since the controller must not be activated. Therefore we create a new Argo CD instance in a new namespace.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: hub-argocd
  namespace: argocd-principal
spec:
  controller:
    enabled: false <i class="conum" data-value="1"></i><b>(1)</b>
  argoCDAgent:
    principal:
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      auth: &#34;mtls:CN=([^,]+)&#34; <i class="conum" data-value="3"></i><b>(3)</b>
      logLevel: &#34;info&#34;
      namespace:
        allowedNamespaces: <i class="conum" data-value="4"></i><b>(4)</b>
          - &#34;*&#34;
      tls:
        insecureGenerate: false <i class="conum" data-value="5"></i><b>(5)</b>
      jwt:
        insecureGenerate: false
  sourceNamespaces: <i class="conum" data-value="6"></i><b>(6)</b>
    - &#34;argocd-agent-bm01&#34;
  server:
    route:
      enabled: true <i class="conum" data-value="7"></i><b>(7)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Disable the controller component.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enable the Principal component.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Authentication method for the Principal component.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Allowed namespaces for the Principal component.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Insecure generation of the TLS certificate.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Specifies the sourceNamespaces configuration. (Such a list might already exist)</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Enable the Route for the Principal component.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will start a Pod called <strong>hub-gitops-agent-principal</strong> in the namespace <strong>argocd-principal</strong>. However, this pod will <strong>fail</strong> at this moment and that is fine.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Pod hub-gitops-agent-principal is failing with:
{&#34;level&#34;:&#34;info&#34;,&#34;msg&#34;:&#34;Setting loglevel to info&#34;,&#34;time&#34;:&#34;2026-01-19T13:45:57Z&#34;}
time=&#34;2026-01-19T13:45:57Z&#34; level=info msg=&#34;Loading gRPC TLS certificate from secret argocd-principal/argocd-agent-principal-tls&#34;
time=&#34;2026-01-19T13:45:57Z&#34; level=info msg=&#34;Loading root CA certificate from secret argocd-principal/argocd-agent-ca&#34;
time=&#34;2026-01-19T13:45:57Z&#34; level=info msg=&#34;Loading resource proxy TLS certificate from secrets argocd-principal/argocd-agent-resource-proxy-tls and argocd-principal/argocd-agent-ca&#34;
[FATAL]: Error reading TLS config for resource proxy: error getting proxy certificate: could not read TLS secret argocd-principal/argocd-agent-resource-proxy-tls: secrets &#34;argocd-agent-resource-proxy-tls&#34; not found <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The secret is not yet available.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The Pod is failing at the moment because the different secrets for authentication, are not yet available. The Secrets are created in a later step, because some settings, such as the principal hostname and resource proxy service names, are available only after the Red Hat OpenShift GitOps Operator enables the principal component.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>At this point the Operator created the Route object already:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Route: hub-gitops-agent-principal
Hostname: https://hub-gitops-agent-principal-argocd-principal.apps.ocp.aws.ispworld.at
Service: hub-gitops-agent-principal</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_configure_the_appproject">Configure the AppProject</h3>
<div class="paragraph">
<p>If you configured the AppProject with sourceNamespaces, you need to add the following to the AppProject (for example to the <strong>default</strong> AppProject). This must match exactly the namespaces you have created for the Agent.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  sourceNamespaces:
    - &#34;argocd-agent-bm01&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can also use this patch command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc patch appproject default -n argocd-principal --type=&#39;merge&#39; \
  -p &#39;{&#34;spec&#34;: {&#34;sourceNamespaces&#34;: [&#34;argocd-agent-bm01&#34;]}}&#39; --context aws</code></pre>
</div>
</div>
<div class="paragraph">
<p>Restart the Argo CD Pods to apply the changes.</p>
</div>
</div>
<div class="sect2">
<h3 id="_download_argocd_agentctl">Download argocd-agentctl</h3>
<div class="paragraph">
<p>To create the required secrets, we need to download the <strong>argocd-agentctl</strong> tool.</p>
</div>
<div class="paragraph">
<p>This can be found at: <a class="bare" href="https://developers.redhat.com/content-gateway/rest/browse/pub/cgw/openshift-gitops/">https://developers.redhat.com/content-gateway/rest/browse/pub/cgw/openshift-gitops/</a></p>
</div>
<div class="paragraph">
<p>Download and install it for your platform.</p>
</div>
</div>
<div class="sect2">
<h3 id="_create_required_secrets">Create Required Secrets</h3>
<div class="paragraph">
<p>The following steps will create the required secrets for the Principal component. In this example, we will create our own CA and certificates. This is suitable for development and testing purposes. For production environments, you should use certificates issued by your organization’s PKI or a trusted certificate authority.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Use your company’s CA and certificates for production environments.
</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_initialize_the_certificate_authority_ca">Initialize the Certificate Authority (CA)</h4>
<div class="paragraph">
<p>To create a certificate authority (CA) that signs other certificates, we need to run the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl pki init \
    --principal-namespace argocd-principal \ <i class="conum" data-value="1"></i><b>(1)</b>
    --principal-context aws</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The namespace where the Principal component is running.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will initialize the CA and store it in the secret <strong>argocd-principal/argocd-agent-ca</strong>. The certificate looks like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">&#34;Certificate Information:
Common Name: argocd-agent-ca
Subject Alternative Names:
Organization: DO NOT USE IN PRODUCTION
Organization Unit:
Locality:
State:
Country:
Valid From: January 15, 2026
Valid To: January 15, 2036
Issuer: argocd-agent-ca, DO NOT USE IN PRODUCTION
Serial Number: 1 (0x1)&#34;</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="_generate_service_certificate_for_the_principal">Generate Service Certificate for the Principal</h4>
<div class="paragraph">
<p>To generate the server certificate for the Principal’s gRPC service, run the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl pki issue principal \
    --principal-namespace argocd-principal \
    --principal-context aws \
    --dns &#34;&lt;YOUR PRINCIPAL HOSTNAME&gt;&#34; <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The hostname of the Principal service. This must match with the hostname of the Principal’s route (spec.host) or, in case a LoadBalancer Service is used, with .status.loadBalancer.ingress.hostname.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect3">
<h4 id="_generate_the_resource_proxy_certificate">Generate the Resource Proxy Certificate</h4>
<div class="paragraph">
<p>The resource proxy service requires a certificate as well. Since the proxy will run on the same cluster as the Principal, we can use the service name directly.
This is generated by the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl pki issue resource-proxy \
    --principal-namespace argocd-principal \
    --principal-context aws \
    --dns hub-argocd-agent-principal-resource-proxy <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The service name for the resource-proxy. This must match with the service name of the Resource Proxy service.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect3">
<h4 id="_generate_the_jwt_signing_key">Generate the JWT Signing Key</h4>
<div class="paragraph">
<p>Generate the RSA private key for the JWT signing key by running the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl jwt create-key \
    --principal-namespace argocd-principal \
    --principal-context aws</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will generate the RSA private key and store it in the secret <strong>argocd-principal/argocd-agent-jwt</strong>.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_verify_the_principal_component">Verify the Principal Component</h3>
<div class="paragraph">
<p>Now the principal pod should be running successfully.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If the Pod still shows an error, wait a few moments or restart the Pod.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In the logs you should see the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">{&#34;level&#34;:&#34;info&#34;,&#34;msg&#34;:&#34;Setting loglevel to info&#34;,&#34;time&#34;:&#34;2026-01-19T14:09:31Z&#34;}
time=&#34;2026-01-19T14:09:31Z&#34; level=info msg=&#34;Loading gRPC TLS certificate from secret argocd-principal/argocd-agent-principal-tls&#34;
time=&#34;2026-01-19T14:09:31Z&#34; level=info msg=&#34;Loading root CA certificate from secret argocd-principal/argocd-agent-ca&#34;
time=&#34;2026-01-19T14:09:31Z&#34; level=info msg=&#34;Loading resource proxy TLS certificate from secrets argocd-principal/argocd-agent-resource-proxy-tls and argocd-principal/argocd-agent-ca&#34;
time=&#34;2026-01-19T14:09:31Z&#34; level=info msg=&#34;Loading JWT signing key from secret argocd-principal/argocd-agent-jwt&#34;
time=&#34;2026-01-19T14:09:31Z&#34; level=info msg=&#34;Starting argocd-agent (server) v99.9.9-unreleased (ns=argocd-principal, allowed_namespaces=[*])&#34; module=server</code></pre>
</div>
</div>
<div class="paragraph">
<p>This concludes the configuration of the Principal component. There are a lot of steps to create the required secrets, but this is only done once. A GitOps-friendly way to achieve this might be done using a Kubernetes Job (if you consider this as GitOps-friendly…​ which I do).</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_activate_the_agent_component">Activate the Agent Component</h2>
<div class="sectionbody">
<div class="paragraph">
<p>After the Principal component is configured, you can activate one or more Agents (spoke or workload clusters) and connect them with the Hub.</p>
</div>
<div class="paragraph">
<p>The prerequisites are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The Principal component is configured and running.</p>
</li>
<li>
<p>You have access to both the Principal and Agent clusters.</p>
</li>
<li>
<p>The argocd-agentctl CLI tool is installed and accessible from your environment.</p>
</li>
<li>
<p>The helm CLI is installed and configured. Ensure that the helm CLI version is later than v3.8.0.</p>
</li>
<li>
<p>OpenShift GitOps Operator is installed and configured on the Agent cluster.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Yes, a separate Helm Chart will be used to install the Agent component on the target cluster. This time it is not a Chart that I created, but one provided by Red Hat. :)
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_create_agent_secret_on_principal_cluster">Create Agent Secret on Principal Cluster</h3>
<div class="paragraph">
<p>We first need to create an agent on the Principal cluster.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl agent create &#34;argocd-agent-bm01&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  --principal-context &#34;aws&#34; \ <i class="conum" data-value="2"></i><b>(2)</b>
  --principal-namespace &#34;argocd-principal&#34; \ <i class="conum" data-value="3"></i><b>(3)</b>
  --resource-proxy-server &#34;hub-argocd-agent-principal-resource-proxy:9090&#34; <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>A (unique) name for the Agent.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The context name for the Principal cluster. In my case it is &#34;aws&#34;.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The namespace where the Principal component is running.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The resource proxy server URL. This is the URL of the Principal’s resource proxy service including the port (9090).</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will create the secret <strong>cluster-argocd-agent-bm01</strong> with the label <strong>argocd.argoproj.io/secret-type: cluster</strong> in the Argo CD namespace.</p>
</div>
</div>
<div class="sect2">
<h3 id="_create_the_agent_namespace_on_the_agent_cluster">Create the Agent Namespace on the Agent Cluster</h3>
<div class="paragraph">
<p>Be sure that the target namespace on the agent or workload cluster exists. If not, create it first.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create namespace argocd-agent-bm01 --context bm <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The name of the namespace.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_propagate_the_principal_ca_to_the_agent_cluster">Propagate the Principal CA to the Agent Cluster</h3>
<div class="paragraph">
<p>To copy the CA certificate from the principal to the agent cluster the following command is used:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl pki propagate \
    --agent-context bm \ <i class="conum" data-value="1"></i><b>(1)</b>
    --principal-context aws \ <i class="conum" data-value="2"></i><b>(2)</b>
    --principal-namespace argocd-principal \ <i class="conum" data-value="3"></i><b>(3)</b>
    --agent-namespace argocd-agent-bm01 <i class="conum" data-value="4"></i><b>(4)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The context name for the Agent cluster.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The context name for the Principal cluster.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The namespace where the Principal component is running.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The namespace where the Agent component is running.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will copy the CA certificate from the Principal cluster to the Agent cluster into the namespace and secret <strong>argocd-agent-bm01/argocd-agent-ca</strong>.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Only the certificate is copied. The private key is not copied.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_generate_a_client_certificate_for_the_agent">Generate a client certificate for the Agent</h3>
<div class="paragraph">
<p>Now we need to create, based on the imported CA, a client certificate for the Agent. This is done by the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">argocd-agentctl pki issue agent &#34;argocd-agent-bm01&#34; \
    --principal-context &#34;aws&#34; \
    --agent-context &#34;bm&#34; \
    --agent-namespace &#34;argocd-agent-bm01&#34; \
    --principal-namespace &#34;argocd-principal&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create the secret <strong>argocd-agent-client-tls</strong> on the workload cluster, containing a certificate and a key, signed by the CA certificate imported from the Principal cluster.</p>
</div>
</div>
<div class="sect2">
<h3 id="_configure_openshift_gitops_subscription_on_the_spoke_cluster">Configure OpenShift GitOps Subscription on the Spoke Cluster</h3>
<div class="paragraph">
<p>The OpenShift GitOps Operator installs by default an Argo CD instance. In this test we will disable this, as we do not need that instance. Moreover and even more important, we need to tell the Operator for which namespaces it should feel responsible for. In this case, we will tell the Operator to be responsible for all namespaces on the cluster.</p>
</div>
<div class="paragraph">
<p>We need to modify the Subscription <strong>openshift-gitops-operator</strong> and add the following environment variables:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spec:
  config:
    env:
      - name: DISABLE_DEFAULT_ARGOCD_INSTANCE <i class="conum" data-value="1"></i><b>(1)</b>
        value: &#39;true&#39;
      - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES <i class="conum" data-value="2"></i><b>(2)</b>
        value: &#39;*&#39;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Disable the default Argo CD instance.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Tell the Operator for which namespaces it should feel responsible for. In this case, all Namespaces.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_create_argo_cd_instance_on_the_agent_cluster">Create Argo CD Instance on the Agent Cluster</h3>
<div class="paragraph">
<p>To create a minimalistic Argo CD instance on the Agent cluster, we can use the following Argo CD configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1beta1
kind: ArgoCD
metadata:
  name: agent-argocd
  namespace: argocd-agent-bm01 <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  server:
    enabled: false</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The namespace where the Argo CD instance is running. This is also the name of the Agent we have created earlier on the principal cluster.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will create a lightweight Argo CD instance in the namespace <strong>argocd-agent-bm01</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get pod -n argocd-agent-bm01 --context bm
NAME                                            READY   STATUS    RESTARTS   AGE
agent-argocd-application-controller-0       1/1     Running   0          2m49s
agent-argocd-redis-5f6759f6fb-2fdnt         1/1     Running   0          2m49s
agent-argocd-repo-server-7949d97dfd-dsk6b   1/1     Running   0          2m49s</code></pre>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_installing_the_agent">Installing the Agent</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To install the agent we will use a Helm Chart provided by Red Hat. This will install the Agent component on the target cluster.</p>
</div>
<div class="paragraph">
<p>As a reminder, we have two modes of operation for the Agent:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Managed mode</strong> — the control plane/hub defines Argo CD applications and their specifications.</p>
</li>
<li>
<p><strong>Autonomous mode</strong> — each workload cluster/spoke defines its own Argo CD applications and their specifications.</p>
</li>
</ul>
</div>
<div class="sect2">
<h3 id="_create_required_network_policy">Create Required Network Policy</h3>
<div class="paragraph">
<p>Before we start with the actual installation of the Agent, we need to ensure that the Redis instance on the spoke cluster is accessible for the Agent. We need to create a NetworkPolicy accordingly:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: argocd-agent-bm01-redis-network-policy
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/name: agent-argocd-redis <i class="conum" data-value="1"></i><b>(1)</b>
  ingress:
    - ports:
        - protocol: TCP
          port: 6379
      from:
        - podSelector:
            matchLabels:
              app.kubernetes.io/name: argocd-agent-agent
  policyTypes:
    - Ingress</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The name of the Redis instance. The label is based on &lt;instance name&gt;-redis.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply the NetworkPolicy to the spoke cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f network-policy.yaml -n argocd-agent-bm01 --context bm</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_add_the_helm_chart_repository">Add the Helm Chart Repository</h3>
<div class="paragraph">
<p>Add the Helm repository:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm repo add openshift-helm-charts https://charts.openshift.io/
helm repo update</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_install_a_managed_agent_with_the_helm_chart">Install a managed Agent with the Helm Chart</h3>
<div class="paragraph">
<p>Install the agent in the <strong>managed</strong> mode using the Helm Chart. The following parameters are used:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>namespaceOverride</strong> - The namespace where the Agent is running.</p>
</li>
<li>
<p><strong>agentMode</strong> - The mode of the Agent.</p>
</li>
<li>
<p><strong>server</strong> - The server URL of the Principal component. This is the spec.host setting of the Principal’s route.</p>
</li>
<li>
<p><strong>argoCdRedisSecretName</strong> - The name of the Redis secret.</p>
</li>
<li>
<p><strong>argoCdRedisPasswordKey</strong> - The key of the Redis password.</p>
</li>
<li>
<p><strong>redisAddress</strong> - The address of the Redis instance.</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm install redhat-argocd-agent openshift-helm-charts/redhat-argocd-agent \
--set namespaceOverride=argocd-agent-bm01 \
--set agentMode=&#34;managed&#34; \
--set server=&#34;serverURL of principal route&#34; \
--set argoCdRedisSecretName=&#34;agent-argocd-redis-initial-password&#34; \
--set argoCdRedisPasswordKey=&#34;admin.password&#34; \
--set redisAddress=&#34;agent-argocd-redis:6379&#34; \
--kube-context &#34;bm&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>With this chart a pod on the <strong>spoke</strong> cluster will be created and will start to synchronize the Argo CD applications between the hub and the spoke cluster.</p>
</div>
</div>
<div class="sect2">
<h3 id="_verify_the_managed_agent">Verify the Managed Agent</h3>
<div class="paragraph">
<p>To verify the Agent in <strong>managed</strong> mode we need to create an Argo CD Application on the <strong>hub</strong> cluster. We can try the following Application. The Application is taken from the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops" rel="noopener" target="_blank">openshift-clusterconfig-gitops</a> repository and simply adds a banner to the top of the OpenShift UI. I typically use this as a quick test if GitOps is working.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: branding
  namespace: argocd-agent-bm01 <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  destination:
    namespace: default
    server: &#39;https://hub-argocd-agent-principal-resource-proxy:9090?agentName=argocd-agent-bm01&#39; <i class="conum" data-value="2"></i><b>(2)</b>
  project: default
  source:
    path: clusters/management-cluster/branding
    repoURL: &#39;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#39;
    targetRevision: main
  syncPolicy:
    automated:
      prune: true
      selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The namespace of the agent</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The server URL of the Principal component. This is the URL plus the port and the agentName. As an alternative you can also use <strong>name: argocd-agent-bm01</strong> which is the name of the cluster and might be easier to read.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply the Application to the <strong>hub</strong> cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f application.yaml -n argocd-agent-bm01 --context aws</code></pre>
</div>
</div>
<div class="paragraph">
<p>Since the application will try to automatically synchronize the configuration, the status will change to <strong>Synced</strong> after a few seconds:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">status:
  resources:
    - group: console.openshift.io
      kind: ConsoleNotification
      name: topbanner
      status: Synced
      version: v1</code></pre>
</div>
</div>
<div class="paragraph">
<p>and the (top) banner will be visible on the UI:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/agent/banner-top.png" alt="Banner on the top of the UI"/>
</div>
<div class="title">Figure 1. Banner on the top of the UI</div>
</div>
<div class="paragraph">
<p>On the <strong>hub</strong> cluster, the Argo CD Application will be Synced:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get applications --context aws -A
NAMESPACE           NAME                     SYNC STATUS   HEALTH STATUS
argocd-agent-bm01   branding-banner   Synced        Healthy</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_install_an_autonomous_agent_with_the_helm_chart">Install an autonomous Agent with the Helm Chart</h3>
<div class="paragraph">
<p>Let’s cleanup the first installation of the Chart (managed agent) in order to not have any conflicts.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm uninstall redhat-argocd-agent --kube-context &#34;bm&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Install the agent in the <strong>autonomous</strong> mode using the Helm Chart. The following parameters are used:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>namespaceOverride</strong> - The namespace where the Agent is running.</p>
</li>
<li>
<p><strong>agentMode</strong> - The mode of the Agent.</p>
</li>
<li>
<p><strong>server</strong> - The server URL of the Principal component. This is the spec.host setting of the Principal’s route.</p>
</li>
<li>
<p><strong>argoCdRedisSecretName</strong> - The name of the Redis secret.</p>
</li>
<li>
<p><strong>argoCdRedisPasswordKey</strong> - The key of the Redis password.</p>
</li>
<li>
<p><strong>redisAddress</strong> - The address of the Redis instance.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The only difference to the managed mode is the <strong>agentMode</strong> parameter.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm install redhat-argocd-agent-autonomous openshift-helm-charts/redhat-argocd-agent \
--set namespaceOverride=argocd-agent-bm01 \
--set agentMode=&#34;autonomous&#34; \
--set server=&#34;serverURL of principal route&#34; \
--set argoCdRedisSecretName=&#34;agent-argocd-redis-initial-password&#34; \
--set argoCdRedisPasswordKey=&#34;admin.password&#34; \
--set redisAddress=&#34;agent-argocd-redis:6379&#34; \
--kube-context &#34;bm&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>With this chart a pod on the <strong>spoke</strong> cluster will be created and will start to synchronize the Argo CD applications between the hub and the spoke cluster.</p>
</div>
</div>
<div class="sect2">
<h3 id="_verify_the_autonomous_agent">Verify the Autonomous Agent</h3>
<div class="paragraph">
<p>To verify the Agent in <strong>autonomous</strong> mode we need to create an Argo CD Application on the <strong>spoke</strong> cluster.</p>
</div>
<div class="paragraph">
<p>We can try the following Application. It is basically the same as we used for the test for the managed mode, except that this time we will add a banner on the bottom of the UI.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: branding-bottom-banner
  namespace: argocd-agent-bm01 <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  destination:
    namespace: default
    server: &#39;https://kubernetes.default.svc&#39; <i class="conum" data-value="2"></i><b>(2)</b>
  project: default
  source:
    path: clusters/management-cluster/branding-bottom
    repoURL: &#39;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#39;
    targetRevision: main
  syncPolicy:
    automated:
      prune: true
      selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The namespace of the agent</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The server URL of the local cluster, since in autonomous mode the application is managed locally.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply the Application to the <strong>spoke</strong> cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f application.yaml -n argocd-agent-bm01 --context bm</code></pre>
</div>
</div>
<div class="paragraph">
<p>Like the managed mode, the status will change to <strong>Synced</strong> after a few seconds and the (this time) bottom banner will be visible on the UI:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/agent/banner-bottom.png" alt="Banner on the bottom of the UI"/>
</div>
<div class="title">Figure 2. Banner on the bottom of the UI</div>
</div>
<div class="paragraph">
<p>Moreover, the Argo CD Application will appear on the <strong>hub</strong> cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get applications --context aws -A
NAMESPACE           NAME                     SYNC STATUS   HEALTH STATUS
argocd-agent-bm01   branding-bottom-banner   Synced        Healthy
argocd-agent-bm01   branding-banner          Synced        Healthy</code></pre>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_troubleshooting">Troubleshooting</h2>
<div class="sectionbody">
<div class="paragraph">
<p>During the installation and configuration of the Argo CD Agent, you might encounter some issues. Here are some issues I encountered during the tests:</p>
</div>
<div class="sect2">
<h3 id="_principal_pod_fails_to_start">Principal Pod Fails to Start</h3>
<div class="paragraph">
<p>If the Principal pod fails to start with errors about missing secrets, verify that all required secrets have been created:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get secrets -n argocd-principal | grep argocd-agent</code></pre>
</div>
</div>
<div class="paragraph">
<p>You should see the following secrets:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>argocd-agent-ca</strong> - The CA certificate</p>
</li>
<li>
<p><strong>argocd-agent-principal-tls</strong> - The Principal’s TLS certificate</p>
</li>
<li>
<p><strong>argocd-agent-resource-proxy-tls</strong> - The Resource Proxy’s TLS certificate</p>
</li>
<li>
<p><strong>argocd-agent-jwt</strong> - The JWT signing key</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If any of these are missing, re-run the corresponding <code>argocd-agentctl</code> command to create them.</p>
</div>
</div>
<div class="sect2">
<h3 id="_redis_errors_in_the_principal_pod">Redis Errors in the Principal Pod</h3>
<div class="paragraph">
<p>When you see errors like the following in the logs of the Principal pod, ensure that the Argo CD instance does not have the controller enabled in that namespace (set <code>spec.controller.enabled: false</code>). Hopefully, this will change in the future.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">time=&#34;2026-01-20T04:57:10Z&#34; level=error msg=&#34;unexpected lack of &#39;_&#39; namespace/name separate: &#39;app|managed-resources|branding|1.8.3&#39;&#34; connUUID=3c13b30b-9f84-4af6-93d8-e1c03c4c7898 function=redisFxn module=redisProxy</code></pre>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_limitations">Limitations</h2>
<div class="sectionbody">
<div class="paragraph">
<p>While the Argo CD Agent brings significant improvements, there are some limitations to be aware of:</p>
</div>
<div class="sect2">
<h3 id="_separate_argo_cd_instance_required">Separate Argo CD Instance Required</h3>
<div class="paragraph">
<p>Currently, the Principal component <strong>cannot</strong> be installed alongside an existing Argo CD instance where the application controller is enabled. You must create a separate Argo CD instance with the controller disabled (<code>spec.controller.enabled: false</code>). To me, this is one of the biggest limitations. However, this will be addressed in the future and is tracked in the issue: <a class="bare" href="https://github.com/argoproj-labs/argocd-agent/issues/708">https://github.com/argoproj-labs/argocd-agent/issues/708</a></p>
</div>
</div>
<div class="sect2">
<h3 id="_manual_certificate_management">Manual Certificate Management</h3>
<div class="paragraph">
<p>The mTLS certificates must be created and managed manually by the user. There is no automatic certificate rotation or renewal. For production environments, you should integrate with your organization’s PKI infrastructure and implement a certificate rotation strategy.</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Argo CD Agent provides a powerful solution for managing multiple clusters with Argo CD. By combining the benefits of centralized management with distributed application controllers, it addresses the scalability and single point of failure challenges of traditional deployment models.</p>
</div>
<div class="paragraph">
<p>While the initial setup requires several steps, especially around certificate management, the resulting architecture offers a robust foundation for GitOps at scale.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>GitOps Catalog</title><link>https://blog.stderr.at/whats-new/2025-12-23-gitops-catalog/</link><guid isPermaLink="true">https://blog.stderr.at/whats-new/2025-12-23-gitops-catalog/</guid><pubDate>Mon, 22 Dec 2025 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>GitOps</category><description>Interactive catalog of all available ArgoCD applications for OpenShift cluster configuration</description><content:encoded><![CDATA[<div class="paragraph">
<p>The <a href="/gitops-catalog/">GitOps Catalog</a> page provides an interactive visualization of all available ArgoCD applications from the openshift-clusterconfig-gitops repository. Check out the page <strong><a href="/gitops-catalog/">GitOps Catalog</a></strong> for more details.</p>
</div>
]]></content:encoded></item><item><title>Helm Charts Repository Updates</title><link>https://blog.stderr.at/whats-new/2025-12-12-helm-charts-changelog/</link><guid isPermaLink="true">https://blog.stderr.at/whats-new/2025-12-12-helm-charts-changelog/</guid><pubDate>Fri, 12 Dec 2025 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>GitOps</category><category>Other</category><description>Latest updates and changes to the stderr.at Helm Charts collection for OpenShift and Kubernetes</description><content:encoded><![CDATA[<div class="paragraph">
<p>This page shows the <strong>latest updates</strong> to the <a href="https://blog.stderr.at/helm-charts">stderr.at Helm Charts Repository</a>.
The charts are designed for OpenShift and Kubernetes deployments, with a focus on GitOps workflows using Argo CD.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The content below is dynamically loaded from the Helm repository and always shows the most recent changes.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">



<div id="helm-changelog-widget" class="helm-changelog" data-limit="10">
  <div class="helm-changelog-loading">
    <i class="fa fa-spinner fa-spin"></i> Loading latest Helm chart updates...
  </div>
</div>

<style>

</style>

<script defer src="/js/inline/helm-changelog.68008be7b909db146f4e9b677faf605681c58eb4d32c22fa20639af4109ae5a3.js"></script>

</div>
<div class="sect1">
<h2 id="_quick_links">Quick Links</h2>
<div class="sectionbody">
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;"/>
<col style="width: 66.6667%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Resource</th>
<th class="tableblock halign-left valign-top">Link</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Helm Repository</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a class="bare" href="https://charts.stderr.at/">https://charts.stderr.at/</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">GitHub Source</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a class="bare" href="https://github.com/tjungbauer/helm-charts">https://github.com/tjungbauer/helm-charts</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ArtifactHub</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a class="bare" href="https://artifacthub.io/packages/search?repo=tjungbauer">https://artifacthub.io/packages/search?repo=tjungbauer</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Example GitOps Repo</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a class="bare" href="https://github.com/tjungbauer/openshift-clusterconfig-gitops">https://github.com/tjungbauer/openshift-clusterconfig-gitops</a></p></td>
</tr>
</tbody>
</table>
</div>
</div>]]></content:encoded></item><item><title>[Ep.14] Reusable Argo CD Application Template</title><link>https://blog.stderr.at/gitopscollection/2025-07-17-common-template-application/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2025-07-17-common-template-application/</guid><pubDate>Thu, 17 Jul 2025 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Build a reusable Argo CD Application Helm template for OpenShift GitOps so teams share one pattern for sync waves, hooks and project defaults.</description><content:encoded><![CDATA[<div class="paragraph">
<p>When working with Argo CD at scale, you often find yourself creating similar Application manifests repeatedly. Each application needs the same basic structure but with different configurations for source repositories, destinations, and sync policies. Additionally, managing namespace metadata becomes tricky when you need to conditionally control whether Argo CD should manage namespace metadata based on sync options.</p>
</div>
<div class="paragraph">
<p>In this article, I’ll walk you through a reusable Helm template that solves these challenges by providing a flexible, DRY (Don’t Repeat Yourself) approach to creating Argo CD Applications. This template is available in my public Helm Chart library and can easily be used by anyone.</p>
</div>
<div class="sect1">
<h2 id="_the_problem">The Problem</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Traditional Argo CD Application manifests suffer from several issues:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Repetitive Code</strong>: Each application requires similar boilerplate YAML</p>
</li>
<li>
<p><strong>Configuration Validation</strong>: Manual validation of required fields across multiple applications</p>
</li>
<li>
<p><strong>Maintenance Overhead</strong>: Changes to common patterns require updates across multiple files</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_but_i_can_do_this_manually_right">But I can do this manually, right?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Of course, nobody prevents you from creating an Argo CD Application manifest manually or using the UI to enter the values there, but sometimes you just want to get things done faster or help your team with a consistent way to create Argo CD Applications. Often teams do not want to learn about a new tool like Argo CD and maybe you want to automate the creation by using a CI/CD pipeline.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_solution_a_reusable_helm_template">The Solution: A Reusable Helm Template</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I already work with a common template library for all of my Helm Charts. The idea is to have repeatable snippets in my tpl charts and I can reuse them in all other charts. Recently, I started testing the templating of entire Kubernetes manifests.</p>
</div>
<div class="paragraph">
<p>To address the above issues, I’ve created a comprehensive Helm template that will render an Argo CD Application. But let’s start with the end result.
Your team wants to create a new Argo CD Application. They can do this either via the UI, via the CLI, by creating the YAML file manually, or through pull request or CI/CD integration. Ultimately, the minimum required information is:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The name of the application</p>
</li>
<li>
<p>The namespace of the application</p>
</li>
<li>
<p>The source repository</p>
</li>
<li>
<p>The destination repository</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>So something like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">argocd_applications:
  my-app: <i class="conum" data-value="1"></i><b>(1)</b>
    namespace: &#34;openshift-gitops&#34;

    source: <i class="conum" data-value="2"></i><b>(2)</b>
      repositoryURL: &#34;https://github.com/argoproj/argocd-example-apps.git&#34;
      targetRevision: &#34;HEAD&#34;
      path: &#34;guestbook&#34;

    destination: <i class="conum" data-value="3"></i><b>(3)</b>
      server: &#34;https://kubernetes.default.svc&#34; <i class="conum" data-value="4"></i><b>(4)</b>
      namespace: &#34;guestbook&#34;

  my-second-app:
    ....</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>This key will become the name of the Application</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The source repository, this is the repository that contains the Helm chart or the Kubernetes manifests</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The destination, that defines the cluster and namespace where the application will be deployed</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Either <strong>server</strong> or <strong>name</strong> must be set, but not both.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>With the above values multiple applications can be created at once.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_integrating_the_template">Integrating the Template</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The values from the above example can be used to create the Application manifest.</p>
</div>
<div class="paragraph">
<p>All the developers (or CI/CD pipelines) need to do is to define the values and create one template to include the source template.
This will look like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">{{- if .Values.argocd_applications }}
{{- range $name, $config := .Values.argocd_applications }} <i class="conum" data-value="1"></i><b>(1)</b>
{{- if $config.enabled | default false }} <i class="conum" data-value="2"></i><b>(2)</b>
---
{{- include &#34;tpl.argocdApplication&#34; (dict &#34;name&#34; $name &#34;spec&#34; $config) -}} <i class="conum" data-value="3"></i><b>(3)</b>
{{- end }}
{{- end }}
{{- end }}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Iterate over the applications, defining $name and $config</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Only include the application if it is enabled</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Include the template with the name of the application and the specification</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This is everything you need to do to create an Argo CD Application. Let’s take a look at the template.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_key_features_of_the_template">Key Features of the template</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_1_flexible_destination_configuration">1. Flexible Destination Configuration</h3>
<div class="paragraph">
<p>The template supports both server URL and cluster name destinations with <strong>validation</strong>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">destination:
  {{- if and ($spec.destination.server) ($spec.destination.name) }}
  {{ fail &#34;destination.server and destination.name cannot be set at the same time&#34; }}
  {{- else }}
  {{- if $spec.destination.server }}
  server: {{ $spec.destination.server }}
  {{- else if $spec.destination.name }}
  name: {{ $spec.destination.name }}
  {{- else }}
  server: https://kubernetes.default.svc
  {{- end }}
  {{- end }}
  namespace: {{ $spec.destination.namespace | required &#34;destination.namespace is required&#34; }}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_2_comprehensive_sync_policy_support">2. Comprehensive Sync Policy Support</h3>
<div class="paragraph">
<p>The template handles all Argo CD sync policy features:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Automated sync with prune, selfHeal, and allowEmpty options</p>
</li>
<li>
<p>Flexible sync options array</p>
</li>
<li>
<p>Retry configuration with backoff strategies</p>
</li>
<li>
<p>Conditional managed namespace metadata</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_3_conditional_namespace_management">3. Conditional Namespace Management</h3>
<div class="paragraph">
<p>The intelligent handling of <code>managedNamespaceMetadata</code>. The template only includes this section when it <strong>CreateNamespace=</strong> option is set to true:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">{{- if and $spec.syncPolicy.syncOptions (not (has &#34;CreateNamespace=false&#34; $spec.syncPolicy.syncOptions)) }}
{{- if $spec.syncPolicy.managedNamespaceMetadata }}
managedNamespaceMetadata:
  {{- with $spec.syncPolicy.managedNamespaceMetadata.labels }}
  labels:
    {{- toYaml . | nindent 8 }}
  {{- end }}
  {{- with $spec.syncPolicy.managedNamespaceMetadata.annotations }}
  annotations:
    {{- toYaml . | nindent 8 }}
  {{- end }}
{{- end }}
{{- end }}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_4_other_features">4. Other Features</h3>
<div class="paragraph">
<p>I created the template to be as flexible as possible. However, I did not include everything in this template, only the most important features (from my point of view). Currently, the following is possible:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Create a template for an Argo CD Application using Git</p>
</li>
<li>
<p>Create a template for an Argo CD Application using Helm defining all possible Helm parameters, like additional values files or other options.</p>
</li>
<li>
<p>Using a <strong>single</strong> source</p>
</li>
<li>
<p>Set required annotations and labels</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_5_not_possible_currently">5. Not possible (currently)</h3>
<div class="paragraph">
<p>Along with the supported features, there are some features that are currently not possible:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Defining multiple sources</p>
</li>
<li>
<p>Configure Kustomize settings</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>However, if you feel this needs to be added, please let me know and create an issue. I can then try to add it.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_this_approach_works">Why This Approach Works</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_1_dry_principle">1. DRY Principle</h3>
<div class="paragraph">
<p>Instead of repeating the same YAML structure across multiple applications, you define it once and reuse it everywhere.</p>
</div>
</div>
<div class="sect2">
<h3 id="_2_intelligent_defaults">2. Intelligent Defaults</h3>
<div class="paragraph">
<p>The template provides sensible defaults (like <code>openshift-gitops</code> namespace) while allowing customization when needed.</p>
</div>
</div>
<div class="sect2">
<h3 id="_3_validation">3. Validation</h3>
<div class="paragraph">
<p>Built-in validation ensures required fields are present and conflicting configurations are caught early.</p>
</div>
</div>
<div class="sect2">
<h3 id="_4_conditional_logic">4. Conditional Logic</h3>
<div class="paragraph">
<p>The template handles complex scenarios like namespace management automatically, reducing the chance of misconfigurations.</p>
</div>
</div>
<div class="sect2">
<h3 id="_real_world_benefits">Real-World Benefits</h3>
<div class="paragraph">
<p>In practice, this template has several advantages:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Consistency</strong>: All applications follow the same pattern</p>
</li>
<li>
<p><strong>Maintainability</strong>: Changes to common patterns are made in one place</p>
</li>
<li>
<p><strong>Safety</strong>: Validation prevents common misconfigurations</p>
</li>
<li>
<p><strong>Flexibility</strong>: Supports the full range of Argo CD features</p>
</li>
<li>
<p><strong>Development Guidelines</strong>: Ensure all developers are using the same process</p>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_real_world_examples">Real-World Examples</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_1_define_a_ui_branding">1. Define a UI Branding</h3>
<div class="paragraph">
<p>I would like to define a top banner in the OpenShift Console.
Everything is defined in the <code>clusters/management-cluster/branding</code> folder in my git repository.</p>
</div>
<div class="paragraph">
<p>All I need to do is to define the following values:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">argocd_applications:
  my-branding:

    enabled: true
    namespace: &#34;openshift-gitops&#34;

    source:
      repositoryURL: &#34;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#34;
      targetRevision: &#34;main&#34;
      path: &#34;clusters/management-cluster/branding&#34;

    destination:
      name: in-cluster
      namespace: &#34;default&#34;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_2_define_a_ui_branding_with_custom_helm_value">2. Define a UI Branding with custom Helm value</h3>
<div class="paragraph">
<p>Like above I would like to define a top banner in the OpenShift Console. This time I want to use a custom Helm value to define the background color of the banner.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">argocd_applications:
  my-branding-custom-helm:

    enabled: true
    namespace: &#34;openshift-gitops&#34;

    source:
      repositoryURL: &#34;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#34;
      targetRevision: &#34;main&#34;
      path: &#34;clusters/management-cluster/branding&#34;

      helm:
        parameters:
          - name: generic-cluster-config.console.console_banners.topbanner.backgroundcolor
            value: &#39;#FF9843&#39;

    destination:
      name: in-cluster
      namespace: &#34;default&#34;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_3_full_blown_example">3. Full-Blown Example</h3>
<div class="paragraph">
<p>A full example with all features can be found in my Git repository at: <a href="https://github.com/tjungbauer/helm-charts/blob/main/charts/tpl/values_example_ArgoCD-Application.yaml" rel="noopener" target="_blank">values_example_ArgoCD-Application.yaml</a></p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_about_validation">What about Validation?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Above I mentioned that the template is able to validate the values.
This is true for the most important parts.</p>
</div>
<div class="paragraph">
<p>For example, try to define the following values:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">[...]
    destination:
      name: in-cluster
      server: &#34;https://kubernetes.default.svc&#34;
      namespace: &#34;default&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>name</strong> and <strong>server</strong> are not allowed to be set at the same time.</p>
</div>
<div class="paragraph">
<p>Helm (and Argo CD which is using Helm) will validate the values and fail with an error.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">Error: destination.server and destination.name cannot be set at the same time</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This Argo CD Application template demonstrates how Helm’s templating capabilities can solve real-world GitOps challenges. By combining conditional logic, validation, and sensible defaults, we create a tool that’s both powerful and easy to use.</p>
</div>
<div class="paragraph">
<p>The conditional namespace management feature alone saves hours of debugging why Argo CD isn’t behaving as expected with namespace metadata. When you combine this with the DRY benefits and built-in validation, you get a robust foundation for managing Argo CD applications at scale.</p>
</div>
<div class="paragraph">
<p>Whether you’re managing a few applications or hundreds, this template pattern will help you maintain consistency, reduce errors, and improve your team’s GitOps experience.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.13] ApplicationSet with Matrix Generator</title><link>https://blog.stderr.at/gitopscollection/2025-04-17-applicationset-defining-namespaces/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2025-04-17-applicationset-defining-namespaces/</guid><pubDate>Thu, 17 Apr 2025 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Using ApplicationSet with Matrix Generator and define individual Namespaces.</description><content:encoded><![CDATA[<div class="paragraph">
<p>During my day-to-day business, I am discussing the following setup with many customers: <a href="https://blog.stderr.at/gitopscollection/2024-04-02-configure_app_of_apps/">Configure App-of-Apps</a>. Here I try to explain how I use an ApplicationSet that watches over a folder in Git and automatically adds a new Argo CD Application whenever a new folder is found. This works great, but there is a catch: The ApplicationSet uses the same Namespace <strong>default</strong> for all Applications. This is not always desired, especially when you have different teams working on different Applications.</p>
</div>
<div class="paragraph">
<p>Recently I was asked by the customer if this can be fixed and if it is possible to define different Namespaces for each Application. The answer is yes, and I would like to show you how to do this.</p>
</div>
<div class="sect1">
<h2 id="_the_current_situation">The Current Situation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Currently, I am (or was) using the following ApplicationSet to watch over a folder in Git. The ApplicationSet uses the Matrix Generator to create a new Argo CD Application for each folder found in the Git repository. It also uses the list operator to define the targetCluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    generatormatrix:
          # Git: Walking through the specific folder and take whatever is there.
          - git:
              directories:
                - path: clusters/management-cluster/*
              repoURL: *repourl
              revision: *branch
          # List: simply define the targetCluster. The name of the cluster must be known by Argo CD
          - list:
              elements:
                  # targetCluster is important, this will define on which cluster it will be rolled out.
                  # The cluster name must be known in Argo CD
                - targetCluster: *mgmtclustername</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create a new Application for any subfolder found in the <strong>clusters/management-cluster/</strong> folder any every Application in Argo CD will be configured with the same target namespace: <strong>default</strong>.</p>
</div>
<div class="paragraph">
<p>Technically, this is not a problem, as I define the exact namespace in the different Helm Charts, but it is not always desired.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
I personally recommend defining the Namespace in the Helm Charts, since especially for the cluster configuration, sometimes there is no clear target Namespace or multiple Namespaces are modified.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_did_not_work">What did not work</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The first idea was to use the <strong>Matrix</strong> generator and define the <strong>targetNamespace</strong> in list.elements and if the namespace is not defined, use a default one. So similar like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    generatormatrix:
          # Git: Walking through the specific folder and take whatever is there.
          - git:
              directories:
                - path: clusters/management-cluster/*
              repoURL: *repourl
              revision: *branch
          # List: simply define the targetCluster. The name of the cluster must be known by Argo CD
          - list:
              elements:
                  # targetCluster is important, this will define on which cluster it will be rolled out.
                  # The cluster name must be known in Argo CD
                - targetCluster: *mgmtclustername
                  path: clusters/management-cluster/cert-manager
                  targetNamespace: cert-manager
                - targetCluster: *mgmtclustername
                  path: clusters/management-cluster/*
                  targetNamespace: default</code></pre>
</div>
</div>
<div class="paragraph">
<p>To make is short: <strong>This does not work</strong></p>
</div>
<div class="paragraph">
<p>The matrix operator walks over all folders and creates a cartesian product of the elements. This means, it will create a new Application for each folder and each element in the list. So if you have 10 folders and 2 elements in the list, you will end up with 20 Applications.
This is not what we want. We want to create a new Application for each folder and define the targetNamespace in the Git repository.</p>
</div>
<div class="paragraph">
<p>The second test was the use of the <strong>Merge</strong> generator. This did not work as well, as it was not possible to define a default Namespace.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_solution">The Solution</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The solution is to use the <strong>Git FILES</strong> generator and define the <strong>targetNamespace</strong> in the Git repository. This is done by creating a file called <strong>config.json</strong> in each subfolder. The content of the file is simple:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
  &#34;namespace&#34;: &#34;default&#34;,
  &#34;environment&#34;: &#34;in-cluster&#34;
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The advantage is that it is possible to define multiple parameters in that file. However, the disadvantage is that this file must be created, otherwise the ApplicationSet will ignore the folder and will not create a new Application.
I think this is a small disadvantage, and the file is easy to maintain.</p>
</div>
<div class="paragraph">
<p>Bringing everything together now opens two possibilities:</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
This will require <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-argocd">helper-argocd</a> version 2.0.41 or higher.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_option_1_keep_matrix_generator_and_use_git_file_sub_generator">Option 1: Keep Matrix Generator and use Git File sub-generator</h3>
<div class="paragraph">
<p>The first option simply replaces the git directory generator with the git file generator. The rest of the ApplicationSet remains unchanged.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
I like this option somehow better than the second one, because I can keep everything as I had it before, the only thing is to create the <strong>config.json</strong> file in each subfolder and change two lines in the ApplicationSet.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    # Switch to set the namespace to &#39;.namespace&#39; ... must be defined in config.json
    use_configured_namespace: true <i class="conum" data-value="1"></i><b>(1)</b>

    # Definition of Matrix Generator. Only 2 generators are supported at the moment
    generatormatrix:
      # Git: Walking through the specific folder and take whatever is there.
      - git:
          files: <i class="conum" data-value="2"></i><b>(2)</b>
            - path: clusters/management-cluster/**/config.json <i class="conum" data-value="3"></i><b>(3)</b>
          repoURL: *repourl
          revision: *branch
      # List: simply define the targetCluster. The name of the cluster must be known by Argo CD
      - list:
          elements:
              # targetCluster is important, this will define on which cluster it will be rolled out.
              # The cluster name must be known in Argo CD
            - targetCluster: *mgmtclustername</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Switch to use the configured namespace. This is important, otherwise the namespace is set to &#34;default&#34;. This was added for backward compatibility.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The git file generator is used instead of the git directory generator.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The path is changed to the config.json file. The ** is important, as it defines to look into every subfolder.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The config.json can be shortened to:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
  &#34;namespace&#34;: &#34;default&#34;
}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_option_2_switch_to_plain_git_file_generator">Option 2: Switch to plain Git File Generator</h3>
<div class="paragraph">
<p>The second option is to switch to the plain Git generator. This removes the Matrix generator, but also requires defining the targetCluster in the config.json file. This is not a problem, as the config.json file can be used to define multiple parameters.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    generatorgit: <i class="conum" data-value="1"></i><b>(1)</b>
      # Git: Walking through the specific folder and take whatever is there.
      - files:
          - clusters/management-cluster/**/config.json
        repourl: *repourl
        revision: *branch</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>No Matrix but Git generator instead.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Here the full config.json file is required, otherwise the targetCluster is not defined:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
  &#34;namespace&#34;: &#34;default&#34;,
  &#34;environment&#34;: &#34;in-cluster&#34;
}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_full_working_example">Full working example</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Source: <a class="bare" href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/base/argocd-resources-manager/values.yaml">https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/base/argocd-resources-manager/values.yaml</a></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">applicationsets:
  ######################################
  # MATRIX GENERATOR EXAMPLE Git Files #
  ######################################
  # The idea behind the GIT Generate (File) is to walk over a folder, for example /clusters/management-cluster and fetch a config.json from each folder.
  # This is more or less similar as the Matrix generator (see below), but reqires a bit more configuration ... the config.json.
  # The advantage is that you can configure individual namespaces for example in this config.json and provide an additional information
  mgmt-cluster-matrix-gitfiles:
    enabled: true

    # Description - always usful
    description: &#34;ApplicationSet that Deploys on Management Cluster Configuration (using Git Generator)&#34;
    # Any labels you would like to add to the Application. Good to filter it in the Argo CD UI.
    labels:
      category: configuration
      env: mgmt-cluster

    # Using go text template. See: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/GoTemplate/
    goTemplate: true
    argocd_project: *mgmtclustername

    environment: *mgmtclustername

    # preserve all resources when the application get deleted. This is useful to keep that workload even if Argo CD is removed or severely changed.
    preserveResourcesOnDeletion: true

    # Switch to set the namespace to &#39;.namespace&#39; ... must be defined in config.json
    use_configured_namespace: true

    # Definition of Matrix Generator. Only 2 generators are supported at the moment
    generatormatrix:
      # Git: Walking through the specific folder and take whatever is there.
      - git:
          files:
            - path: clusters/management-cluster/**/config.json
          repoURL: *repourl
          revision: *branch
      # List: simply define the targetCluster. The name of the cluster must be known by Argo CD
      - list:
          elements:
              # targetCluster is important, this will define on which cluster it will be rolled out.
              # The cluster name must be known in Argo CD
            - targetCluster: *mgmtclustername

    syncPolicy:
      autosync_enabled: false

    # Retrying in case the sync failed.
    retries:
      # number of failed sync attempt retries; unlimited number of attempts if less than 0
      limit: 5
      backoff:
        # the amount to back off. Default unit is seconds, but could also be a duration (e.g. &#34;2m&#34;, &#34;1h&#34;)
        # Default: 5s
        duration: 5s
        # a factor to multiply the base duration after each failed retry
        # Default: 2
        factor: 2
        # the maximum amount of time allowed for the backoff strategy
        # Default: 3m
        maxDuration: 3m</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this blog post I have shown you how to use the ApplicationSet with the Matrix generator and define individual Namespaces for each Application. This is done by using the Git File generator and defining a config.json file in each subfolder. The config.json file can be used to define multiple parameters, but it is required to create the file in each subfolder.
This is a small disadvantage, but I think it is worth the effort. The advantage is that you can define individual Namespaces for each Application, and you can use the same ApplicationSet for all your Applications.</p>
</div>
<div class="paragraph">
<p>I hope this blog post was helpful and you learned something new. If you have any questions or comments, please feel free to reach out to me.
I am happy to help you.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.12] Using Kustomize Post-Renderer</title><link>https://blog.stderr.at/gitopscollection/2024-10-13-using-post-renderer/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-10-13-using-post-renderer/</guid><pubDate>Sun, 13 Oct 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Post-render Helm charts with Kustomize in OpenShift GitOps/Argo CD when you need last-mile patches without forking the upstream chart.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Lately I came across several issues where a given Helm Chart must be modified after it has been rendered by Argo CD.
Argo CD does a <strong>helm template</strong> to render a Chart. Sometimes, especially when you work with Subcharts or when a specific setting is not yet supported by the Chart, you need to modify it later …​ you need to post-render the Chart.</p>
</div>
<div class="paragraph">
<p>In this very short article, I would like to demonstrate this on a real-live example I had to do. I would like to inject annotations to a Route objects, so that the certificate can be injected. This is done by the cert-utils operator.
For the post-rendering the Argo CD repo pod will be extended with a sidecar container, that is watching for the repos and patches them if required.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Everything below is using OpenShift Gitops Operator. This is based on Argo CD, but instead of directly modifying the repo Deployment, we will modify the Argo CD Custom Resource.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In the future it will be easier to inject certificates into a Route, by defining a Secret. This as currently a TechPreview feature (OpenShift 4.17). <a href="https://docs.openshift.com/container-platform/4.17/networking/routes/secured-routes.html#nw-ingress-route-secret-load-external-cert_secured-routes" rel="noopener" target="_blank">Creating a route with externally managed certificate
</a>
</td>
</tr>
</tbody></table>
</div>
<div class="sect1">
<h2 id="_the_route_object">The Route Object</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Imagine we have the following Route object, rendered via Helm template:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: my-route
  namespace: my-namespace
spec:
  host: my.route.apps.cluster.name
  port:
    targetPort: http
  tls:
    insecureEdgeTerminationPolicy: Redirect
    termination: edge
  to:
    kind: Service
    name: my-service
    weight: 100
  wildcardPolicy: None</code></pre>
</div>
</div>
<div class="paragraph">
<p>The cert-manager Operator requested a certificate which can be found in the Secret &#34;my-certificate &#34;.
To let the cert-utils Operator inject the data from the certificate automatically, we need to add annotations to that Route object.</p>
</div>
<div class="paragraph">
<p>This injection is usually a good idea, since we do not want to define certificate and (private) key directly in the Route object using our Chart.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: route.openshift.io/v1
kind: Route
metadata:
  annotations: <i class="conum" data-value="1"></i><b>(1)</b>
    cert-manager.io/cluster-issuer: my-issuer
    cert-utils-operator.redhat-cop.io/certs-from-secret: my-certificate</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Two annotations shall be added to the Route object.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In this example certificates have to be ordered. No wildcard certificate is available.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_post_rendering">Post-Rendering</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To modify the output after it has been rendered by Argo CD we will use <strong>Kustomize patch feature</strong>. This means, after the template has been rendered, we send it to Kustomize and let it patch it.</p>
</div>
<div class="paragraph">
<p>Let’s go through the steps one-by-one:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Create a kustomization.yaml
Place the following file next to your Chart.yaml</p>
</li>
</ol>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: my-namespace

resources:
  - ./all.yaml <i class="conum" data-value="1"></i><b>(1)</b>

patches:
  - patch: |
      - op: add  <i class="conum" data-value="2"></i><b>(2)</b>
        path: /metadata/annotations
        value:
          cert-manager.io/cluster-issuer: my-issuer
          cert-utils-operator.redhat-cop.io/certs-from-secret: my-certificate
    target:
      kind: Route
      name: my-route <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The all.yaml file will be created by the helm template command.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Add the annotations to the Route object.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The name of the Route object.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will patch the Route object. You can test this locally by execute the command:
<strong>helm template . &gt; all.yaml &amp;&amp; kustomize build &amp;&amp; rm all.yaml</strong></p>
</div>
<div class="olist arabic">
<ol class="arabic" start="2">
<li>
<p>Create an empty file called <strong>my-cmp-plugin</strong> into the folder next to the Chart.yaml
I will explain in a bit why I chose to use this approach.</p>
</li>
<li>
<p>Create the following ConfigMap in the OpenShift GitOps namespace (for example openshift-gitops)</p>
</li>
</ol>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: ConfigMap
apiVersion: v1
metadata:
  name: my-cmp-plugin
  namespace: openshift-gitops
data:
  plugin.yaml: |-
    apiVersion: argoproj.io/v1alpha1
    kind: ConfigManagementPlugin
    metadata:
      name: my-cmp-plugin <i class="conum" data-value="1"></i><b>(1)</b>
    spec:
      version: v1.0
      init: <i class="conum" data-value="2"></i><b>(2)</b>
        command: [sh, -c, &#39;echo &#34;Initializing my-plugin-cmp...&#34;&#39;, &#39;helm dependency build || true&#39;]
      generate: <i class="conum" data-value="3"></i><b>(3)</b>
        command: [sh, -c, &#34;helm template . --name-template $ARGOCD_APP_NAME --namespace $ARGOCD_APP_NAMESPACE --include-crds &gt; all.yaml &amp;&amp; kustomize build&#34;]
      discover: <i class="conum" data-value="4"></i><b>(4)</b>
        find:
          glob: &#34;**/my-cmp-plugin&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The name of the plugin.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The init command will be executed once, when the plugin is loaded.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The generate command will be executed every time the plugin is called.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The discovery command will be executed to find the plugin.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will execute the command to generate a helm template, pipe the output into all.yaml and let Kustomize patch the output.
The &#34;discovery&#34; part is looking for a specific file in the repository. I thought this might be useful to pin down this plugin to specific repositories only.
However, there are other ways to implement this. You could omit this part and define the name of the plugin inside the Argo CD Application too for example.</p>
</div>
<div class="olist arabic">
<ol class="arabic" start="4">
<li>
<p>Patching Argo CD Repo server</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Now it is time to patch our repo server specification of the Argo CD custom resource.
The following should do it:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
As image for the sidecar container, I am using the custom built <a href="https://quay.io/repository/tjungbau/gitops-tools" rel="noopener" target="_blank">GitOps Tools</a> image. You can use your own image, as long as Helm and Kustomize are available.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
  name: openshift-gitops
  namespace: openshift-gitops
spec:
[...]
  repo:
    - configMap: <i class="conum" data-value="1"></i><b>(1)</b>
        name: my-cmp-plugin
      name: my-cmp-plugin
    sidecarContainers: <i class="conum" data-value="2"></i><b>(2)</b>
      - name: my-cmp-plugin
        command: [/var/run/argocd/argocd-cmp-server]
        env:
          - name: APP_ENV
            value: prod
        image: quay.io/repository/tjungbau/gitops-tools <i class="conum" data-value="3"></i><b>(3)</b>
        imagePullPolicy: Always
        securityContext:
          runAsNonRoot: true
        volumeMounts: <i class="conum" data-value="4"></i><b>(4)</b>
          - mountPath: /var/run/argocd
            name: var-files
          - mountPath: /home/argocd/cmp-server/plugins
            name: plugins
          - mountPath: /tmp
            name: tmp
          - mountPath: /home/argocd/cmp-server/config/plugin.yaml
            subPath: plugin.yaml
            name: my-cmp-plugin
    volumes: <i class="conum" data-value="5"></i><b>(5)</b>
      - configMap:
          name: cloudbees-cmp-plugin
        name: cloudbees-cmp-plugin</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The name of the ConfigMap that was created in step 2.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The sidecar container specification.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The image that is used for the sidecar container.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The volume mounts for the sidecar container.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The volumes for the sidecar container.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>As soon as the repo Pod has been patched a 2nd container inside the Pod will be started as a sidecar. This will take the ConfigMap that was created in step 2 and mount it. As soon as a repo is found where this patch shall be executed, Argo CD will perform the actions defined in the ConfigMap, resulting in the output of the helm template and the patched output of Kustomize.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: my-route
  namespace: my-namespace
  annotations: <i class="conum" data-value="1"></i><b>(1)</b>
    cert-manager.io/cluster-issuer: my-issuer
    cert-utils-operator.redhat-cop.io/certs-from-secret: my-certificate
spec:
  host: my.route.apps.cluster.name
  port:
    targetPort: http
  tls:
    insecureEdgeTerminationPolicy: Redirect
    termination: edge
  to:
    kind: Service
    name: my-service
    weight: 100
  wildcardPolicy: None</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The annotations that are added to the Route.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This is it; this will patch our resource. Such post-renderer can be used for other patches as well. For example, to remove certain items from an object.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_2nd_example">2nd Example</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In my real-live example I had the problem that the <strong>path</strong> was empty in the Helm Chart and OpenShift automatically removed that, which was shown as out-of-sync in Argo CD.</p>
</div>
<div class="paragraph">
<p>So I am using the patch to remove the path.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Only do this if you are sure the element is really empty!
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>I extended the kustomization.yaml with</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">      - op: remove
        path: /spec/path</code></pre>
</div>
</div>
<div class="paragraph">
<p>so it looks like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: my-namespace

resources:
  - ./all.yaml

patches:
  - patch: |
      - op: add
        path: /metadata/annotations
        value:
          cert-manager.io/cluster-issuer: my-issuer
          cert-utils-operator.redhat-cop.io/certs-from-secret: my-certificate
      - op: remove <i class="conum" data-value="1"></i><b>(1)</b>
        path: /spec/path
    target:
      kind: Route
      name: my-route</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The patch that removes the path.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This 2nd patch will completely remove the /spec/path from the Route object named <em>my-route</em>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_further_information">Further information:</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>Example, which was the base of my patch: <a href="https://github.com/gitops-examples/argocd-operator-customization/tree/main/plugin-sidecar" rel="noopener" target="_blank">Plugin Sidecar</a></p>
</li>
<li>
<p>G.Nunn’s original tools image (Thanks for everything):  <a class="bare" href="https://quay.io/repository/gnunn/tools">https://quay.io/repository/gnunn/tools</a></p>
</li>
<li>
<p>My custom built tools image:  <a class="bare" href="https://quay.io/repository/tjungbau/gitops-tools">https://quay.io/repository/tjungbau/gitops-tools</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.11] Managing Certificates</title><link>https://blog.stderr.at/gitopscollection/2024-07-04-managing-certificates-with-gitops/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-07-04-managing-certificates-with-gitops/</guid><pubDate>Thu, 04 Jul 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Manage TLS certificates with a GitOps approach on OpenShift: cert-manager issuers, Certificate resources and keeping renewals under Argo CD control.</description><content:encoded><![CDATA[<div class="paragraph">
<p>The article <a href="https://blog.stderr.at/openshift/2023/02/ssl-certificate-management-for-openshift-on-aws/">SSL Certificate Management for OpenShift on AWS</a> explains how to use the <strong>Cert-Manager Operator</strong> to request and install a new SSL Certificate.
This time, I would like to leverage the GitOps approach using the Helm Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">cert-manager</a> I have prepared to deploy the Operator and order new Certificates.</p>
</div>
<div class="paragraph">
<p>I will use an ACME Letsencrypt issuer with a DNS challenge. My domain is hosted at AWS Route 53.</p>
</div>
<div class="paragraph">
<p>However, any other integration can be easily used.</p>
</div>
<div class="sect1">
<h2 id="_before_we_start">Before we start</h2>
<div class="sectionbody">
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Before we start, be sure that Route 53 is configured correctly. The required settings and commands are described at <a href="https://blog.stderr.at/openshift/2023/02/ssl-certificate-management-for-openshift-on-aws/#_configure_an_aws_user_for_accessing_route_53" rel="noopener" target="_blank">Configure an AWS User for Accessing Route 53</a>
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_deploy_the_operator">Deploy the Operator</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The first step is to deploy the Operator to our cluster. This is done using GitOps and the Helm Chart is located at my Helm repository: <a class="bare" href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/cert-manager">https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/cert-manager</a></p>
</div>
<div class="paragraph">
<p>The configuration looks like below. It takes care to:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Deploy the Operator <strong>cert-manager-operator</strong></p>
</li>
<li>
<p>Verify if the Operator has been deployed successfully</p>
</li>
<li>
<p>Configure Cert-Manager</p>
<div class="olist loweralpha">
<ol class="loweralpha" type="a">
<li>
<p>Create a ClusterIssuer using route53 integration. (You can configure any other configuration too)</p>
</li>
<li>
<p>Patch the Operator with &#34;overrideArgs&#34;. This is required for AWS Route 53 where we need to define which DNS resolvers shall be used.</p>
</li>
</ol>
</div>
</li>
</ol>
</div>
<div class="paragraph">
<p>All these settings are handed over to the appropriate sub-charts. Like <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">helper-operator</a>, <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">helper-status-checker</a> and <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">cert-manager</a></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Install Operator Compliance Operator
# Deploys Operator --&gt; Subscription and Operatorgroup
# Syncwave: 0
helper-operator: <i class="conum" data-value="1"></i><b>(1)</b>
  operators:
    compliance-operator:
      enabled: true
      syncwave: &#39;0&#39;
      namespace:
        name: cert-manager-operator
        create: true
      subscription:
        channel: stable-v1
        approval: Automatic
        operatorName: openshift-cert-manager-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup:
        create: true
        notownnamespace: false

helper-status-checker: <i class="conum" data-value="2"></i><b>(2)</b>
  enabled: true

  checks:
    - operatorName: cert-manager-operator
      namespace:
        name: cert-manager-operator
      serviceAccount:
        name: &#34;status-checker-cert-manager&#34;

cert-manager: <i class="conum" data-value="3"></i><b>(3)</b>
  certManager:
    enable_patch: true

    overrideArgs: <i class="conum" data-value="4"></i><b>(4)</b>
      - &#39;--dns01-recursive-nameservers-only&#39;
      - --dns01-recursive-nameservers=ns-362.awsdns-45.com:53,ns-930.awsdns-52.net:53

  issuer: <i class="conum" data-value="5"></i><b>(5)</b>
    - name: letsencrypt-prod
      type: ClusterIssuer
      enabled: true
      syncwave: 20

      acme:
        email: tjungbau@redhat.com

        solvers:
          - dns01: <i class="conum" data-value="6"></i><b>(6)</b>
              route53:
                accessKeyIDSecretRef:
                  key: access-key-id
                  name: prod-route53-credentials-secret
                region: us-west-1
                secretAccessKeySecretRef:
                  key: secret-access-key
                  name: prod-route53-credentials-secret
            selector:
              dnsZones:
                - aws.ispworld.at</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Installing the Operator</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Verify if the Operator has been successfully deployed</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Configure the Cert-Manager Operator</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Override the DNS resolver args</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Configure the ClusterIssuer</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Use the solver dns01.route53.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README of the Helm Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">cert-manager</a> for additional possibilities in the configuration.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>One additional piece is missing before we can finally start the deployment.</p>
</div>
<div class="paragraph">
<p>As you can see in the values file above the <strong>accessKey</strong> and <strong>secretAccessKey</strong> are stored in the secret named <em>prod-route53-credentials-secret</em>.</p>
</div>
<div class="paragraph">
<p>This means, that a secret is required with the keys that have been provided by AWS when you configured the Route 53 access:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: Secret
apiVersion: v1
metadata:
  name: prod-route53-credentials-secret
  namespace: cert-manager <i class="conum" data-value="1"></i><b>(1)</b>
data:
  access-key-id: &lt;AccessKey&gt;
  secret-access-key: &lt;Secret Access Key&gt;
type: Opaque</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Namespace of the Secret, here the Operator is managing the Certificate Controller.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>I stored this Secret as SealedSecret and put it into the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/cert-manager" rel="noopener" target="_blank">cluster configuration folder</a>. From here, Argo CD will pick it up and deploy it.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Never, never ever store a Secret object directly in Git. Secret objects are not encrypted but encoded. Everybody could decode the data. With Sealed Secrets or any other Secret Management, you are able to prepare these objects and store or retrieve them.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Finally, with these settings, the Operator can be deployed. This is managed by OpenShift GitOps (Argo CD). As soon as the Operator is ready, we can start requesting certificates as we automatically created the <strong>ClusterIssuer</strong> (letsencrypt-prod)</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/cert-manager.png?width=640px" alt="Deploying and Configuring Cert-Manager Operator"/>
</div>
<div class="title">Figure 1. Deploying and Configuring Cert-Manager Operator</div>
</div>
<div class="paragraph">
<p>Two certificates are of special interest :</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Default IngressController of OpenShift</p>
</li>
<li>
<p>OpenShift’s API</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Therefore, let’s request and configure them.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_requesting_a_certificate">Requesting a Certificate</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">cert-manager</a> can render a Certificate resource as well. I tried to support any possible setting. However, not everything, especially the non-stable ones, is available yet.</p>
</div>
<div class="paragraph">
<p>The official Cert-Manager documentation explains how to create such <a href="https://cert-manager.io/docs/usage/certificate/" rel="noopener" target="_blank">Certificate Resource</a>.</p>
</div>
<div class="paragraph">
<p>The chart <a href="https://github.com/tjungbauer/helm-charts/blob/main/charts/cert-manager/values.yaml#L112-L269" rel="noopener" target="_blank">README</a> explains which settings are supported by the chart.</p>
</div>
<div class="paragraph">
<p>Not every setting is required and some will set default values. The minimum parameters are: name, namespace, secretName, dnsNames and reference to an issuer.</p>
</div>
<div class="sect2">
<h3 id="_requesting_ingresscontroller_certificate">Requesting IngressController Certificate</h3>
<div class="paragraph">
<p>The default IngressController of OpenShift listens on the wildcard domain *.apps.clustername.basedomain. In my examples, you will see *.apps.ocp.aws.ispworld.at</p>
</div>
<div class="paragraph">
<p>The IngressController configuration must be modified to reference the Secret object the cert-manager will generate once the Certificate has been successfully requested. The cluster configuration <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/ingresscontroller/values.yaml" rel="noopener" target="_blank">Ingresscontroller</a> defines the required parameters:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">---
# -- Define ingressControllers
# Multiple might be defined.
ingresscontrollers: <i class="conum" data-value="1"></i><b>(1)</b>
    # -- Name of the IngressController. OpenShift initial IngressController is called &#39;default&#39;.
  - name: default

    # -- Enable the configuration
    # @default -- false
    enabled: true

    # -- Number of replicas for this IngressController
    # @default -- 2
    replicas: 3

    # -- The name of the secret that stores the certificate information for the IngressController
    # @default -- N/A
    defaultCertificate: router-certificate <i class="conum" data-value="2"></i><b>(2)</b>

    # -- Bind IngressController to specific nodes
    # Here as example for Infrastructure nodes.
    # @default -- empty
    #nodePlacement:

      # NodeSelector that shall be used.
    #  nodeSelector: <i class="conum" data-value="3"></i><b>(3)</b>
    #    key: node-role.kubernetes.io/infra
    #    value: &#39;&#39;

    #  # -- Tolerations, required if the nodes are tainted.
    #  tolerations:
    #    - effect: NoSchedule
    #      key: node-role.kubernetes.io/infra
    #      operator: Equal
    #      value: reserved
    #    - effect: NoExecute
    #      key: node-role.kubernetes.io/infra
    #      operator: Equal
    #      value: reserved

certificates:
  enabled: true

  # List of certificates
  certificate: <i class="conum" data-value="4"></i><b>(4)</b>
    - name: router-certificate
      enabled: true
      namespace: openshift-ingress
      syncwave: &#34;0&#34;
      secretName: router-certificate <i class="conum" data-value="5"></i><b>(5)</b>

      dnsNames: <i class="conum" data-value="5"></i><b>(5)</b>
        - apps.ocp.aws.ispworld.at
        - &#39;*.apps.ocp.aws.ispworld.at&#39;

      # Reference to the issuer that shall be used.
      issuerRef: <i class="conum" data-value="6"></i><b>(6)</b>
        name: letsencrypt-prod
        kind: ClusterIssuer</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Configuration for the IngressController</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Reference to the Secret that will store the Certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Optional tolerations that can be configured for the IngressController</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>List of Certificates to order</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>List of domainnames for the IngressController. Here 2 are used, the wildcard domain and the base domain of that wildcard.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Reference to the issuer (in this case ClusterIssuer)</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will request the Certificate:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: router-certificate
  namespace: openshift-ingress
spec:
  dnsNames:
    - apps.ocp.aws.ispworld.at
    - &#39;*.apps.ocp.aws.ispworld.at&#39;
  duration: 2160h0m0s
  issuerRef:
    kind: ClusterIssuer
    name: letsencrypt-prod
  privateKey:
    algorithm: RSA
    encoding: PKCS1
    rotationPolicy: Always
  secretName: router-certificate</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
It may take a while until the Certificate request is approved.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The IngressController will update the reference to the secret and restart the ingress pods:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
  name: default
  namespace: openshift-ingress-operator
spec:
[...]
  defaultCertificate:
    name: router-certificate</code></pre>
</div>
</div>
<div class="paragraph">
<p>Once all pods have been successfully restarted, open a new browser, or reload or open a private window to verify the certificate that is provided by the application.</p>
</div>
</div>
<div class="sect2">
<h3 id="_requesting_apiserver_certificate">Requesting APIServer Certificate</h3>
<div class="paragraph">
<p>Requesting the certificate for the OpenShift API follows the same rules as for the IngressController.
The example can be found at: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/clusterconfig-apiserver/values.yaml" rel="noopener" target="_blank">Clusterconfig APIServer</a></p>
</div>
<div class="paragraph">
<p>The values file may look like the following for example:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In this case, not only the Certificate is requested but the ETCD encryption is also enabled. The reason for that is, that both settings are done in the same Kubernetes resource (apiserver). If we split this up into 2 Argo CD Applications one of them will always show a warning that the same resource is managed by another Argo CD Application.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">---
# -- Using subchart generic-cluster-config
generic-cluster-config:
  apiserver: <i class="conum" data-value="1"></i><b>(1)</b>
    enabled: true

    # audit configuration
    audit:
      profile: Default

    # Configure a custom certificate for the API server
    custom_cert:
      enabled: true

      cert_names: <i class="conum" data-value="2"></i><b>(2)</b>
        - api.ocp.aws.ispworld.at

      secretname: api-certificate <i class="conum" data-value="3"></i><b>(3)</b>

    etcd_encryption: <i class="conum" data-value="4"></i><b>(4)</b>
      enabled: true
      encryption_type: aesgcm <i class="conum" data-value="5"></i><b>(5)</b>

      # -- Namespace where Job is executed that verifies the status of the encryption
      namespace: kube-system

      serviceAccount:
        create: true
        name: &#34;etcd-encryption-checker&#34; <i class="conum" data-value="6"></i><b>(6)</b>

cert-manager: <i class="conum" data-value="7"></i><b>(7)</b>
  enabled: true

  certificates:
    enabled: true

    # List of certificates
    certificate:
      - name: api-certificate
        enabled: true
        namespace: openshift-config
        syncwave: &#34;0&#34;
        secretName: api-certificate

        dnsNames:
          - api.ocp.aws.ispworld.at

        # Reference to the issuer that shall be used.
        issuerRef:
          name: letsencrypt-prod
          kind: ClusterIssuer</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Settings for the APIServer object.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The name of the domain the certificate will be responsible for.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Reference to the Secret that will store the Certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Enable ETCD encryption</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Tpee of encryption</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Service Account that will be created and used by a Job that will verify when and if the encryption has been finished successfully.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Settings for the Certificate. Similar to the settings of the IngressController.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The configuration is more or less similar to the IngressController. Again the APIServer will restart and once done, the Certificate is used by the cluster.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With this, very short, article I have tried to easily explain how to deploy the Cert-Manager Operator and request Certificates. Different Helm Charts are used, but the main one is <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/cert-manager" rel="noopener" target="_blank">cert-manager</a>.</p>
</div>
<div class="paragraph">
<p>The cluster configuration repository <a class="bare" href="https://github.com/tjungbauer/openshift-clusterconfig-gitops">https://github.com/tjungbauer/openshift-clusterconfig-gitops</a> then use this chart to configure the required resources.</p>
</div>
<div class="paragraph">
<p>With the support of this Helm Chart anybody in the Cluster can request Certificates which are then managed by the Cert-Manager Operator.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.10] Update Cluster Version</title><link>https://blog.stderr.at/gitopscollection/2024-06-07-update-cluster-version-with-gitops/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-06-07-update-cluster-version-with-gitops/</guid><pubDate>Fri, 07 Jun 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Update an OpenShift cluster using a GitOps approach.</description><content:encoded><![CDATA[<div class="paragraph">
<p>During a GitOps journey at one point, the question arises, how to update a cluster? Nowadays it is very easy to update a cluster using CLI or WebUI, so why bother with GitOps in that case? The reason is simple: Using GitOps you can be sure that all clusters are updated to the correct, required version and the version of each cluster is also managed in Git.</p>
</div>
<div class="paragraph">
<p>All you need is the <strong>channel</strong> you want to use and the desired cluster <strong>version</strong>. Optionally, you can define the exact image SHA. This might be required when you are operating in a restricted environment.</p>
</div>
<div class="sect1">
<h2 id="_overview">Overview</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Since OpenShift 4 it is very easy to update a cluster. It can either be done using the Web UI <strong>Administration → Cluster Settings</strong> or via the command line using the command <code>oc adm upgrade</code>.</p>
</div>
<div class="paragraph">
<p>There are 2 main configurations for an upgrade:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>channel</strong>: This declares the update strategy tied to versions of OpenShift.</p>
</li>
<li>
<p>The <strong>desired version</strong>: This is the target version the cluster should be updated to.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>To get the current clusterversion you can use the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">❯ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.14.1    True        False         4m38s   Cluster version is 4.14.1</code></pre>
</div>
</div>
<div class="paragraph">
<p>Here we can see that the version is currently <strong>4.14.1</strong> and no upgrade is currently progressing.</p>
</div>
<div class="paragraph">
<p>Now we want to update to the latest possible version.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_where_to_find_the_available_updates">Where to find the available updates?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before you start the update, you will need to fetch the possible available updates.</p>
</div>
<div class="paragraph">
<p>This information can be gathered with the command <code>oc adm upgrade</code> or <code>oc get clusterversion/version -o yaml</code>.</p>
</div>
<div class="paragraph">
<p>The output will look like the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">Cluster version is 4.14.1
Upstream is unset, so the cluster will use an appropriate default.
Channel: stable-4.14 (available channels: candidate-4.14, eus-4.14, fast-4.14, stable-4.14, candidate-4.15, fast-4.15, stable-4.15) <i class="conum" data-value="1"></i><b>(1)</b>
Recommended updates: <i class="conum" data-value="2"></i><b>(2)</b>
  VERSION     IMAGE
  4.14.27     quay.io/openshift-release-dev/ocp-release@sha256:4d30b359aa6600a89ed49ce6a9a5fdab54092bcb821a25480fdfbc47e66af9ec
  4.14.26     quay.io/openshift-release-dev/ocp-release@sha256:4fe7d4ccf4d967a309f83118f1a380a656a733d7fcee1dbaf4d51752a6372890
  [...]</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Current Channel and available channels</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>List of available updates</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The command describes the current channel (stable-4.14) and a list of possible updates.
(The list is much longer).</p>
</div>
<div class="paragraph">
<p>The latest available version is <strong>4.14.27</strong> and the list of possible channels is all the 4.14 channels, but also 4.15 channels. This means we could change the channel here as well.</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
It is your responsibility to find the <strong>correct and supported upgrade paths</strong>. Not all upgrades to any version are supported. Also, do not rely on consecutive path numbers, some versions were never available.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_channels">Channels</h3>
<div class="paragraph">
<p>Channels help users to define the timing and level of support for their environment. The following channels typically exist:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>fast</strong>: This channel is fully supported but not yet fully tested and can be used to quickly update to the latest GA release. For example, when a certain bug is triggered in the current version.</p>
</li>
<li>
<p><strong>stable</strong>: This is the latest stable version. Versions here are added after enough data points have been collected and therefore have some delay.</p>
</li>
<li>
<p><strong>candidate</strong>: This channel offers <strong>unsupported</strong> early access to specific versions.</p>
</li>
<li>
<p><strong>eus</strong>: All even-numbered versions offer an Externed Update Support (EUS) channel. They allow EUS-to-EUS updates and have a longer support phase.</p>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_helm_chart_update_clusterversion">Helm Chart - update-clusterversion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Now we want to update the version to the latest of the current channel <strong>4.14.27</strong> and change the channel to <strong>stable-4.15</strong>.
The Helm Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/update-clusterversion" rel="noopener" target="_blank">update-clusterversion</a> has been created to help with a cluster update.</p>
</div>
<div class="paragraph">
<p>It will modify the clusterversion resource.</p>
</div>
<div class="paragraph">
<p>The required values are quite simple:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">channel: stable-4.15
desiredVersion: 4.14.27
image: &#39;&#39;</code></pre>
</div>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Be sure that you choose the correct and available updates.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This is everything we need. As soon as this is synchronized into the cluster, the update process will be started by the cluster.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_gitops_synchronization">GitOps Synchronization</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When we verify the current version in the OpenShift UI, we will see the possibility of an upgrade:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/clusterversion.png?width=720px" alt="Cluster before the update process starts"/>
</div>
<div class="title">Figure 1. Cluster before the update process starts</div>
</div>
<div class="paragraph">
<p>In OpenShift GitOps we have the Application to start the update process:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/clusterversion-sync.png?width=720px" alt="Syncing new version"/>
</div>
<div class="title">Figure 2. Syncing new version</div>
</div>
<div class="paragraph">
<p>After a few seconds OpenShift will start with the update:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/clusterversion-update-progressing.png?width=720px" alt="Progressing Cluster Update"/>
</div>
<div class="title">Figure 3. Progressing Cluster Update</div>
</div>
<div class="paragraph">
<p>This can also be verified via the command line</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">❯ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.14.1    True        True          95s     Working towards 4.14.27: 116 of 860 done (13% complete), waiting on etcd, kube-apiserver</code></pre>
</div>
</div>
<div class="paragraph">
<p>Eventually, the cluster update process finishes successfully. We are now on version <strong>4.14.27</strong> and using the channel <strong>stable-4.15</strong>.</p>
</div>
<div class="paragraph">
<p>We can see that the next upgrade with be to version 4.15.15. This means we can directly upgrade to this version. This is possible because we switched the channel to stable-4.15.</p>
</div>
<div class="paragraph">
<p>Other channels, like candidate-4.15 might offer different, but not recommended, versions.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">❯ oc adm upgrade
Cluster version is 4.14.27

Upstream is unset, so the cluster will use an appropriate default.
Channel: stable-4.15 (available channels: candidate-4.14, candidate-4.15, eus-4.14, fast-4.14, fast-4.15, stable-4.14, stable-4.15)

Recommended updates:

  VERSION     IMAGE
  4.15.15     quay.io/openshift-release-dev/ocp-release@sha256:bb1182cd9001d6811dea8c5823235c17b9a316cce3bb13c51325250c14b46787</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="_what_about_the_sha_for_the_image">What about the SHA for the image?</h3>
<div class="paragraph">
<p>The SHA for the image field in the ClusterVersion resource is required in certain scenarios to provide a precise reference to the container image that represents the OpenShift version you want to update to.</p>
</div>
<div class="paragraph">
<p>Such scenarios could be for example:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Offline or Restricted Networks
In environments where clusters are running in offline or restricted network conditions, specifying the exact image SHA ensures that the cluster updates to a specific, known image that has been pre-pulled and is available within the network.</p>
</li>
<li>
<p>Precise Version Control
Using the SHA ensures that the exact image version is used for the update, providing a higher level of precision and control.</p>
</li>
<li>
<p>Custom or Private Registries
If you are using custom or private container registries, specifying the image SHA can help avoid ambiguities and ensure that the correct image is pulled from the correct registry.</p>
</li>
<li>
<p>Specific Compliance or Security Requirements
Some regulations might require precise specification of container images, including SHAs, to ensure traceability and verifiability of the software components being deployed.</p>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With this very simple method, it is easy to manage the version of multiple clusters via GitOps. Especially, where there is a bigger cluster fleet it will become essential to ensure which cluster has which version.
Disconnected environments can also use the <strong>image</strong> setting to specify the exact SHA of an available update.</p>
</div>
<div class="paragraph">
<p>The current Helm Chart is very small and limited. It was created to quickly show the main use case: a simple and straightforward cluster upgrade.</p>
</div>
<div class="paragraph">
<p>Other possible options that might be required in the future. If you find anything missing, please let me know.</p>
</div>
<div class="paragraph">
<p>Please note, to always verify which version and channel is available and always consult the official documentation before an upgrade to find the latest release notes.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>References: <a href="https://docs.openshift.com/container-platform/4.15/updating/understanding_updates/intro-to-updates.html" rel="noopener" target="_blank">Updating Clusters</a></p>
</li>
</ol>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.9] Multiple Sources for Applications</title><link>https://blog.stderr.at/gitopscollection/2024-06-02-multisources-for-application-in-argocd/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-06-02-multisources-for-application-in-argocd/</guid><pubDate>Sun, 02 Jun 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Using Multiple Sources for Applications in Argo CD</description><content:encoded><![CDATA[<div class="paragraph">
<p>Argo CD or OpenShift GitOps uses Applications or ApplicationSets to define the relationship between a source (Git) and a cluster. Typically, this is a 1:1 link, which means one Application is using one source to compare the cluster status. This can be a limitation. For example, if you are working with Helm Charts and a Helm repository, you do not want to re-build (or re-release) the whole chart just because you made a small change in the values file that is packaged into the repository. You want to separate the configuration of the chart with the Helm package.</p>
</div>
<div class="paragraph">
<p>The most common scenarios for multiple sources are (see: <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/" rel="noopener" target="_blank">Argo CD documentation</a>):</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Your organization wants to use an external/public Helm chart</p>
</li>
<li>
<p>You want to override the Helm values with your own local values</p>
</li>
<li>
<p>You don’t want to clone the Helm chart locally as well because that would lead to duplication and you would need to monitor it manually for upstream changes.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This small article describes three different ways with a working example and tries to cover the advantages and disadvantages of each of them. They might be opinionated but some of them proved to be easier to use and manage.</p>
</div>
<div class="sect1">
<h2 id="_option_1_multisource_by_argo_cd">Option 1: Multisource by Argo CD</h2>
<div class="sectionbody">
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Specifying multiple sources for an application is a <strong>beta feature</strong>.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The first option I would like to demonstrate is the &#34;official way&#34; by Argo CD. It was introduced in Argo CD version 2.6 and while this option is still in the Beta phase, it is one of the most requested features and was added to the release candidate of version 2.11. The <a href="https://blog.argoproj.io/argo-cd-v2-11-release-candidate-b83ba3008ba5" rel="noopener" target="_blank">article by Argo CD</a> gives more details of this release. The official documentation by Argo CD can be found <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/" rel="noopener" target="_blank">here</a></p>
</div>
<div class="paragraph">
<p>In my <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/base/init_app_of_apps/" rel="noopener" target="_blank">repository</a> I am using this option as an example to create the App-of-Apps. The App-of-Apps created an Application, that uses multiple sources.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The values files from <a class="bare" href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/base/argocd-resources-manager/values.yaml">https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/base/argocd-resources-manager/values.yaml</a></p>
</li>
<li>
<p>The Helm Chart <strong>helper-argocd</strong> from <a class="bare" href="https://charts.stderr.at/">https://charts.stderr.at/</a></p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Let’s see the working example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argocd-resources-manager
  namespace: openshift-gitops
spec:
  destination:
    namespace: openshift-gitops
    server: &#39;https://kubernetes.default.svc&#39;
  info:
    - name: Description
      value: &gt;-
        This is the starting point which will initialize all applicationsets or
        argocd applications
  project: default
  sources: <i class="conum" data-value="1"></i><b>(1)</b>
    - chart: helper-argocd <i class="conum" data-value="2"></i><b>(2)</b>
      helm:
        valueFiles: <i class="conum" data-value="3"></i><b>(3)</b>
          - $values/base/argocd-resources-manager/values.yaml
      repoURL: &#39;https://charts.stderr.at/&#39; <i class="conum" data-value="4"></i><b>(4)</b>
      targetRevision: 2.0.28 <i class="conum" data-value="5"></i><b>(5)</b>
    - ref: values <i class="conum" data-value="6"></i><b>(6)</b>
      repoURL: &#39;https://github.com/tjungbauer/openshift-clusterconfig-gitops&#39;
      targetRevision: main
  syncPolicy:
    automated:
      prune: true
      selfHeal: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Using <strong>sources</strong> instead of singular source</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>I want to use the Helm Chart <strong><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-argocd" rel="noopener" target="_blank">helper-argocd</a></strong></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The chart will use the values file(s) from github.com/tjungbauer/openshift-clusterconfig-gitops/base/argocd-resources-manager/values.yaml. $value (can only be specified at the beginning of the path) resolves to the root of the values file repository</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The URL of the Helm Chart repository</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The version of the Helm chart helper-argocd</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The reference to the values file, defining the repository URL and target revision.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Argo CD does not currently support using another Helm chart as a source for value files.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>With this option, it is possible to separate the values files from the Helm Chart itself. Whenever I want to change something in the configuration, I simply change the values file without being required to release a new Chart version.</p>
</div>
<div class="paragraph">
<p><strong>Advantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>Allows easily to define an Application with multiple sources, using Argo CD features.</p>
</li>
<li>
<p>No additional tool (see other options below) is required</p>
</li>
<li>
<p>Was added to the release candidate of Argo CD v2.11</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Disadvantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>Currently a Beta feature and thus is not supported and has some limitations, such as lacking support of CLI and UI.</p>
</li>
<li>
<p>Does not allow using additional local specifications. At least as far as I know.</p>
</li>
<li>
<p>Can be complex to configure and manage</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_option_2_wrapper_helm_chart">Option 2: Wrapper Helm Chart</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With this option, which I extensively use, a wrapper Helm Chart is used to define local values files while calling additional (sub) Helm Charts as a dependency. This wrapper could simply define the values files and nothing else (being <a href="/gitopscollection/2024-04-25-installing-compliance-operator/#_why_empty_helm_charts/" rel="noopener" target="_blank">empty instead</a>) or even define additional files, such as Sealed Secrets or things that are not provided by the sub-charts.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>An example of an empty chart would be: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/setup-acs" rel="noopener" target="_blank">setup-acs</a></p>
</li>
<li>
<p>An example of a chart that defines additional local files would be: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/generic-clusterconfig" rel="noopener" target="_blank">generic-clusterconfig</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The first one is using sub-charts to build the required specifications:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">dependencies:
  - name: rhacs-setup
    version: ~1.0.0
    repository: https://charts.stderr.at/
  - name: helper-operator
    version: ~1.0.23
    repository: https://charts.stderr.at/
  - name: helper-status-checker
    version: ~4.0.0
    repository: https://charts.stderr.at/
    condition: helper-status-checker.enabled</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-acs/values.yaml" rel="noopener" target="_blank">values file</a> specifies the configuration for these sub-charts.</p>
</div>
<div class="paragraph">
<p>The second example also uses sub-charts, but additionally defines local files such as a SealedSecret for htpasswd.</p>
</div>
<div class="paragraph">
<p>As you can see throughout my <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster" rel="noopener" target="_blank">repository</a> I am using this option almost all the time. It proved to be quite simple, especially if you prefer working with Helm Charts such as I do.
However, you must take care of the settings in the values file. Specifications you would like to be presented in a sub-chart must be put into the correct place.</p>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="paragraph">
<p>Everything underneath</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-operator:
  operators:
    rhacs-operator:
[...]</code></pre>
</div>
</div>
<div class="paragraph">
<p>will be used by the chart <strong>helper-operator</strong>. While everything underneath:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-status-checker:
  enabled: true</code></pre>
</div>
</div>
<div class="paragraph">
<p>will be used by the chart <strong>helper-status-checker</strong>.</p>
</div>
<div class="paragraph">
<p><strong>Advantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>Easy to use, at least for myself</p>
</li>
<li>
<p>Allows defining additional, local files that are not provided by the sub-charts</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Disadvantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>A wrapper Chart must be created, that at least defines: Chart.yaml, templates folder and values.yaml</p>
</li>
<li>
<p>The configuration must be done correctly and all settings for a sub-chart must be forwarded to the sub-chart.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_option_3_using_kustomize_with_helm_enabled">Option 3: Using Kustomize with Helm enabled</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The third option I would like to show is using Kustomize. This tool can be used to call a Helm Chart when the option <strong>--enable-helm</strong> is activated in Argo CD. I am using one example for the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/ingresscontroller" rel="noopener" target="_blank">IngressController</a>.</p>
</div>
<div class="paragraph">
<p>Here the values file is placed into the local folder and the Kustomize.yaml is configured as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: ingresscontroller
  repo: https://charts.stderr.at
  valuesFile: values.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>This simply defines the use of the chart <strong>ingresscontroller</strong> from the Helm repository with the local values file.</p>
</div>
<div class="paragraph">
<p>Unlike Option #2 you do not need to take care about the settings for sub-charts and which settings are passed to which chart. Like Option #2 you can also define additional files that shall be rendered using out-of-the-box Kustomize possibilities.</p>
</div>
<div class="paragraph">
<p><strong>Advantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>Easy to use</p>
</li>
<li>
<p>Allows defining additional, local files that are not provided by the sub-charts</p>
</li>
<li>
<p>No need to take care of sub-charts and correctly pass the settings to a sub-chart</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>Disadvantages</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>combines two different tools, which might become confusing</p>
</li>
<li>
<p>requires specific option to be enabled <strong>--enable-helm</strong></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As this short article demonstrates, there are multiple ways to work with multiple sources and therefore to separate the values file from the actual Helm Chart. There might be even more options, but these are the ones I was seeing at customers.</p>
</div>
<div class="paragraph">
<p>Which one do I use? When you look at my <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops" rel="noopener" target="_blank">repository</a> you see that I mainly use Option #2. Actually, I completely moved from Option #3 to Option #2 a few months ago, because this proved to be clearer for customers, especially when they are new to Kustomize and Helm. That way, only one tool is used and must be managed. Option #3 proved to be more complex in such a case.</p>
</div>
<div class="paragraph">
<p>What about Option #1? While I am using it to showcase this feature it is still in a TechPreview phase. However, I do not think that it will completely replace the other options, because it is more complex to configure.</p>
</div>
<div class="paragraph">
<p>However, in the end, it is all about personal preferences. Use the tool that you feel most comfortable with :).</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.8] Installing OpenShift Logging</title><link>https://blog.stderr.at/gitopscollection/2024-05-24-install-openshift-logging/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-05-24-install-openshift-logging/</guid><pubDate>Fri, 24 May 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Installing OpenShift Logging using a GitOps approach.</description><content:encoded><![CDATA[<div class="paragraph">
<p><a href="https://docs.openshift.com/container-platform/4.15/observability/logging/logging_release_notes/logging-5-9-release-notes.html" rel="noopener" target="_blank">OpenShift Logging</a> is one of the more complex things to install and configure on an OpenShift cluster. Not because the service or Operators are so complex to understand, but because of the dependencies logging has. Besides the logging operator itself, the Loki operator is required, the Loki operator requires access to an object storage, that might be configured or is already available.</p>
</div>
<div class="paragraph">
<p>In this article, I would like to demonstrate the configuration of the full stack using an object storage from OpenShift Data Foundation. This means:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Installing the logging operator into the namespace openshift-logging</p>
</li>
<li>
<p>Installing the Loki operator into the namespace openshift-operators-redhat</p>
</li>
<li>
<p>Creating a new BackingStore and BucketClass</p>
</li>
<li>
<p>Generating the Secret for Loki to authenticate against the object storage</p>
</li>
<li>
<p>Configuring the LokiStack resource</p>
</li>
<li>
<p>Configuring the ClusterLogging resource</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>All steps will be done automatically. In case you have S3 storage available, or you are not using OpenShift Data Foundation, the setup will be a bit different. For example, you do not need to create a BackingStore or the Loki authentication Secret.</p>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>OpenShift 4</p>
</li>
<li>
<p>Argo CD (OpenShift GitOps) deployed</p>
</li>
<li>
<p>OpenShift Data Foundation (ODF) deployed and ready to provide object storage.</p>
</li>
<li>
<p>Enough available compute resources to deploy LokiStack. Verify the official <a href="https://docs.openshift.com/container-platform/4.15/observability/logging/log_storage/installing-log-storage.html" rel="noopener" target="_blank">OpenShift Logging documentation</a> to see which option might need which resources.</p>
</li>
</ol>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
For ODF it would be enough to deploy object storage only, instead of the full storage stack based on Ceph. In this case, the so-called <strong>MultiCloudObjectGateway</strong> option is used, which creates (virtualizes) object storage on top of an existing StorageClass
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
If ODF object storage based on Noobaa should be used, then it makes sense to think about the data retention process, which will take care of removing old data from the storage. It is recommended to configure this directly on the object storage, because this is much more compute-friendly, then letting OpenShift Logging take care of that. The configuration depends on the object storage vendor. In the case of Noobaa, I have prepared a separate article: <a href="/openshift/2024/02/openshift-data-foundation-noobaa-bucket-data-retention-lifecycle/">Noobaa Bucket Data Retention Lifecycle</a>
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The main resources of OpenShift Logging are the three custom resources: <strong>ClusterLogging</strong>, <strong>ClusterLogForwarder</strong> and <strong>LokiStack</strong>. The first two are provided by the OpenShift Logging Operator, the last one is provided by the Loki Operator. ClusterLogForwarder is an optional configuration. It allows us to forward logs to external destinations, such as Splunk, or to forward the OpenShift audit logs to Loki. (They are not stored by default). The LokiStack resource requires an available object storage to be able to start its workloads.</p>
</div>
<div class="paragraph">
<p>In my case, I would like to configure everything automatically. This means, that I also want to configure the object or S3 storage and create the required authentication secret for Loki without manual intervention. This can be easily done using ODF.</p>
</div>
<div class="paragraph">
<p>The <a href="/gitopscollection/2024-04-02-configure_app_of_apps/">Configure App-of-Apps</a> installed an Argo CD Application called <strong>in-cluster-setup-openshift-logging</strong>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup-openshift-logging.png?width=720px" alt="Argo CD Application: setup-openshift-logging"/>
</div>
<div class="title">Figure 1. Argo CD Application: setup-openshift-logging</div>
</div>
<div class="paragraph">
<p>This Argo CD Application uses the following path to find the Helm Chart: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-openshift-logging" rel="noopener" target="_blank">setup-openshift-logging</a></p>
</div>
<div class="paragraph">
<p>This Helm chart is a <strong>wrapper chart</strong> that uses sub-charts as dependencies to install and configure the operator as well as to do some OpenShift Jobs on top, for example, creating the required Secret for LokiStack.</p>
</div>
<div class="paragraph">
<p>The deployment workflow will go through the sub-charts and look like the following:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/logging-deployment-flow.png" alt="Deployment Workflow"/>
</div>
<div class="title">Figure 2. Deployment Workflow</div>
</div>
<div class="paragraph">
<p>While this looks quite huge and complex, the idea of the sub-charts is quite simple: Do a small specific task, that can be reused by other charts. For example, the NetworkObservability Operator also required an object storage and Loki. I can easily reuse the sub-charts without repeating the logic behind them.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_installing_openshift_logging_stack">Installing OpenShift Logging Stack</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_analyzing_chart_yaml">Analyzing Chart.yaml</h3>
<div class="paragraph">
<p>Let’s examine the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-openshift-logging/Chart.yaml" rel="noopener" target="_blank">Chart.yaml</a> file to see which dependencies are used:</p>
</div>
<div class="paragraph">
<p>The file looks like the following. The Chart has a lot of dependencies on sub-charts, that have been created to make specific, small and defined operations re-useable for multiple Charts. A total number of 6 sub-charts are used:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">dependencies:
  - name: helper-operator <i class="conum" data-value="1"></i><b>(1)</b>
    version: ~1.0.18
    repository: https://charts.stderr.at/
  - name: helper-status-checker <i class="conum" data-value="2"></i><b>(2)</b>
    version: ~4.0.0
    repository: https://charts.stderr.at/
    condition: helper-status-checker.enabled
  - name: openshift-logging <i class="conum" data-value="3"></i><b>(3)</b>
    version: ~2.0.0
    repository: https://charts.stderr.at/
  - name: helper-loki-bucket-secret <i class="conum" data-value="4"></i><b>(4)</b>
    version: ~1.0.0
    repository: https://charts.stderr.at/
    condition: helper-loki-bucket-secret.enabled
  - name: helper-objectstore <i class="conum" data-value="5"></i><b>(5)</b>
    version: ~1.0.0
    repository: https://charts.stderr.at/
    condition: helper-objectstore.enabled
  - name: helper-lokistack <i class="conum" data-value="6"></i><b>(6)</b>
    version: ~1.0.0
    repository: https://charts.stderr.at/
    condition: helper-lokistack.enabled</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Status Checker</a></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/openshift-logging" rel="noopener" target="_blank">OpenShift Logging</a></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-loki-bucket-secret" rel="noopener" target="_blank">Helper Loki Bucket Secret</a></td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-objectstore" rel="noopener" target="_blank">Helper Objectstore</a></td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack" rel="noopener" target="_blank">Helper Lokistack</a></td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the READMEs of the different Charts for detailed information on how to configure them.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configuration_of_the_chart">Configuration of the Chart</h3>
<div class="paragraph">
<p>To configure OpenShift Logging the <strong><a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-openshift-logging/values.yaml" rel="noopener" target="_blank">values file</a></strong> of the wrapper Chart must be prepared accordingly.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The important thing here is, that any value that should be bypassed to a sub-chart is defined under the name of the sub-chart. For example, everything under <strong>helper-operator:</strong> will be sent to the helper-operator Chart and is used there for its configuration.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Let’s walk through the configuration for each sub-chart in the order they are required:</p>
</div>
</div>
<div class="sect2">
<h3 id="_installing_the_operator">Installing the Operator</h3>
<div class="paragraph">
<p>The first thing to do is to deploy the Operators themselves. For OpenShift Logging two Operators are required:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>OpenShift Logging</p>
</li>
<li>
<p>Loki</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Loki might be installed already due to a different dependency. Maybe you have deployed the Network Observability Operator previously. In that case, OpenShift Logging is required only.</p>
</div>
<div class="paragraph">
<p>The Helm Chart <strong><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">helper-operator</a></strong> is responsible for deploying the Operators. In the following example, I will deploy both Operators (Logging and Loki) and enable the console plugin for the OpenShift Logging operator:</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The console plugin will only work when the whole stack, this means when Logging itself, has been rolled out.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-operator:
  console_plugins: <i class="conum" data-value="1"></i><b>(1)</b>
    enabled: true
    plugins: <i class="conum" data-value="2"></i><b>(2)</b>
      - logging-view-plugin

  operators:
    cluster-logging-operator: <i class="conum" data-value="3"></i><b>(3)</b>
      enabled: true <i class="conum" data-value="4"></i><b>(4)</b>
      syncwave: &#39;0&#39; <i class="conum" data-value="5"></i><b>(5)</b>

      namespace: <i class="conum" data-value="6"></i><b>(6)</b>
        name: openshift-logging
        create: true
      subscription: <i class="conum" data-value="7"></i><b>(7)</b>
        channel: stable
        source: redhat-operators
        approval: Automatic
        operatorName: cluster-logging
        sourceNamespace: openshift-marketplace
      operatorgroup: <i class="conum" data-value="8"></i><b>(8)</b>
        create: true
        notownnamespace: false

    loki-operator: <i class="conum" data-value="9"></i><b>(9)</b>
      enabled: true
      namespace: <i class="conum" data-value="10"></i><b>(10)</b>
        name: openshift-operators-redhat
        create: true
      subscription: <i class="conum" data-value="11"></i><b>(11)</b>
        channel: stable-5.8
        approval: Automatic
        operatorName: loki-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup: <i class="conum" data-value="12"></i><b>(12)</b>
        create: true
        notownnamespace: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Activate Console Plugin. This will trigger a Kubernetes Job, that will modify the current list of console plugins and add the new plugin to it.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>List of plugins that should be added by the Job. The name of that plugin must be known. In the case of OpenShift Logging it is called <strong>logging-view-plugin</strong></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Key of the first operator: <strong>cluster-logging-operator</strong>. Everything below here will define the settings for the Logging Operator.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Is this Operator enabled yes/no.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Syncwave for the Operator deployment. (Subscription and OperatorGroup etc.) This should be early enough for other tasks.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The Namespace where the Operator shall be deployed and if this namespace shall be created.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Configuration of the Subscription resource. This defines the channel (version) that shall be used and whether the approval of the installPlan shall happen automatically or not.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>Configuration of the OperatorGroup. Typically, you will need one when you create a new Namespace. <em>Notownnamespace</em> defines whether or not the targetNamespace is configured for this Operator or if the Operator is available in any Namespace.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>Key of the second Operator: <strong>loki-operator</strong>. Everything below here will define the settings for the Logging Operator.</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>The Namespace where the Operator shall be deployed, must be <strong>openshift-operators-redhat</strong> and if this namespace shall be created.</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Configuration of the Subscription resource. This defines the channel (version) that shall be used and whether the approval of the installPlan shall happen automatically or not.</td>
</tr>
<tr>
<td><i class="conum" data-value="12"></i><b>12</b></td>
<td>Configuration of the OperatorGroup</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The <strong>approval</strong> setting can either be <em>Automatic</em> or <em>Manual</em>. If the Operator requires approval to be installed, then this must either be done manually (via WebUI or CLI) or using the <strong>helper-status-checker</strong> chart which automatically can approve existing installPlans (explained in the next section). This is helpful, to automatically deploy the first version of the Operator without the need for manual intervention.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a> to find additional possible configurations. Also, verify the separate article <a href="https://blog.stderr.at/openshift/2023/03/operator-installation-with-argo-cd/">Operator Installation with Argo CD</a> to understand why I am verifying the status of the Operator installation.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_verifying_the_operator_deployment">Verifying the Operator Deployment</h3>
<div class="paragraph">
<p>An Operator deployment can take some time and before you continue to configure the operator’s CRDs you must be sure that the installation finished successfully. Otherwise, the synchronization in Argo CD will fail because the CRD is not ready.</p>
</div>
<div class="paragraph">
<p>There are mainly two tactics to really verify the status of the Operator:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Simply retry a failed sync in Argo CD. This can be done automatically x-times.</p>
</li>
<li>
<p>Verify if the Operator installation succeeded by starting a Kubernetes Job that monitors the status.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
(Custom) Health checks in Argo CD proved to be not 100% accurate because sometimes the Operator says it is &#34;Ready&#34; but the CRD still cannot be configured for some seconds. Looking at you Compliance Operator …​.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>I chose the second option, simply because I could also add a second Job that approved pending installPlans in case the deployment was set to manual approval.</p>
</div>
<div class="paragraph">
<p>The Helm Chart <strong><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">helper-status-checker</a></strong> has two main purposes:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Start a Kubernetes Job to verify the status of one or multiple Operator installation(s)</p>
</li>
<li>
<p>Optional: start a Kubernetes Job to approve the installPlan(s)</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>An example configuration, that verifies two Operators, looks like the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-status-checker:
  enabled: true <i class="conum" data-value="1"></i><b>(1)</b>
  approver: false <i class="conum" data-value="2"></i><b>(2)</b>

  # List of checks that shall be performed.
  checks:
    - operatorName: cluster-logging <i class="conum" data-value="3"></i><b>(3)</b>
      # -- OPTIONAL: Name of subscription that shall be approved. In some cases the name of the Subscription is different to the name of the operator.
      # @default --operatorName
      subscriptionName: cluster-logging-operator <i class="conum" data-value="4"></i><b>(4)</b>

      namespace: <i class="conum" data-value="5"></i><b>(5)</b>
        name: openshift-logging

      serviceAccount: <i class="conum" data-value="6"></i><b>(6)</b>
        name: &#34;status-checker-logging&#34;

    - operatorName: loki-operator <i class="conum" data-value="7"></i><b>(7)</b>
      namespace:
        name: openshift-operators-redhat

      serviceAccount:
        name: &#34;status-checker-loki&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Enable the status checker.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enable the installPlan approver. Only required if the approval strategy for an Operator is set to <em>Manual</em>.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Verify the status of the first Operator <strong>cluster-logging</strong></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Sometimes the name of the Subscription differs from the Operator name. Logging is such a case. To be able to find which Subscription should be verified, the subscriptionName must be defined here.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Namespace for OpenShift Logging</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Name of the ServiceAccount that will be created to verify the status of the logging operator.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Settings for the 2nd operator: Loki. This one is running in a different Namespace and must be verified there.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Operator Status Checker</a> to find additional possible configurations.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>At this stage, the Operators have been deployed and they have been verified if the deployment was finished successfully.</p>
</div>
<div class="paragraph">
<p>Now the real complex part can start…​</p>
</div>
</div>
<div class="sect2">
<h3 id="_creating_a_new_backingstore_for_openshift_data_foundation">Creating a new BackingStore for OpenShift Data Foundation</h3>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
If you want to use a different storage solution or you have a bucket already, you can skip this section and simply create the LokiStack Secret manually.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In the case that ODF is used and a BackingStore together with a BucketClass shall be created another sub-chart called <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-objectstore" rel="noopener" target="_blank">Helper ObjectStore</a> can be used.</p>
</div>
<div class="paragraph">
<p>It will help you to create a:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>BackingStore</p>
</li>
<li>
<p>BucketClass</p>
</li>
<li>
<p>StorageClass</p>
</li>
<li>
<p>BucketClaim</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This fully automates the creation of the bucket and the required Class when using ODF. As a prerequisite, OpenShift Data Foundation (ODF) must be configured and available of course.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This is completely optional. If you want to use a different storage solution and have the buckets ready, you can simply create the Secret that Loki requires to authenticate at the storage. In this case, you can ignore this and the next section.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following example will create a BackingStore with the size of 700Gi for our OpenShift Logging. A bucket named <strong>logging-bucket</strong> is created and can be used to store the logs.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-objectstore:
  enabled: true
  syncwave: 1 <i class="conum" data-value="1"></i><b>(1)</b>
  backingstore_name: logging-backingstore <i class="conum" data-value="2"></i><b>(2)</b>
  backingstore_size: 700Gi <i class="conum" data-value="3"></i><b>(3)</b>
  limits_cpu: 500m <i class="conum" data-value="4"></i><b>(4)</b>
  limits_memory: 2Gi

  pvPool: <i class="conum" data-value="5"></i><b>(5)</b>
    numOfVolumes: 1
    type: pv-pool

  baseStorageClass: gp3-csi <i class="conum" data-value="6"></i><b>(6)</b>
  storageclass_name: logging-bucket-storage-class <i class="conum" data-value="7"></i><b>(7)</b>

  bucket: <i class="conum" data-value="8"></i><b>(8)</b>
    enabled: true
    name: logging-bucket
    namespace: openshift-logging
    syncwave: 2
    storageclass: logging-bucket-storage-class</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Syncwave to create the BackingStore.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Name of the Backingstore.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Size of the BackingStore. 700Gi is good enough for testing Logging. Keep in mind that data retention should be configured separately for <a href="/openshift/2024/02/openshift-data-foundation-noobaa-bucket-data-retention-lifecycle/">Noobaa</a>.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Limit for CPU and Memory for the Noobaa (BackingStore) pod. They might need to be adjusted since the original ones are quite small for bigger buckets.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Pool of Persistent Volumes. Currently <strong>pv-pool</strong> is supported by the chart only.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The basic storage class that shall be used to virtualize ODF object storage on.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The name of the StorageClass that will be created and used by the BackingStore.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The configuration of the Bucket and its namespace and storageClass (defined at &lt;7&gt;)</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Eventually, the BackingClass and the BucketClaim are created and ready.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/logging-objectstore.png?width=720px" alt="Ready BackingStore and bound BucketClaim"/>
</div>
<div class="title">Figure 3. Ready BackingStore and bound BucketClaim</div>
</div>
<div class="sect3">
<h4 id="_custom_argo_cd_health_check_for_backingstore">Custom Argo CD Health Check for BackingStore</h4>
<div class="paragraph">
<p>The creation of the BackingStore is a process that will take several minutes. Storage must be prepared, and several services must be started. To let Argo CD wait until the BackingStore is fully operational, instead of blindly continuing with the deployment of Loki and Logging, a custom <strong>Health Check</strong> in Argo CD might help.</p>
</div>
<div class="paragraph">
<p>The following health check should be placed into the Argo CD resource. Be aware, that there might be others already defined.</p>
</div>
<div class="paragraph">
<p>The status of the BackingStore resource inside Argo CD will continue <em>progressing</em> until the status of the resource becomes <em>Ready</em>.</p>
</div>
<div class="paragraph">
<p>Due to different syncwaves, Argo CD will wait for the Ready-status before it continues deploying Loki and Logging.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  resourceHealthChecks:
    - check: |
        hs = {}
        if obj.status ~= nil then
          if obj.status.phase ~= nil then
            if obj.status.phase == &#34;Ready&#34; then
              hs.status = &#34;Healthy&#34;
              hs.message = obj.status.phase
              return hs
            end
          end
        end
        hs.status = &#34;Progressing&#34;
        hs.message = &#34;Waiting for BackinbgStore to complete&#34;
        return hs
      group: noobaa.io
      kind: BackingStore</code></pre>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_generating_secret_for_lokistack">Generating Secret for LokiStack</h3>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
If you want to use a different storage solution or you have a bucket already, you can skip this section and simply create the LokiStack Secret manually.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Creating the BackingStore and the BucketClaim will generate a Secret and a ConfigMap inside the target namespace. These hold the information about the connection to the object storage.
Both resources are named as the bucket.
The Secret contains the keys: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY while the ConfigMap stores the information about the URL, region etc.</p>
</div>
<div class="paragraph">
<p>While this is all we need to connect to the object store, Loki itself unfortunately requires a different Secret with a specific format.
Before Loki can be configured, this Secret must be created, containing the keys: access_key_id, access_key_secret, bucketnames, endpoint and region (could be empty)</p>
</div>
<div class="paragraph">
<p>To automate the process another Helm Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-loki-bucket-secret" rel="noopener" target="_blank">Helper Loki Bucket Secret</a> has been created (we have too few charts) that has the only task to wait until the object store has been created, read the ConfigMap and the Secret and create the required Secret for Loki for us. Easy …​</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-loki-bucket-secret:
  enabled: true
  syncwave: 3
  namespace: openshift-logging <i class="conum" data-value="1"></i><b>(1)</b>
  secretname: logging-loki-s3 <i class="conum" data-value="2"></i><b>(2)</b>

  bucket:
    name: logging-bucket <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Namespace we are working in</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The name of the Secret that shall be created</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The name of the bucket that was created in the previous step to find the source information.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>A Kubernetes Job is created, that will mount the created Secret and ConfigMap, read their values and create the Secret we need. It will simply execute the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">oc create secret generic {{ .secretname }} --from-literal access_key_id=${bucket_user} \
  --from-literal access_key_secret=${bucket_secret} \
  --from-literal bucketnames=${bucket_name} \
  --from-literal endpoint=https://${bucket_host} \
  --from-literal region=${bucket_region} \</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This is completely optional. If you want to use a different storage solution and have the buckets ready, you can simply create the Secret (Sealed or inside a Vault) and put it into the wrapper chart. In this case, you can ignore this section.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configuring_the_lokistack">Configuring the LokiStack</h3>
<div class="paragraph">
<p>Up until now, all we did was the deployment of the Operators, verifying if they were ready, creating the object storage and the Secret that will be required by Loki. At this point, we can configure Loki by creating the resource LokiStack. This will start a lot of Pods (depending on your selected size). Loki itself then takes care to push the logs into the object store and to query them etc.</p>
</div>
<div class="paragraph">
<p>Believe it or not, but there is another Helm Chart called <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack" rel="noopener" target="_blank">Helper LokiStack</a> this will configure the service as we need.
The configuration can become very big and the following example shows the main settings. Please consult the README of the Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-lokistack" rel="noopener" target="_blank">Helper LokiStack</a> or the values file from our wrapper chart <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-openshift-logging/values.yaml#L234-L395" rel="noopener" target="_blank">setup-openshift-logging</a>. Especially, the pod placement using tolerations might be interesting, as it must be set per component individually.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-lokistack:
  enabled: true <i class="conum" data-value="1"></i><b>(1)</b>
  name: logging-loki
  namespace: openshift-logging
  syncwave: 3

  # -- This is for log streams only, not the retention of the object store. Data retention must be configured on the bucket.
  global_retention_days: 4

  storage: <i class="conum" data-value="2"></i><b>(2)</b>
    # -- Size defines one of the supported Loki deployment scale out sizes.
    # Can be either:
    #   - 1x.demo
    #   - 1x.extra-small (Default)
    #   - 1x.small
    #   - 1x.medium
    # @default -- 1x.extra-small
    size: 1x.extra-small

    # Secret for object storage authentication. Name of a secret in the same namespace as the LokiStack custom resource.
    secret: <i class="conum" data-value="3"></i><b>(3)</b>
      name: logging-loki-s3

  # -- Storage class name defines the storage class for ingester/querier PVCs.
  # @default -- gp3-csi
  storageclassname: gp3-csi <i class="conum" data-value="4"></i><b>(4)</b>

  # -- Mode defines the mode in which lokistack-gateway component will be configured.
  # Can be either: static (default), dynamic, openshift-logging, openshift-network
  # @default -- static
  mode: openshift-logging <i class="conum" data-value="5"></i><b>(5)</b>

  # -- Control pod placement for LokiStack components. You can define a list of tolerations for the following components:
  # compactor, distributer, gateway, indexGateway, ingester, querier, queryFrontend, ruler
  podPlacements: {}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Basic settings, like Namespace, name of the resource and syncwave.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Size of the LokiStack. Depending on the selected size more or less compute resources will be required. <strong>1x.demo</strong> is for testing only and is not supported for production workload.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Name of the Secret that was created in the previous step (or manually)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>StorageClass that is required for additional workload. This is NOT the object storage.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Mode for the LokiStack Gateway to store the data. Possible values are static, dynamic, openshift-logging and openshift-network.</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_custom_argo_cd_health_check_for_lokistack">Custom Argo CD Health Check for LokiStack</h4>
<div class="paragraph">
<p>As for the BackingStore resource, the LokiStack resource can take a couple of minutes before it is ready. Moreover, it can easily break when there are not enough computing resources available in the cluster. Therefore, I suggest creating another custom health check for Argo CD, to let it wait until the resource is ready. Only when it is ready, Argo CD will continue with the synchronization. Add the following to the <strong>resourceHealthChecks</strong> in your Argo CD resource.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    - check: |
        hs = {}
        if obj.status ~= nil and obj.status.conditions ~= nil then
            for i, condition in ipairs(obj.status.conditions) do
              if condition.type == &#34;Degraded&#34; and condition.reason == &#34;MissingObjectStorageSecret&#34; then <i class="conum" data-value="1"></i><b>(1)</b>
                  hs.status = &#34;Degraded&#34;
                  hs.message = &#34;Missing Bucket Secret&#34;
              end
              if condition.type == &#34;Pending&#34; and condition.reason == &#34;PendingComponents&#34; and condition.status == &#34;True&#34; then <i class="conum" data-value="2"></i><b>(2)</b>
                  hs.status = &#34;Progressing&#34;
                  hs.message = &#34;Some LokiStack components pending on dependencies&#34;
              end
              if condition.type == &#34;Ready&#34; and condition.reason == &#34;ReadyComponents&#34; then <i class="conum" data-value="3"></i><b>(3)</b>
                  hs.status = &#34;Healthy&#34;
                  hs.message = &#34;All components are ready&#34;
              end
            end
            return hs
        end
        hs.status = &#34;Progressing&#34; <i class="conum" data-value="4"></i><b>(4)</b>
        hs.message = &#34;Waiting for LokiStack to deploy.&#34;
        return hs
      group: loki.grafana.com
      kind: LokiStack</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>In LokiStack resources, if the fields &#39;status.conditions.condition.type&#39; is &#34;Degraded&#34; and &#39;status.conditions.condition.reason&#39; is MissingObjectStoreSecret then set the synchronization in Argo CD to <strong>Degraded</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>In LokiStack resources, if the fields &#39;status.conditions.condition.type&#39; is &#34;Pending&#34; and &#39;status.conditions.condition.reason&#39; is PendingComponents and &#39;status.conditions.condition.status&#39; is True then set the synchronization in Argo CD to <strong>Progressing</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>In LokiStack resources, if the fields &#39;status.conditions.condition.type&#39; is &#34;Ready&#34; and &#39;status.conditions.condition.reason&#39; is ReadyComponents then set the synchronization in Argo CD to <strong>Healthy</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Per default set the status to <strong>Progressing</strong>.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_configuring_clusterlogging">Configuring ClusterLogging</h3>
<div class="paragraph">
<p>Finally, the time …​ or should I say syncwave …​ has come to actually deploy the Logging components. The Operators are deployed, the object storage has been created and LokiStack is running.</p>
</div>
<div class="paragraph">
<p>The following settings will start the deployment of the ClusterLogging resource. As usual, please read the README of the Chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/openshift-logging" rel="noopener" target="_blank">OpenShift Logging</a> to find additional settings, such as tolerations etc.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">openshift-logging:

  loggingConfig:
    enabled: true
    syncwave: &#39;4&#39; <i class="conum" data-value="1"></i><b>(1)</b>

    logStore: <i class="conum" data-value="2"></i><b>(2)</b>
      type: lokistack

      lokistack: logging-loki

      visualization: <i class="conum" data-value="3"></i><b>(3)</b>
        type: ocp-console

      collection: <i class="conum" data-value="4"></i><b>(4)</b>
        type: vector</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>The next syncwave, should be after LokiStack deployment.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Define the logStore (LokiStack) and its type (Loki or Elasticsearch). Please note that Elasticsearch as storage is deprecated and will be removed in the future. In my chart, I already removed the support for Elasticsearch</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Type of virtualisation: should be <strong>ocp-console</strong> since Kibana and Elasticsearch are deprecated.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Type of collection: should be <strong>vector</strong> since Fluentd and Elasticsearch are deprecated.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This will deploy the ClusterLogging resource and OpenShift Logging is finally deployed. In the WebUI of OpenShift, you should now see at Observe &gt; Logs the log files for the cluster.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/logging-installed.png?width=940px" alt="OpenShift Logging"/>
</div>
<div class="title">Figure 4. OpenShift Logging</div>
</div>
<div class="paragraph">
<p>For individual Pods, a new tab called Aggregated Logs is available too:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/logging-podtab.png?width=940px" alt="Aggregated Logs tab"/>
</div>
<div class="title">Figure 5. Aggregated Logs tab</div>
</div>
<div class="sect3">
<h4 id="_custom_argo_cd_health_check_for_clusterlogging">Custom Argo CD Health Check for ClusterLogging</h4>
<div class="paragraph">
<p>One last thing to mention is the 3rd health check for Argo CD I usually configure that provides a proper response in the UI when the Logging stack is in a healthy state. The following will verify if the status is &#34;Ready&#34;:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    - check: |
        hs = {}
        hs.status = &#34;Progressing&#34;
        hs.message = &#34;Progressing ClusterLogging&#34;
        if obj.status ~= nil and obj.status.conditions ~= nil then
            for i, condition in ipairs(obj.status.conditions) do
              if condition.type == &#34;Ready&#34; then
                  hs.status = &#34;Healthy&#34;
                  hs.message = &#34;ClusterLogging is ready&#34;
              end
            end
            return hs
        end
        return hs
      group: logging.openshift.io
      kind: ClusterLogging</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_tips_and_tricks">Tips and Tricks</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>Anchors in yaml files</strong>: Several parameters in the values file will repeat themselves. For example, the name of the LokiStack resource. Typically, I define this as an anchor on the top of the yaml files and then reference it inside the file. This way I see these anchors at the top and can easily change them there:</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">lokistack: &amp;lokistackname logging-loki

[...]

helper-lokistack:
  [...]
  name: *lokistackname

openshift-logging:

  loggingConfig:
   [...]
    logStore:
      lokistack: *lokistackname</code></pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Object Storage Data Retention</strong>: The object storage is configured with a size of 700Gi, but without any lifecycle management. For object storage, the lifecycle (or data retention) is done on the bucket itself, not by the service. Please read the article <a href="/openshift/2024/02/openshift-data-foundation-noobaa-bucket-data-retention-lifecycle/">Noobaa Bucket Data Retention Lifecycle</a> to find out how to configure the data retention.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>OpenShift Logging with all its dependencies, especially when you also want to use OpenShift Data Foundation and automate the bucket creation, is for sure one of the most complex Argo CD Applications I have created. I wanted to create one Application that completely deploys Logging for me, without manual interference. It will become much easier when you do not need to create the ODF bucket and the Secret for Loki. However, in such a case you define the Bucket somewhere else and must create the Secret manually (and put it into the wrapper Helm Chart for example). So probably the effort just shifts to somewhere else.</p>
</div>
<div class="paragraph">
<p>I hope this article was somehow understandable. I am always happy for Feedback, GitHub issues or Pull Requests.</p>
</div>
<div class="paragraph">
<p>One last thing, OpenShift Logging also supports the <strong>forwarding of logs</strong>. This is currently not supported by the Helm Chart per se. I would suggest creating such a resource and storing it in the wrapper Chart. Just be sure that the syncwave is after the ClusterLogging deployment and it will install the resource accordingly.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.7] Configure Buckets in MinIO</title><link>https://blog.stderr.at/gitopscollection/2024-05-17-configure-minio-buckets/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-05-17-configure-minio-buckets/</guid><pubDate>Fri, 17 May 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><description>Configure Buckets in MinIO using a GitOps approach.</description><content:encoded><![CDATA[<div class="paragraph">
<p><a href="https://min.io/" rel="noopener" target="_blank">MinIO</a> is a simple, S3-compatible object storage, built for high-performance and large-scale environments. It can be installed as an Operator to Openshift. In addition, to a command line tool, it provides a WebUI where all settings can be done, especially creating and configuring new buckets. Currently, this is not possible in a declarative GitOps-friendly way.
Therefore, I created the Helm chart <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/minio-configurator" rel="noopener" target="_blank">minio configurator</a>, that will start a Kubernetes Job, which will take care of the configuration.</p>
</div>
<div class="paragraph">
<p>Honestly, when I say I have created it, the truth is, that it is based on an existing <a href="https://github.com/bitnami/charts/tree/main/bitnami/minio" rel="noopener" target="_blank">MinIO Chart by Bitnami</a>, that does much more than just set up a bucket. I took out the bucket configuration part, streamlined it a bit and added some new features, which I required.</p>
</div>
<div class="paragraph">
<p>This article shall explain how to achieve this.</p>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Argo CD (OpenShift GitOps) deployed</p>
</li>
<li>
<p>MinIO including a deployed tenant that is waiting for buckets</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>After MinIO and the Tenant have been deployed, we can <strong>configure and update</strong> a bucket, users, policies and more. Since I do not want to do this manually, the Helm Chart that will be described here creates a Kubernetes Job that leverages the <strong>mc command line tool</strong> to execute certain tasks automatically. The chart will take care of:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>creating a lifecycle policy</p>
</li>
<li>
<p>creating an access policy</p>
</li>
<li>
<p>creating a new user/group. User credentials might be added directly to the values file or, better, are imported as a secret</p>
</li>
<li>
<p>attaching policies to a user/group</p>
</li>
<li>
<p>creating a bucket</p>
</li>
<li>
<p>set a quota for a bucket</p>
</li>
<li>
<p>set tags for a bucket</p>
</li>
<li>
<p>enable versioning for a bucket</p>
</li>
<li>
<p>enable object locking for a bucket (<strong>be aware</strong> that this can only be enabled during the bucket creation)</p>
</li>
<li>
<p>enable bucket replication to a target cluster/bucket</p>
</li>
<li>
<p>execute possible extra commands that are configured in the values file</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>To perform all these tasks Bitnami released a container image: <strong>docker.io/bitnami/minio:2024.5.1-debian-12-r0</strong>
They are updating this image regularly.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Actually, the image can be used to deploy the minio server. At this moment, we are interested in the command line tool only. Bitnami also managing a <em>minio-client</em> image, that can be tested and used. However, I left the original image, which is working very well.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_values">The Values</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
All settings are explained in more detail at: <a class="bare" href="https://github.com/tjungbauer/helm-charts/tree/main/charts/minio-configurator">https://github.com/tjungbauer/helm-charts/tree/main/charts/minio-configurator</a>
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The Job and everything that is required, are executed inside the Tenant namespace. In the following examples, this will be <strong>minio-tenant-namespace</strong>
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_basic_settings">Basic Settings</h3>
<div class="paragraph">
<p>The basic settings are the following. They will define the namespace of the Tenant, the name of the ServiceAccount, the URL of the tenant, Argo CD Hook settings and the image that shall be used for the deployment.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">name: minio-provisioner <i class="conum" data-value="1"></i><b>(1)</b>
namespace: minio-tenant-namespace <i class="conum" data-value="2"></i><b>(2)</b>
synwave: 5 <i class="conum" data-value="3"></i><b>(3)</b>

argoproj: <i class="conum" data-value="4"></i><b>(4)</b>
  hook: Sync
  hook_delete_policy: HookSucceeded

image:
  url: docker.io/bitnami/minio:2024.5.1-debian-12-r0 <i class="conum" data-value="5"></i><b>(5)</b>

# Information of the Minio Cluster
miniocluster: <i class="conum" data-value="6"></i><b>(6)</b>
  url: minio-tenant-api-url
  port: 443

skip_tls_verification: true <i class="conum" data-value="7"></i><b>(7)</b>

# Specifies whether a ServiceAccount should be created
serviceAccount: <i class="conum" data-value="8"></i><b>(8)</b>
  create: true
  name: &#34;minio-provisioner&#34;</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Name of the Kubernetes provisioner Job resource.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Namespace of the MinIO Tenant.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Syncwave of the provisioner Job.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Possible Argo CD hook configuration.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The container image the provisioner Job will use.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The URL of the minio console. This will be used to set the &#34;alias&#34; for the mc command</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Skip verification of TLS for the mc command. This will disable the TLS check for any mc command the Job will execute.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>Information about the ServiceAccount</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_authentication_settings">Authentication Settings</h3>
<div class="paragraph">
<p>To be able to authenticate against MinIO credentials must be provided. This happens, typically, in the form of a Secret:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">auth:
  useCredentialsFiles: true <i class="conum" data-value="1"></i><b>(1)</b>
  secretName: minio-provisioner <i class="conum" data-value="2"></i><b>(2)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Shall a secret mounted as a file be used (preferred)</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Name of the Secret</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The Secret itself requires specific keys and should look like the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">kind: Secret
apiVersion: v1
metadata:
  name: minio-provisioner <i class="conum" data-value="1"></i><b>(1)</b>
  namespace: minio-tenant-namespace <i class="conum" data-value="2"></i><b>(2)</b>
data:
  root-password: &lt;base64 string&gt; <i class="conum" data-value="3"></i><b>(3)</b>
  root-user: &lt;base64 string&gt; <i class="conum" data-value="4"></i><b>(4)</b>
type: Opaque</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Name of the Secret as mentioned in the minio-configurator values files</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Name of the Namespace as mentioned in the minio-configurator values files</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Password to access MinIO</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>User to access MinIO</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
The Secret must exist upfront and is not created by the Helm Chart. Either pick it from a Vault or create a Sealed Secret to be able to store it in Git.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The credentials are called <strong>root-</strong>. Any user that has permission to configure buckets is sufficient here. Still, the keys must be named that way.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_creating_minio_policies">Creating MinIO Policies</h3>
<div class="paragraph">
<p>MinIO uses Policy-Based Access Control to define which actions can be performed on certain resources by an authenticated user.
A policy can be created by the command <strong>mc admin policy</strong>. Our Kubernetes Job will take the configuration from the values file and mount the information as a JSON file, that will be imported into MinIO.</p>
</div>
<div class="paragraph">
<p>The following specification shows the example for OpenShift Logging:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">provisioning:
  enabled: true <i class="conum" data-value="1"></i><b>(1)</b>

  policies:
    - name: openshift-logging-access-policy <i class="conum" data-value="2"></i><b>(2)</b>
      statements:
        - resources: <i class="conum" data-value="3"></i><b>(3)</b>
            - &#34;arn:aws:s3:::openshift-logging&#34;
            - &#34;arn:aws:s3:::openshift-logging/*&#34;
          effect: &#34;Allow&#34; <i class="conum" data-value="4"></i><b>(4)</b>
          actions:
            - &#34;s3:*&#34; <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>In general, enable the provisioning or not</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Name of the policy. Multiple can be defined and assigned to a user or group.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Define the resources the policy should manage access to.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Define the effect: Allow or Deny (default)</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The actions that are allowed. Here: any s3: action</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Multiple policies can be defined in the values file, and it is very important to exactly define the resources, the effect and the actions.
The above configuration will allow the user that has the policy assigned:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>All s3 actions to the bucket openshift-logging and everything inside this bucket (thus two resources)</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>All actions are defined at: <a href="https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#minio-policy" rel="noopener" target="_blank">MinIO Access Management</a>.</p>
</div>
<div class="paragraph">
<p>Another example would be the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  policies:
    - name: custom-bucket-specific-policy
      statements:
        - resources:
            - &#34;arn:aws:s3:::my-bucket&#34;
          actions:
            - &#34;s3:GetBucketLocation&#34;
            - &#34;s3:ListBucket&#34;
            - &#34;s3:ListBucketMultipartUploads&#34;
        - resources:
            - &#34;arn:aws:s3:::my-bucket/*&#34;
          effect: &#34;Allow&#34;
          actions:
            - &#34;s3:AbortMultipartUpload&#34;
            - &#34;s3:DeleteObject&#34;
            - &#34;s3:GetObject&#34;
            - &#34;s3:ListMultipartUploadParts&#34;
            - &#34;s3:PutObject&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>This policy defines the actions in a fine granular way:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>To the bucket <strong>my-bucket</strong> we have three allowed actions (GetBucketLocation, ListBucket and ListBucketMultipartUploads)</p>
</li>
<li>
<p>To everything inside the bucket (/*) we can also Delete, Get, Put objects etc.</p>
</li>
</ol>
</div>
</div>
<div class="sect2">
<h3 id="_creating_a_user">Creating a User</h3>
<div class="paragraph">
<p>The policy that has been created must be assigned to a user (or a group) to be effective. Such a user requires a username, a password and a list of policies that shall be assigned.</p>
</div>
<div class="paragraph">
<p>The required information can be added directly to the values file like this:</p>
</div>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
<strong>This is NOT the recommended way!</strong>
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  # users:
  #   - username: test-username <i class="conum" data-value="1"></i><b>(1)</b>
  #     password: test-password <i class="conum" data-value="2"></i><b>(2)</b>
  #     disabled: false <i class="conum" data-value="3"></i><b>(3)</b>
  #     policies: <i class="conum" data-value="4"></i><b>(4)</b>
  #       - readwrite
  #       - consoleAdmin
  #       - diagnostics
  #     # When set to true, it will replace all policies with the specified.
  #     # When false, the policies will be added to the existing.
  #     setPolicies: false
  # @default -- []</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Username</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>clear text password</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Shall the user be created or not</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>List of policies that shall be assigned</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>As mentioned above: Defining a list of users directly in the values file is <strong>not recommended</strong> as it would mean that the passwords are stored in clear text.</p>
</div>
<div class="paragraph">
<p>Instead, a list of Secrets can be defined:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  usersExistingSecrets:
    - minio-users</code></pre>
</div>
</div>
<div class="paragraph">
<p>The defined Secrets require a specific structure and can be encrypted and stored in Git or a Vault.</p>
</div>
<div class="paragraph">
<p>The data structure is the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: minio-users <i class="conum" data-value="1"></i><b>(1)</b>
type: Opaque
stringData:
  username1: | <i class="conum" data-value="2"></i><b>(2)</b>
    username=username <i class="conum" data-value="3"></i><b>(3)</b>
    password=password <i class="conum" data-value="4"></i><b>(4)</b>
    disabled=false <i class="conum" data-value="5"></i><b>(5)</b>
    policies=openshift-logging-access-policy,readwrite,consoleAdmin,diagnostics <i class="conum" data-value="6"></i><b>(6)</b>
    setPolicies=false <i class="conum" data-value="7"></i><b>(7)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Name of the Secret as referenced in the values file.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>List of users, distinguished by the key &#34;username1&#34;, &#34;username2&#34;, etc.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Username</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Password</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Enabled or disabled</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>List of policies to assign to the user</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Replace or add the policies to an (existing) user.</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_built_in_policies">Built-In Policies</h4>
<div class="paragraph">
<p>MinIO provides several <a href="https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html#built-in-policies" rel="noopener" target="_blank">Built-In Policies</a> that can be attached to a user or group.</p>
</div>
<div class="paragraph">
<p>The following policies will always exist: (Please verify the official documentation for further information)</p>
</div>
<div class="paragraph">
<p><strong>consoleAdmin</strong></p>
</div>
<div class="paragraph">
<p>Grants complete access to all S3 and administrative API operations against all resources on the MinIO deployment.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>s3:*</p>
</li>
<li>
<p>admin:*</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>readonly</strong></p>
</div>
<div class="paragraph">
<p>Grants read-only permissions on any object on the MinIO deployment. The GET action must apply to a specific object without requiring any listing.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>s3:GetBucketLocation</p>
</li>
<li>
<p>s3:GetObject</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>readwrite</strong></p>
</div>
<div class="paragraph">
<p>Grants read and write permissions for all buckets and objects on the MinIO server.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>s3:*</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>diagnostics</strong></p>
</div>
<div class="paragraph">
<p>Grants permission to perform diagnostic actions on the MinIO deployment.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>admin:ServerTrace</p>
</li>
<li>
<p>admin:Profiling</p>
</li>
<li>
<p>admin:ConsoleLog</p>
</li>
<li>
<p>admin:ServerInfo</p>
</li>
<li>
<p>admin:TopLocksInfo</p>
</li>
<li>
<p>admin:OBDInfo</p>
</li>
<li>
<p>admin:BandwidthMonitor</p>
</li>
<li>
<p>admin:Prometheus</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><strong>writeonly</strong></p>
</div>
<div class="paragraph">
<p>Grants write-only permissions to any namespace (bucket and path to object) the MinIO deployment.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>s3:PutObject</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_provisioning_groups">Provisioning Groups</h3>
<div class="paragraph">
<p>Users can be combined into groups and instead of assigning policies to individual users, we can assign them to a whole group.
The idea is the same as for users, except, that we define a list of members for that group:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  groups
    - name: test-group <i class="conum" data-value="1"></i><b>(1)</b>
      disabled: false <i class="conum" data-value="2"></i><b>(2)</b>
      members: <i class="conum" data-value="3"></i><b>(3)</b>
        - username
      policies: <i class="conum" data-value="4"></i><b>(4)</b>
        - readwrite
      # When set to true, it will replace all policies with the specified.
      # When false, the policies will be added to the existing.
      setPolicies: false <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Name of the group.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enabled or disabled.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>List of users that are members of this group.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>List of policies that are assigned to this group.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Replace or add the policies to an (existing) user.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configure_the_bucket">Configure the Bucket</h3>
<div class="paragraph">
<p>Finally, we can configure the bucket itself. A bucket will have a specific configuration, a lifecycle a quota etc.
A list of buckets with different configurations can be defined in the values files.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The only mandatory information is the name of the bucket. It is not required to configure a lifecycle or quota etc.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Let us analyse the following example, which tries to cover all possible settings:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  buckets:
    - name: mybucket <i class="conum" data-value="1"></i><b>(1)</b>
      region: my-region <i class="conum" data-value="2"></i><b>(2)</b>
      versioning: Versioned <i class="conum" data-value="3"></i><b>(3)</b>
      withLock: false <i class="conum" data-value="4"></i><b>(4)</b>
      bucketReplication: <i class="conum" data-value="5"></i><b>(5)</b>
        enabled: true
        targetClusterUrl: replication-target-cluster
        targetClusterPort: 443
        targetBucket: replication-target-bucket
        replicationSettings: <i class="conum" data-value="6"></i><b>(6)</b>
           - existing-objects
        credSecretName: replication-credentials <i class="conum" data-value="7"></i><b>(7)</b>
      lifecycle:
        - id: name-of-lifecycle <i class="conum" data-value="8"></i><b>(8)</b>
          prefix: test-prefix <i class="conum" data-value="9"></i><b>(9)</b>
          disabled: false
          expiry: <i class="conum" data-value="10"></i><b>(10)</b>
            days: 30 # or date
            nonconcurrentDays: 10
        - id: name-of-second-lifecycle
          disabled: false
          expiry:
            deleteMarker: true
            nonconcurrentDays: 10
      quota: <i class="conum" data-value="11"></i><b>(11)</b>
        type: set
        size: 1024Gib
      tags: <i class="conum" data-value="12"></i><b>(12)</b>
        key1: value1</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Name of the bucket.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Region of the bucket</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Enable versioning (<a class="bare" href="https://docs.min.io/docs/minio-client-complete-guide.html#ilm">https://docs.min.io/docs/minio-client-complete-guide.html#ilm</a>). Allowed options are: Versioned, Suspended or Unchanged.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Enable object Locking</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Configure bucket replication to a target cluster and a target bucket</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Define the settings for the bucket replication can be: delete, delete-marker or existing-objects: <a class="bare" href="https://min.io/docs/minio/linux/administration/bucket-replication/enable-server-side-one-way-bucket-replication.html">https://min.io/docs/minio/linux/administration/bucket-replication/enable-server-side-one-way-bucket-replication.html</a></td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Name of the Secret that stores the credentials for the replication</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>Define a list of lifecycle policies for the bucket: <a class="bare" href="https://min.io/docs/minio/linux/administration/object-management/object-lifecycle-management.html">https://min.io/docs/minio/linux/administration/object-management/object-lifecycle-management.html</a></td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>A prefix that can be defined</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>Define the expiration. This can be defined as <strong>days</strong> OR as a <strong>date</strong>, for example &#34;2021-11-11T00:00:00Z&#34;</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Set a quota for the bucket: <a class="bare" href="https://docs.min.io/docs/minio-admin-complete-guide.html#bucket">https://docs.min.io/docs/minio-admin-complete-guide.html#bucket</a></td>
</tr>
<tr>
<td><i class="conum" data-value="12"></i><b>12</b></td>
<td>Define additional tags for the bucket <a class="bare" href="https://docs.min.io/docs/minio-client-complete-guide.html#tag">https://docs.min.io/docs/minio-client-complete-guide.html#tag</a></td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_replication_secret">Replication Secret</h4>
<div class="paragraph">
<p>The definition above defines a bucket replication. To authenticate at the target cluster, we need to provide a username and a password. This is stored inside a secret:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Secret
metadata:
  name: replication-user
type: Opaque
stringData:
    username: username
    password: password</code></pre>
</div>
</div>
<div class="paragraph">
<p>This defines a whole bunch of settings. Except for the bucket name, none is mandatory.</p>
</div>
</div>
<div class="sect3">
<h4 id="_example_openshift_logging_bucket">Example OpenShift-Logging Bucket</h4>
<div class="paragraph">
<p>The following is a more realistic example, for defining a bucket used for OpenShift Logging:</p>
</div>
<div class="paragraph">
<p>It defines the bucket name, with a lifecycle of 4 days and a quota of 1TB:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    buckets:
      - name: openshift-logging
        lifecycle:
          - id: logging-retention
            disabled: false
            expiry:
                days: 4
        quota:
          type: set
          size: 1024GiB</code></pre>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_additional_settings">Additional Settings</h3>
<div class="paragraph">
<p>Finally, there are some additional settings, I would like to mention here. They are completely optional, but might be interesting:</p>
</div>
<div class="paragraph">
<p>Automatically clean up the provisioning job after it has finished:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  cleanupAfterFinished:
    enabled: false
    seconds: 600</code></pre>
</div>
</div>
<div class="paragraph">
<p>Define resources for the provisioning job. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">resources:
  requests:
    cpu: 2
    memory: 512Mi
  limits:
    cpu: 3
    memory: 1024Mi</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Typically, I leave this to <strong>resources: {}</strong>
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Take care of the pod placement and define a nodeSelector and tolerations, for example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  nodeSelector: {}
  tolerations:
    - effect: NoSchedule
      key: infra
      operator: Equal
      value: reserved
    - effect: NoExecute
      key: infra
      operator: Equal
      value: reserved</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With this Helm chart by Bitnami, with a little modification from my side, it is possible to <strong>create and update</strong> buckets, policies, users etc. There is no need, to perform any modification manually in the MinIO WebUI.</p>
</div>
<div class="paragraph">
<p>I am currently using this chart for several bucket configurations, with sometimes more and sometimes fewer settings in the values file. Keep in mind, that many settings, especially for the bucket itself, are completely optional and are not required to create a new bucket. (For example, lifecycle). Please check out the source of the Helm Chart and the values file to get further information: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/minio-configurator" rel="noopener" target="_blank">minio configurator</a>.</p>
</div>
<div class="paragraph">
<p>If you have any feedback or miss something, feel free to create a pull request or an issue :)</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.6] Setup &amp; Configure Advanced Cluster Security</title><link>https://blog.stderr.at/gitopscollection/2024-04-28-installing-advanced-cluster-security/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-04-28-installing-advanced-cluster-security/</guid><pubDate>Sun, 28 Apr 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><category>Security</category><description>Installing and configuring ACS using GitOps approach.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Today I want to demonstrate the deployment and configuration of <strong>Advanced Cluster Security</strong> (ACS) using a GitOps approach. The required operator shall be installed, verified if it is running and then ACS shall be initialized. This initialization contains the deployment of several components:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Central - as UI and as a main component of ACS</p>
</li>
<li>
<p>SecuredClusters - installs a Scanner, Controller pods etc.</p>
</li>
<li>
<p>Console link into OpenShift UI - to directly access the ACS Central UI</p>
</li>
<li>
<p>Job to create an initialization bundle to install the Secured Cluster</p>
</li>
<li>
<p>Job to configure authentication using OpenShift</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Let’s start …​</p>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Argo CD (OpenShift GitOps) deployed</p>
</li>
<li>
<p>App-Of-Apps deployed</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The main components of ACS are the two custom resources: <strong>Central</strong> and <strong>SecuredCluster</strong>. The recommended way to deploy ACS is to use the Operator (alternatives would be the command line or Helm Chart). When I first came across ACS I thought about how to automate the full deployment. I did not want to install the Operator, then the Central, then manually create a so-called init-bundle, then deploy the Secured Cluster, then find the route that has been used, then find the secret that stores the initial administrator credentials and then, finally, log into ACS and activate OpenShift authentication.</p>
</div>
<div class="paragraph">
<p>As you can see there are a lot of tasks to do before I can start a customer demo.</p>
</div>
<div class="paragraph">
<p>At the same time, I started to dig into GitOps and I thought this would be a good option to create my very first Helm Chart.</p>
</div>
<div class="paragraph">
<p>Long story short, I have now a Helm Chart (actually three, because I outsourced some of the features into sub-charts) that automatically does all these things above. Once I am synchronizing my Argo CD Application everything will happen automatically.</p>
</div>
<div class="paragraph">
<p>The <a href="/gitopscollection/2024-04-02-configure_app_of_apps/">Configure App-of-Apps</a> installed an Argo CD Application called <strong>in-cluster-setup-acs</strong>:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup-acs.png?width=720px" alt="Argo CD Application: setup-acs"/>
</div>
<div class="title">Figure 1. Argo CD Application: setup-acs</div>
</div>
<div class="paragraph">
<p>This Argo CD Application used the following path to find the Helm Chart: <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-acs">setup-acs</a></p>
</div>
<div class="paragraph">
<p>This Helm chart is a wrapper chart that uses sub-charts as dependencies to install and configure the operator as well as to do some OpenShift Jobs on top, for example, creating a ConsoleLink or creating an init-bundle.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Please check out the article <a href="/gitopscollection/2024-04-25-installing-compliance-operator/#_why_empty_helm_charts">Setup Compliance Operator</a> on why I am using a wrapper chart.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_installing_advanced_cluster_security">Installing Advanced Cluster Security</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_analysing_chart_yaml">Analysing Chart.yaml</h3>
<div class="paragraph">
<p>Let’s examine the Chart.yaml file to see which dependencies are used:</p>
</div>
<div class="paragraph">
<p>The file looks like the following. Three sub-charts are defined as required to deploy and configure the ACS. This is pretty much the same as it was for the <a href="/gitopscollection/2024-04-25-installing-compliance-operator/#_analysing_chart_yaml">Setup Compliance Operator</a>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v2
name: setup-acs
description: Deploys Advanced Cluster Security (ACS) on target cluster. If enabled Central will be deployed too.
version: 1.0.0
dependencies:
  - name: rhacs-setup <i class="conum" data-value="1"></i><b>(1)</b>
    version: ~1.0.0 <i class="conum" data-value="2"></i><b>(2)</b>
    repository: https://charts.stderr.at/
  - name: helper-operator <i class="conum" data-value="3"></i><b>(3)</b>
    version: ~1.0.23
    repository: https://charts.stderr.at/
  - name: helper-status-checker <i class="conum" data-value="4"></i><b>(4)</b>
    version: ~4.0.0
    repository: https://charts.stderr.at/
    condition: helper-status-checker.enabled <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/rhacs-setup" rel="noopener" target="_blank">RHACS Setup</a></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Version that will be used. The &#34;~&#34; means that the latest version of 1.0.X will be used.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Status Checker</a></td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Only use this dependency when &#34;enabled&#34; is set</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the READMEs of the different Charts for detailed information on how to configure them.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configuration_of_the_chart">Configuration of the Chart</h3>
<div class="paragraph">
<p>To configure Advanced Cluster Security the <strong>values file</strong> of the wrapper Chart must be prepared accordingly.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The important thing here is, that any value that should be bypassed to a sub-chart is defined under the name of the sub-chart. For example, everything under <strong>helper-operator:</strong> will be sent to the helper-operator Chart and is used there for its configuration.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Check out the example <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-acs/values.yaml" rel="noopener" target="_blank">values file</a> I use to configure ACS and the
<a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/rhacs-setup" rel="noopener" target="_blank">README</a> to find further information about the possible settings that can be done.</p>
</div>
<div class="paragraph">
<p>Let’s check the main example, to quickly start:</p>
</div>
</div>
<div class="sect2">
<h3 id="_installing_and_verifying_the_operator">Installing and verifying the Operator</h3>
<div class="paragraph">
<p>The first thing to do is to deploy the Operator and to verify if the Operator installation finished successfully.</p>
</div>
<div class="paragraph">
<p>The two Helm Charts <strong>helper-operator</strong> and <strong>helper-status-checker</strong> are responsible to do so.</p>
</div>
<div class="paragraph">
<p>They are configured as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-operator:
  operators:
    rhacs-operator: <i class="conum" data-value="1"></i><b>(1)</b>
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      syncwave: &#39;0&#39; <i class="conum" data-value="3"></i><b>(3)</b>
      namespace:
        name: rhacs-operator <i class="conum" data-value="4"></i><b>(4)</b>
        create: true
      subscription:
        channel: stable <i class="conum" data-value="5"></i><b>(5)</b>
        approval: Automatic
        operatorName: rhacs-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup: <i class="conum" data-value="6"></i><b>(6)</b>
        create: true
        # rhacs does not support to monitor own namespace,
        # therefore the spec in the OperatorGroup must be empty
        notownnamespace: true

# Subchart helper-status-checker
# checks if ACS operator is ready
helper-status-checker:
  enabled: true <i class="conum" data-value="7"></i><b>(7)</b>

  checks: <i class="conum" data-value="8"></i><b>(8)</b>

    - operatorName: rhacs-operator <i class="conum" data-value="9"></i><b>(9)</b>
      namespace:
        name: rhacs-operator <i class="conum" data-value="10"></i><b>(10)</b>
      syncwave: 3

      serviceAccount:
        name: &#34;status-checker-acs&#34; <i class="conum" data-value="11"></i><b>(11)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Key that can be freely defined. Theoretically, you can deploy multiple operators at once.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Is this Operator enabled yes/no.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Syncwave for the Operator deployment. (Subscription and OperatorGroup etc.)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The Namespace where the Operator shall be deployed and if this namespace shall be created.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Configuration of the Subscription resource.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Configuration of the OperatorGroup</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Enable status checker or not. Default: false</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>List of operators to check. Typically, only one is checked, but there could be more.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>Name of the Operator to check (same as for helper-operator)</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>Namespace where the Operator has been installed (same as for helper-operator)</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Name of the ServiceAccount that will be created to check the status.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the READMEs at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a> and <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Operator Status Checker</a> to find additional possible configurations.
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Also verify the separate article <a href="https://blog.stderr.at/openshift-platform/gitops/2023-03-20-operator-installation-with-argocd/">Operator Installation with Argo CD</a> to understand why I am verifying the status of the Operator installation.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configuring_advanced_cluster_security">Configuring Advanced Cluster Security</h3>
<div class="paragraph">
<p>Besides the deployment of the Operator, the configuration of ACS is the most important part here. The ACS Operator provides two custom resources: Central and SecuredCluster. On the Central cluster both CRDs are required. On any other (spoke) cluster, the SecuredCluster resource is enough.</p>
</div>
<div class="paragraph">
<p>In the following example, I am going to configure both Central and SecuredCluster. Since the values file is quite huge I removed most of the additional comments, to keep this article short and readable.
You can read the example values file or the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/rhacs-setup" rel="noopener" target="_blank">Advanced Cluster Security Chart</a> to find additional possible configurations. Especially, if you like to add tolerations or set resource limits.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">#########################################
# Settings for Advanced Cluster Security
#########################################
rhacs-setup:
  rhacs:

    namespace: <i class="conum" data-value="1"></i><b>(1)</b>
      name: stackrox
      syncwave: &#39;0&#39;
      descr: &#39;Red Hat Advanced Cluster Security&#39;

    ################
    # CENTRAL of ACS
    ################
    # Settings for the Central of ACS
    central: <i class="conum" data-value="2"></i><b>(2)</b>
      enabled: true
      syncwave: &#39;3&#39;
      egress:
        connectivityPolicy: Online

      ###############
      # CENTRAL DB
      ###############
      # Settings for Central DB, which is responsible for data persistence.
      db: <i class="conum" data-value="3"></i><b>(3)</b>
        # -- Set Central DB resources.requests for a DEMO environment to save resources.
        resources:
          requests:
            cpu: &#39;1&#39;
            memory: &#39;1Gi&#39;

        # -- If you want this component to only run on specific nodes, you can
        # configure tolerations of tainted nodes.
        tolerations: {}
        #   - effect: NoSchedule
        #     key: infra
        #     operator: Equal
        #     value: reserved
        #   - effect: NoSchedule
        #     key: infra
        #     operator: Equal
        #     value: reserved

    ###############
    # SCANNER
    ###############
    scanner: <i class="conum" data-value="4"></i><b>(4)</b>
      enabled: true

      analyzer:
        # The following settings are NOT suitable for a production environment
        autoscaling:
          status: &#34;Disabled&#34;
          max: 1
          min: 1
          # When autoscaling is disabled, the number of replicas will always be
          # configured to match this value.
          replicas: 1
        tolerations: {}

      ###############
      # SCANNER DB
      ###############
      db:
        tolerations: {}

    #################
    # SECURED CLUSTER
    #################
    secured_cluster: <i class="conum" data-value="5"></i><b>(5)</b>
      enabled: true
      syncwave: &#39;4&#39;
      clustername: local-cluster

      sensor:
        tolerations: {}

      admissioncontrol:
        listenOn:
          creates: true
          events: true
          updates: true
        tolerations: {}

    # -- Basic settings for ACS authentication
    # This configuration is done by a Job, that will configure the OpenShift oauth for ACS.
    basic_acs_settings: <i class="conum" data-value="6"></i><b>(6)</b>
      auth_provider: &#39;OpenShift&#39;
      auth_provider_type: &#39;openshift&#39;
      min_access_role: &#39;None&#39;
      syncwave: 5

    ####################################################
    # Additional settings for Central and possible Jobs
    ####################################################
    job_vars: <i class="conum" data-value="7"></i><b>(7)</b>
      max_attempts: 20

    job_init_bundle: <i class="conum" data-value="8"></i><b>(8)</b>
      enabled: true
      syncwave: &#39;3&#39;

    consolelink: <i class="conum" data-value="9"></i><b>(9)</b>
      enabled: true
      syncwave: &#39;3&#39;
      location: ApplicationMenu
      text: Advanced Cluster Security
      section: Observability</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Create the Namespace <strong>stackrox</strong> and install the ACS resources there.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Enable the Central during Syncwave 3 and set the connectivityPolicy to Online</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The Central DB and its configuration. Here the resource requests are modified to allow a small installation on the DEMO environment. Also, tolerations might be set here, as well a PVCs etc.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Settings for the Scanner and its databases. Again, tolerations might be configurated here, but also, not shown in this example, resource limits and requests and other settings. Since I am configuring for a DEMO environment, I disabled the autoscaler and set the replica to 1.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The SecuredCluster is the 2nd CRD that is provided by ACS Operator. It is installed after the Central (thus a higher Syncwave). The most important setting here is the clustername. In our &#34;local&#34; example, the name is set to <strong>local-cluster</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Some basic settings, that will configure the OpenShift authentication and the minimum role for authenticated users (None)</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Some default settings for Jobs that are started by this Helm chart.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The Job that initializes the creation of the init-bundle</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>The Job and its configuration to generate a direct link to ACS in the OpenShift UI.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>With this ACS is about to be installed on the cluster. Let’s see what will happen during the synchronization.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_deploying_advanced_cluster_security_acs">Deploying Advanced Cluster Security (ACS)</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Let’s hit the sync button inside OpenShift GitOps. This will start the whole process, walking through the syncwaves and the hooks that have been defined.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/syncing-argocd.png?width=720px" alt="Syncing Argo CD"/>
</div>
<div class="title">Figure 2. Syncing Argo CD</div>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Since hooks are used, you must sync the whole Argo CD Application. As you can see inside Argo CD, the hooks are not shown, because they will only appear when their time has come (and will disappear afterward again). This means, that if you perform a selective sync, Argo CD does not know when it should start such a hook and they are never triggered.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The Operator installation is now started. At the moment the Operator has the status <strong>Installing</strong>. Currently, no CRDs (Central or SecuredCluster) are available yet. If we would just let Argo CD continue, it would try to create the Central configuration, based on a CRD which does not yet exist. Thus, the syncing process will fail and therefore the <strong>status-checker</strong> is going to verify if the installation was truly successful.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/installing-operator.png?width=720px" alt="Operator is installed"/>
</div>
<div class="title">Figure 3. Operator is installed</div>
</div>
<div class="paragraph">
<p>The Status Checker is a simple Pod that is triggered by a Kubernetes Job. If waits until the status of the Operator is <strong>Succeeded</strong>. Until this is the case, Argo CD waits before it continues with the synchronization. (It waits until the hook ends the Job)</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/status-checker.png?width=720px" alt="Status Checker"/>
</div>
<div class="title">Figure 4. Status Checker</div>
</div>
<div class="paragraph">
<p>In the logs file of the Pod, we can see that the Operator is ready.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/status-checker-logs.png?width=720px" alt="Status Checker Logs"/>
</div>
<div class="title">Figure 5. Status Checker Logs</div>
</div>
<div class="paragraph">
<p>And indeed, the status of the Operator is now <strong>Succeeded</strong>. Now it is time for Argo CD to continue the synchronization.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/operator-ready.png?width=720px" alt="Operator Ready"/>
</div>
<div class="title">Figure 6. Operator Ready</div>
</div>
<div class="paragraph">
<p>The next step is to create the Central CRD. This will deploy the UI of ACS and the local Scanner. You can also see two other Jobs that have been created by the Helm Charts <strong>create_cluster_link</strong> and <strong>create_cluster_init_bundle</strong>. They will finish when the Central becomes ready.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Until the Central becomes ready, these two additional Jobs may show errors. Do not worry, OpenShift will reschedule them.
</td>
</tr>
</tbody></table>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/installing-central.png?width=720px" alt="Installing Central"/>
</div>
<div class="title">Figure 7. Installing Central</div>
</div>
<div class="paragraph">
<p>You can also see two other Jobs that have been created by the Helm Charts <strong>create_cluster_link</strong> and <strong>create_cluster_init_bundle</strong>. They will finish when the Central becomes ready.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Until the Central becomes ready, these two additional Jobs may show errors. Do not worry, OpenShift will reschedule them.
</td>
</tr>
</tbody></table>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/init-job-waits.png?width=720px" alt="Init Job is waiting for Central"/>
</div>
<div class="title">Figure 8. Init Job is waiting for Central</div>
</div>
<div class="paragraph">
<p>Once the Central has been deployed, the second CRD <strong>SecuredCluster</strong> will be added. This will trigger the installation of the Collectors and other components.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/installing-securedcluster.png?width=720px" alt="Installing Secured Cluster"/>
</div>
<div class="title">Figure 9. Installing SecuredCluster</div>
</div>
<div class="paragraph">
<p>Eventually, all Pods are running at the end. The additional Jobs are completed and ACS is ready to take care of the cluster security.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/acs-all-pods-running.png?width=720px" alt="All Pods running"/>
</div>
<div class="title">Figure 10. All Pods running</div>
</div>
<div class="paragraph">
<p>We can now use the console link that was created.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/acs-consolelink.png?width=720px" alt="ACS ConsoleLink"/>
</div>
<div class="title">Figure 11. ACS ConsoleLink</div>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you disabled the creation of the ConsoleLink you would need to find the Route that ACS Operator created. Honestly, I do not know why the Operator does not create such ConsoleLink out of the box.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Since I am lazy I created another Job that automatically configures authentication via OpenShift for ACS. This way, we can simply use our OpenShift credentials to login.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/acs-login.png?width=720px" alt="ACS Login"/>
</div>
<div class="title">Figure 12. ACS Login</div>
</div>
<div class="paragraph">
<p>And that’s it, we can now use ACS, which was deployed fully automatically.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup_acs/acs.png?width=720px" alt="Advanced Cluster Security"/>
</div>
<div class="title">Figure 13. Advanced Cluster Security</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As you can see Advanced Cluster Security was completely installed. This included the Operator, the Central, the creation and installation of an init-bundle, the creation of a ConsoleLink, the configuration of the SecuredCluster CRD and the initial configuration of the auth provider inside ACS. You can now start using ACS or add additional clusters.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Speaking of additional clusters: The create-cluster-init-bundle created three certificates: collector-tls, sensor-tls and admission-control-tls. They are required so that the SecuredClusters can communicate with the Central. You could now create a separate init-bundle for each SecuredCluster, which is not really easy to automate, or you simply take these created secrets and put them into your GitOps and re-use them for any other SecuredCluster.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>All these steps and configurations seem quite complicated but honestly, it is straightforward. I install any Operator using <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a> and in most cases. I also use <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Operator Status Checker</a> to find additional possible configurations. Both require simple configuration only, which you would need to know anyway when you create the Subscription object manually. Once done, you can repeat this for any other Operator.</p>
</div>
<div class="paragraph">
<p>The real magic happens when the Operator is configured at the same time because this is very individual to the Operator.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>[Ep.5] Setup &amp; Configure Compliance Operator</title><link>https://blog.stderr.at/gitopscollection/2024-04-25-installing-compliance-operator/</link><guid isPermaLink="true">https://blog.stderr.at/gitopscollection/2024-04-25-installing-compliance-operator/</guid><pubDate>Thu, 25 Apr 2024 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>GitOps</category><category>Security</category><description>Install and configure the OpenShift Compliance Operator with GitOps: Subscriptions, ScanSettingBindings and keeping compliance scans under Argo CD.</description><content:encoded><![CDATA[<div class="paragraph">
<p>In the previous articles, we have discussed the <a href="/gitopscollection/2023-12-28-gitops-repostructure/">Git repository folder structure</a> and the configuration of the <a href="/gitopscollection/2024-04-02-configure_app_of_apps/">App-Of-Apps</a>. Now it is time to deploy our first configuration. One of the first things I usually deploy is the <a href="https://docs.openshift.com/container-platform/4.15/security/compliance_operator/co-overview.html" rel="noopener" target="_blank">Compliance Operator</a>. This Operator is recommended for any cluster and can be deployed without any addition to the Subscription.</p>
</div>
<div class="paragraph">
<p>In this article, I will describe how it is installed and how the Helm Chart is configured.</p>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Argo CD (OpenShift GitOps) deployed</p>
</li>
<li>
<p>App-Of-Apps deployed</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As a reminder, at <a href="/gitopscollection/2023-12-28-gitops-repostructure/">Git repository folder structure</a> I described my preferred folder structure. I would like to deploy the Compliance Operator in the Management Cluster now. All my examples can be found at GitHub repository <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops" rel="noopener" target="_blank">OpenShift Clusterconfig GitOps</a>. The folder <strong>clusters/management-cluster/setup-compliance-operator</strong> is the one I am interested in.</p>
</div>
<div class="paragraph">
<p>Inside this folder, you will find another Helm Chart. The Helm Chart has no local templates, instead, it uses dependencies to call other (sub-) charts. However, the <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-compliance-operator/values.yaml" rel="noopener" target="_blank">values.yaml</a> is the main part to configure everything.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
In case you want to have any local template, that you do NOT want to integrate into one of the sub-charts, you can easily do so, by storing them in the templates folder.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_why_empty_helm_charts">Why &#34;empty&#34; Helm Charts?</h3>
<div class="paragraph">
<p>Actually, it would be possible to use the Helm Chart of the Chart repository directly, without creating a separate chart, that does nothing else than using dependency charts.</p>
</div>
<div class="paragraph">
<p>The reasons why I am using such an &#34;empty&#34; Chart are the following (in no particular order):</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>With that way it is possible to add templates (i.e. SealedSecrets) and modify the values-file without packaging and releasing a new Chart version every time you change a small thing.</p>
</li>
<li>
<p>The Multi-Source Option, which allows you to use a Helm Chart from repository A and a values file from repository B is still a TechPreview feature (Argo CD 2.10). I am using this for the App-of-Apps already, but I did not do this for all charts. This feature is on the list for Argo CD version 2.11 to become globally available.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>As an alternative, it is also possible to mix Kustomize and Helm. That way you only need a kustomization.yaml file and reference to a Helm Chart. In the folder <a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/tree/main/clusters/management-cluster/ingresscontroller" rel="noopener" target="_blank">clusters/management-cluster/ingresscontroller</a> I have such an example.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_installing_compliance_operator">Installing Compliance Operator</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_analysing_chart_yaml">Analysing Chart.yaml</h3>
<div class="paragraph">
<p>As any Helm Chart a Chart.yaml file exists, that stores the basic information. The most important ones for now are the dependencies.</p>
</div>
<div class="paragraph">
<p>The file looks like the following. Three sub-charts are defined as required to deploy and configure the Compliance Operator.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v2
name: setup-compliance-operator
description: Deploy and configure the Compliance Operator
version: 1.0.1
dependencies:
  - name: compliance-operator-full-stack <i class="conum" data-value="1"></i><b>(1)</b>
    version: ~1.0.0 <i class="conum" data-value="2"></i><b>(2)</b>
    repository: https://charts.stderr.at/
  - name: helper-operator <i class="conum" data-value="3"></i><b>(3)</b>
    version: ~1.0.21
    repository: https://charts.stderr.at/
  - name: helper-status-checker <i class="conum" data-value="4"></i><b>(4)</b>
    version: ~4.0.0
    repository: https://charts.stderr.at/
    condition: helper-status-checker.enabled <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/compliance-operator-full-stack" rel="noopener" target="_blank">Compliance Operator Full Stack</a></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Version that will be used. The &#34;~&#34; means that the latest version of 1.0.X will be used.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Dependency: <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Status Checker</a></td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Only use this dependency when &#34;enabled&#34; is set</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the READMEs of the different Charts for detailed information on how to configure them.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>As you can see three other Helm Charts are used to actually deploy and configure the Operator.</p>
</div>
</div>
<div class="sect2">
<h3 id="_configuration_of_the_chart">Configuration of the Chart</h3>
<div class="paragraph">
<p>To configure the Compliance Operator, the values files must be prepared accordingly.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
The important thing here is, that any value that should be bypassed to a sub-chart is defined under the name of the sub-chart. For example, everything under <strong>helper-operator:</strong> will be sent to the helper-operator Chart and is used there for its configuration.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The following is a full example of the values I typically use.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Install Operator Compliance Operator
# Deploys Operator --&gt; Subscription and Operatorgroup
helper-operator:
  operators:
    compliance-operator:
      enabled: true
      syncwave: &#39;0&#39;
      namespace:
        name: openshift-compliance
        create: true
      subscription:
        channel: stable
        approval: Automatic
        operatorName: compliance-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup:
        create: true
        notownnamespace: true

# Verify if the Operator has been successfully deployed
helper-status-checker:
  enabled: true

  checks:
    - operatorName: compliance-operator
      namespace:
        name: openshift-compliance
      serviceAccount:
        name: &#34;status-checker-compliance&#34;

# Setting for the Compliance Operator
compliance-operator-full-stack:
  compliance:
    namespace:
      name: openshift-compliance
      syncwave: &#39;0&#39;
      descr: &#39;Red Hat Compliance&#39;
    scansettingbinding:
      enabled: true
      syncwave: &#39;3&#39;

      profiles:
        - name: ocp4-cis-node
          kind: Profile  # Could be Profile or TailedProfile
        - name: ocp4-cis
          kind: Profile
      scansetting: default</code></pre>
</div>
</div>
<div class="paragraph">
<p>Let us walk through the settings in more detail.</p>
</div>
</div>
<div class="sect2">
<h3 id="_installing_the_operator">Installing the Operator</h3>
<div class="paragraph">
<p>The first thing to do is to deploy the Operator. Two resources are relevant to install an Operator:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Subscription</p>
</li>
<li>
<p>OperatorGroup</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Both objects should be deployed at the very beginning of Argo CD synchronisation. This is done by setting the Syncwave to 0.</p>
</div>
<div class="paragraph">
<p>The main settings are the operatorName, the channel (which is the version of the operator) and the approval (which defines if the Operator is updated automatically or manually).</p>
</div>
<div class="paragraph">
<p>In addition, a Namespace object is deployed, because this Operator should run in its very own namespace.</p>
</div>
<div class="paragraph">
<p>This will start the Operator installation process.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">helper-operator:
  operators:
    compliance-operator: <i class="conum" data-value="1"></i><b>(1)</b>
      enabled: true <i class="conum" data-value="2"></i><b>(2)</b>
      syncwave: &#39;0&#39; <i class="conum" data-value="3"></i><b>(3)</b>
      namespace:
        name: openshift-compliance <i class="conum" data-value="4"></i><b>(4)</b>
        create: true
      subscription: <i class="conum" data-value="5"></i><b>(5)</b>
        channel: stable # Version of the Operator
        approval: Automatic # Automatic or Manual
        operatorName: compliance-operator # Name of the Operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup: <i class="conum" data-value="6"></i><b>(6)</b>
        create: true
        notownnamespace: true</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Key that can be freely defined. Theoretically, you can deploy multiple operators at once.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Is this Operator enabled yes/no.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Syncwave for the Operator deployment. (Subscription and OperatorGroup etc.)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The Namespace where the Operator shall be deployed and if this namespace shall be created.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Configuration of the Subscription resource.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Configuration of the OperatorGroup</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a> to find additional possible configurations.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_verify_the_status_of_the_operator">Verify the Status of the Operator</h3>
<div class="paragraph">
<p>After Argo CD creates the subscription and operatorgroup resources (and namespace), OpenShift will start the installation of the Operator. This installation will take a while but Argo CD does not see this. All it sees is that the Subscription resource is available and it tries to continue with the configuration of the Operator. Here it will fail because the CRDs are not available yet.</p>
</div>
<div class="paragraph">
<p>Therefore, I created a mechanism to verify if an Operator is ready or not.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Also verify the separate article <a href="https://blog.stderr.at/openshift-platform/gitops/2023-03-20-operator-installation-with-argocd/">Operator Installation with Argo CD</a> that addresses the problem in more detail.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>All it does is to start a small Job inside OpenShift and to verify the status of the Operator installation. If everything is fine, the Job will end successfully and Argo CD will continue with the next syncwave. Argo CD Hook and syncwaves are required here. The Job should be started <em>after</em> the Subscription/OperatorGroup resources have been created, which means any syncwave after &#34;0&#34;.</p>
</div>
<div class="paragraph">
<p>The following annotations will be used by the Job:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">    argocd.argoproj.io/hook: Sync <i class="conum" data-value="1"></i><b>(1)</b>
    argocd.argoproj.io/hook-delete-policy: HookSucceeded <i class="conum" data-value="2"></i><b>(2)</b>
    argocd.argoproj.io/sync-wave: {{ .syncwave | default 1 | quote }} <i class="conum" data-value="3"></i><b>(3)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Hooks are ways to run scripts before, during, and after a Sync operation.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Deletes the OpenShift Job again. The hook resource is deleted after the hook succeeded (e.g. Job/Workflow completed successfully).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Syncwave: can be configured. Must be after helper-operator (default 0) and before the Operator is configured further. Default value is 1.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The configuration for <strong>hepler_status_checker</strong> will look like the following:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Verify if the Operator has been successfully deployed
helper-status-checker:
  enabled: true <i class="conum" data-value="1"></i><b>(1)</b>

  checks: <i class="conum" data-value="2"></i><b>(2)</b>
    - operatorName: compliance-operator <i class="conum" data-value="3"></i><b>(3)</b>
      namespace:
        name: openshift-compliance <i class="conum" data-value="4"></i><b>(4)</b>
      serviceAccount:
        name: &#34;status-checker-compliance&#34; <i class="conum" data-value="5"></i><b>(5)</b></code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Enable status checker or not. Default: false</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>List of operators to check. Typically, only one is checked, but there could be more.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Name of the Operator to check (same as for helper-operator)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Namespace where the Operator has been installed (same as for helper-operator)</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Name of the ServiceAccount that will be created to check the status.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Operator Status Checker</a> to find additional possible configurations.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_configuring_compliance_operator">Configuring Compliance Operator</h3>
<div class="paragraph">
<p>Finally, the Operator has been deployed and has been verified. Now the time is right to configure the Operator with any configuration we would like. This means, using CRDs to do whatever the Operator offers.</p>
</div>
<div class="paragraph">
<p>This is reflected in the following part of the values file. All these settings are handed over to the sub-chart <strong>compliance-operator-full-stack</strong>.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Verify the README at <a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/compliance-operator-full-stack" rel="noopener" target="_blank">Compliance Operator Chart</a> to find additional possible configurations. Especially, if you like to do Tailored Profiles.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The compliance operator requires a so-called ScanSettingBinding that uses Profiles which are used to check the cluster compliance once a day. In this case, I am using CIS Benchmarks. There are two profiles:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>ocp4-cis-node: will check the node operating system for missing but suggested configuration.</p>
</li>
<li>
<p>ocp4-cis: will check the OpenShift cluster for missing but suggested configuration.</p>
</li>
</ol>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># Setting for the Compliance Operator
compliance-operator-full-stack: <i class="conum" data-value="1"></i><b>(1)</b>
  compliance:
    namespace:
      name: openshift-compliance <i class="conum" data-value="2"></i><b>(2)</b>
      syncwave: &#39;0&#39;
      descr: &#39;Red Hat Compliance&#39;
    scansettingbinding: <i class="conum" data-value="3"></i><b>(3)</b>
      enabled: true
      syncwave: &#39;3&#39;

      profiles: <i class="conum" data-value="4"></i><b>(4)</b>
        - name: ocp4-cis-node
          kind: Profile  # Could be Profile or TailedProfile
        - name: ocp4-cis
          kind: Profile
      scansetting: default</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Handing everything that comes below to the sub-chart <strong>compliance-operator-full-stack</strong></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Namespace where the configuration should be deployed. The Syncwave at this point could be omitted.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The configuration for the ScanSettingBinding. It is enabled (default = false) and has a Syncwave AFTER the helper-status-checker.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The list of profiles that shall be used. These must exist. The Compliance Operator offers several profiles. I usually use these two for full CIS compliance check.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With this configuration, the Compliance Operator will not only be installed but also configured with the same Argo CD Application. All you need to do is to synchronize Argo CD and let the magic happen. After a few minutes, everything should be in sync.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/setup-compliance-operator.png?width=720px" alt="Sync Compliance Operator"/>
</div>
<div class="title">Figure 1. Sync Compliance Operator</div>
</div>
<div class="paragraph">
<p>Inside OpenShift the Operator is configured and starts doing its job:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/gitopscollection/images/configured-compliance-operator.png?width=720px" alt="Configured Compliance Operator"/>
</div>
<div class="title">Figure 2. Configured Compliance Operator</div>
</div>
<div class="paragraph">
<p>This concludes the deployment of the Compliance Operator. For further information about the Operator itself, please read the documentation or articles:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://docs.openshift.com/container-platform/4.15/security/compliance_operator/co-overview.html" rel="noopener" target="_blank">Official Documentation: Compliance Operator</a></p>
</li>
<li>
<p><a href="https://blog.stderr.at/compliance/2021/07/compliance-operator/">Blog: Compliance Operator</a></p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Also, be sure to check out the READMEs of the different Charts:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-operator" rel="noopener" target="_blank">Helper Operator</a></p>
</li>
<li>
<p><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/helper-status-checker" rel="noopener" target="_blank">Helper Operator Status Checker</a></p>
</li>
<li>
<p><a href="https://github.com/tjungbauer/helm-charts/tree/main/charts/compliance-operator-full-stack" rel="noopener" target="_blank">Compliance Operator Chart</a></p>
</li>
<li>
<p><a href="https://github.com/tjungbauer/openshift-clusterconfig-gitops/blob/main/clusters/management-cluster/setup-compliance-operator/" rel="noopener" target="_blank">Compliance Operator Setup</a></p>
</li>
</ol>
</div>
<div class="paragraph">
<p>If you have any questions or problems, feel free to create a GitHub issue at any time.</p>
</div>
</div>
</div>]]></content:encoded></item></channel></rss>