<?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>TechBlog about OpenShift/Ansible/Satellite and much more</title><link>https://blog.stderr.at/</link><description>Practical OpenShift, Ansible Automation Platform, GitOps, and Kubernetes guides from the field.</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/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>ValidatingAdmissionPolicy and how to use it</title><link>https://blog.stderr.at/openshift-platform/security/compliance/2026-10-15-namespace-labels-validating-admission-policy/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/compliance/2026-10-15-namespace-labels-validating-admission-policy/</guid><pubDate>Thu, 15 Oct 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><category>Compliance</category><description>Enforce mandatory ownership labels on OpenShift namespaces with a CEL ValidatingAdmissionPolicy—and block removal of those labels after creation.</description><content:encoded><![CDATA[<div class="paragraph">
<p>In my last article about the Compliance Operator, <a href="/openshift-platform/security/compliance/2026-10-09-compliance-operator-customrules-cel/">Compliance Operator: Writing Your Own Checks with CEL and CustomRules</a>, we discussed <code>CustomRule</code> and how they can enhance the Compliance Operator. CustomRules are good for defining your own policies, for example to check whether a namespace is created with the correct labels. But they cannot stop someone from changing something on the cluster.</p>
</div>
<div class="paragraph">
<p>The Compliance Operator can <strong>detect</strong> violations, but it cannot <strong>prevent</strong> them. This is where <code>ValidatingAdmissionPolicy</code> comes in. It is a native Kubernetes feature that runs directly inside the kube-apiserver. It uses the same language as the CustomRules, CEL, and it can be used to prevent violations from happening in the first place.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this article we will write a policy that:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>rejects the creation of an application namespace without the mandatory labels <code>example.com/owner</code> and <code>example.com/cost-centre</code>,</p>
</li>
<li>
<p>rejects removing these labels (or setting them to an empty value),</p>
</li>
<li>
<p>ignores platform namespaces, or, in a second variant, only applies to namespaces that follow a naming convention.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The list of excluded platform namespaces is the same as in the Compliance Operator article. This is important: the admission policy and the CustomRule must look at the same set of namespaces, otherwise one of them reports something the other one ignores.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_a_validatingadmissionpolicy">Why a ValidatingAdmissionPolicy?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For a long time, admission control meant writing your own webhook or installing a policy engine such as Gatekeeper or Kyverno. Both are fine tools and worth checking out, but for a simple rule like ours they bring a lot of moving parts that we can avoid if we do not need them.</p>
</div>
<div class="paragraph">
<p>A <code>ValidatingAdmissionPolicy</code> (VAP) is evaluated <strong>inside</strong> the kube-apiserver. The API <code>admissionregistration.k8s.io/v1</code> is available since Kubernetes 1.30, which means OpenShift 4.17 and later. A VAP consists of two objects:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>ValidatingAdmissionPolicy</strong></dt>
<dd>
<p><em>What</em> is checked: which requests are matched and which CEL expressions must be true.</p>
</dd>
<dt class="hdlist1"><strong>ValidatingAdmissionPolicyBinding</strong></dt>
<dd>
<p><em>Where</em> and <em>how</em> the policy is enforced (bound to): which namespaces or objects it applies to and what happens on a violation (<code>Deny</code>, <code>Warn</code>, <code>Audit</code>).</p>
</dd>
</dl>
</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 have followed the <a href="/openshift-platform/security/compliance/2026-10-09-compliance-operator-customrules-cel/">Compliance Operator article</a>, the CEL expressions below will look familiar. The difference: a CustomRule evaluates a <strong>list</strong> of objects on a schedule; a VAP evaluates <strong>one</strong> object at the moment it is created or changed.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>OpenShift 4.17 or newer with cluster-admin permissions.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_designing_the_policy">Designing the Policy</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before writing any YAML, three design decisions have to be made. At the end they will define the policy and its behaviour:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>What exactly is forbidden on UPDATE?</p>
</li>
<li>
<p>Which namespaces are affected?</p>
</li>
<li>
<p>How to roll it out?</p>
</li>
</ol>
</div>
<div class="sect2">
<h3 id="_decision_1_what_exactly_is_forbidden_on_update">Decision 1: What exactly is forbidden on UPDATE?</h3>
<div class="paragraph">
<p>This is an important decision and it hit me hard during my tests. The initial approach would be: <em>&#34;every namespace must always have the labels&#34;</em>, checked on CREATE and UPDATE. This is a TRAP.</p>
</div>
<div class="paragraph">
<p>Kubernetes clusters already contain namespaces without these labels. Controllers and operators update namespaces all the time; for example OpenShift synchronises the Pod Security labels and sets the annotations for the SCC UID ranges. If we enforced the labels on every UPDATE, we would eventually break the platform.</p>
</div>
<div class="paragraph">
<p>Therefore the policy must treat the two operations CREATE and UPDATE differently:</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">Operation</th>
<th class="tableblock halign-left valign-top">Rule</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">CREATE</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All required labels must be present with a non-empty value. If the labels are missing, the request is rejected.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">UPDATE</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A required label that was set before (non-empty) must not be removed or emptied. However, changing the value, for example when the ownership moves to another team, is allowed. Updates of old namespaces that never had the labels are allowed as well. If the label is removed or emptied, the request is rejected.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_decision_2_which_namespaces_are_affected">Decision 2: Which namespaces are affected?</h3>
<div class="paragraph">
<p>Typically, there are two approaches:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><strong>Variant A: exclude platform namespaces</strong></dt>
<dd>
<p>Everything is checked except the platform namespaces. This was used in the Compliance Operator article: everything that starts with <code>openshift</code> or <code>kube-</code>, the namespace <code>default</code>, plus additional namespaces that are used by the platform. Adapt the list to whatever runs on your clusters. This is a good approach, but requires you to maintain the list of namespaces that are excluded.</p>
</dd>
<dt class="hdlist1"><strong>Variant B: namespaces with a naming convention</strong></dt>
<dd>
<p>Only namespaces that follow a convention, for example <code>app-&lt;name&gt;</code>, are checked. Everything else, such as sandboxes or personal projects, is left alone. This is a good approach as well, but requires you to enforce the naming convention when namespaces are created.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="_decision_3_how_to_roll_it_out">Decision 3: How to roll it out?</h3>
<div class="paragraph">
<p>A policy on namespaces affects everybody, including cluster administrators, GitOps tools and the OpenShift project request template. Therefore we start in <code>Warn</code>/<code>Audit</code> mode and switch to <code>Deny</code> once we know that nothing breaks. I mean, it is always good practice to test first :)</p>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_1_the_validatingadmissionpolicy">Step 1: The ValidatingAdmissionPolicy</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Create the following file <code>01-vap-namespace-ownership-labels.yaml</code>. It will check for the existence of the required labels on CREATE and UPDATE requests. Such rules are typically built like this:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>matchConstraints</strong>: decide which requests are matched.</p>
</li>
<li>
<p><strong>matchConditions</strong>: decide which namespaces are affected or not affected.</p>
</li>
<li>
<p><strong>variables</strong>: define the labels that are required.</p>
</li>
<li>
<p><strong>validations</strong>: define the rules that are checked.</p>
</li>
</ol>
</div>
<div class="listingblock">
<div class="title">01-vap-namespace-ownership-labels.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
  name: namespace-ownership-labels
spec:
  failurePolicy: Fail <i class="conum" data-value="1"></i><b>(1)</b>
  matchConstraints: <i class="conum" data-value="2"></i><b>(2)</b>
    resourceRules:
      - apiGroups: [&#34;&#34;]
        apiVersions: [&#34;v1&#34;]
        operations: [&#34;CREATE&#34;, &#34;UPDATE&#34;]
        resources: [&#34;namespaces&#34;]
  matchConditions: <i class="conum" data-value="3"></i><b>(3)</b>
    - name: exclude-platform-namespaces
      expression: &gt;-
        !object.metadata.name.matches(&#39;^(openshift.*|kube-.*|open-cluster-management.*|cert-manager.*|stackrox.*|rhacs-.*|default)$&#39;)
  variables:
    - name: requiredLabels <i class="conum" data-value="4"></i><b>(4)</b>
      expression: &gt;-
        [&#39;example.com/owner&#39;, &#39;example.com/cost-centre&#39;]
    - name: missingLabels <i class="conum" data-value="5"></i><b>(5)</b>
      expression: &gt;-
        variables.requiredLabels.filter(key,
          !has(object.metadata.labels) ||
          !(key in object.metadata.labels) ||
          object.metadata.labels[key] == &#39;&#39;)
    - name: removedLabels <i class="conum" data-value="6"></i><b>(6)</b>
      expression: &gt;-
        request.operation != &#39;UPDATE&#39; || !has(oldObject.metadata.labels) ? [] :
        variables.missingLabels.filter(key,
          key in oldObject.metadata.labels &amp;&amp;
          oldObject.metadata.labels[key] != &#39;&#39;)
  validations:
    - expression: &gt;- <i class="conum" data-value="7"></i><b>(7)</b>
        request.operation != &#39;CREATE&#39; || size(variables.missingLabels) == 0
      messageExpression: &gt;- <i class="conum" data-value="8"></i><b>(8)</b>
        &#39;Namespace &#39; + object.metadata.name + &#39; must carry the label(s) &#39; +
        variables.missingLabels.join(&#39;, &#39;) + &#39; with a non-empty value.&#39;
      reason: Invalid
    - expression: &gt;- <i class="conum" data-value="9"></i><b>(9)</b>
        size(variables.removedLabels) == 0
      messageExpression: &gt;-
        &#39;The label(s) &#39; + variables.removedLabels.join(&#39;, &#39;) +
        &#39; must not be removed from namespace &#39; + object.metadata.name +
        &#39; or set to an empty value.&#39;
      reason: Forbidden</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td><code>failurePolicy: Fail</code> rejects the request if the expression cannot be evaluated. The other option is <code>Ignore</code>. For a required policy that must always be applied this is the right choice.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The policy matches <strong>CREATE</strong> and <strong>UPDATE</strong> requests for namespaces. <strong>DELETE</strong> is not matched, so namespaces can still be removed.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>matchConditions</code> decide whether the policy applies to a request at all. Here, the platform namespaces are skipped (Variant A). The regular expression is the same as in the CustomRules. Do not forget the anchors <code>^</code> and <code>$</code>: without them <code>matches()</code> searches for a substring.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td><code>variables</code> define the labels that are required. <code>requiredLabels</code> is the single place where the label keys are defined.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td><code>missingLabels</code> is the list of required labels that are missing or empty in the <strong>new</strong> object.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td><code>removedLabels</code> is the list of labels that are missing now but were set (non-empty) in <code>oldObject</code>. For CREATE requests there is no <code>oldObject</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Validation for CREATE: nothing may be missing.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td><code>messageExpression</code> gives feedback to the user and tells <strong>which</strong> labels are the problem.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>Validation for UPDATE: nothing that existed may be removed.</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 exclusion regex now lives in three places: the CEL <code>expression</code> of the CustomRule and in its <code>instructions</code>, and this policy. When you change one of them, change all three.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_2_the_binding">Step 2: The Binding</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As a second step we need to bind the policy to the namespaces that are affected (all). For the first test we only warn and write audit events. Create the file <code>02-vapbinding-namespace-ownership-labels.yaml</code>:</p>
</div>
<div class="listingblock">
<div class="title">02-vapbinding-namespace-ownership-labels.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
  name: namespace-ownership-labels
spec:
  policyName: namespace-ownership-labels <i class="conum" data-value="1"></i><b>(1)</b>
  validationActions: [&#34;Warn&#34;, &#34;Audit&#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>Reference to the name of the policy.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td><code>validationActions</code> tells Kubernetes what to do on a violation: <code>Warn</code> returns a warning to the client, <code>Audit</code> adds the violation to the API audit log. The other option is <code>Deny</code>.</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_3_apply_the_policy_and_initial_test">Step 3: Apply the Policy and initial test</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Apply both objects:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f 01-vap-namespace-ownership-labels.yaml
oc apply -f 02-vapbinding-namespace-ownership-labels.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>and check that the API server has accepted the expressions.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get validatingadmissionpolicy namespace-ownership-labels -o jsonpath=&#39;{.status}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>In <code>Warn</code> mode, creating a namespace without labels still works, but <code>oc</code> shows a warning:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create namespace app-warn</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">Warning: Validation failed for ValidatingAdmissionPolicy &#39;namespace-ownership-labels&#39; with binding &#39;namespace-ownership-labels&#39;: Namespace app-warn must carry the label(s) example.com/owner, example.com/cost-centre with a non-empty value.
namespace/app-warn created</code></pre>
</div>
</div>
<div class="paragraph">
<p>Leave the policy in this mode for a while. Watch the output of your GitOps tools and pipelines as well as the audit log, and fix whoever creates namespaces without labels.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_4_switch_to_deny">Step 4: Switch to Deny</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once you are confident, switch the binding to <code>Deny</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc patch validatingadmissionpolicybinding namespace-ownership-labels --type=merge \
  -p &#39;{&#34;spec&#34;:{&#34;validationActions&#34;:[&#34;Deny&#34;]}}&#39;</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">
Do not combine <code>Deny</code> and <code>Warn</code> in one binding. <code>Deny</code> already returns the message to the client, <code>Warn</code> would only duplicate it.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_5_test_the_policy">Step 5: Test the Policy</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Now let us run some detailed tests. We want to make sure that our policy works and that it does not disrupt any platform namespaces or controllers.</p>
</div>
<div class="paragraph">
<p><strong>Create a namespace without labels.</strong> This is rejected, and the message lists the missing labels:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create namespace team-a</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">The namespaces &#34;team-a&#34; is invalid: : ValidatingAdmissionPolicy &#39;namespace-ownership-labels&#39; with binding &#39;namespace-ownership-labels&#39; denied request: Namespace team-a must carry the label(s) example.com/owner, example.com/cost-centre with a non-empty value.</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Create a namespace without labels via the UI.</strong> This is rejected as well, and the message is shown directly as feedback to the user.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/compliance/images/ValidationAdmissionPolicy-Deny.png?width=520px" alt="Namespace Ownership Labels UI Error"/>
</div>
</div>
<div class="paragraph">
<p><strong>Create a namespace with only one of the labels.</strong> This is rejected as well, and this time only <code>example.com/cost-centre</code> is mentioned:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">cat &lt;&lt;&#39;EOF&#39; | oc apply -f -
apiVersion: v1
kind: Namespace
metadata:
  name: team-a
  labels:
    example.com/owner: payments
EOF</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">The namespaces &#34;team-a&#34; is invalid: : ValidatingAdmissionPolicy &#39;namespace-ownership-labels&#39; with binding &#39;namespace-ownership-labels&#39; denied request: Namespace team-a must carry the label(s) example.com/cost-centre with a non-empty value.</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Create the namespace with both labels.</strong> This works — yay:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">cat &lt;&lt;&#39;EOF&#39; | oc apply -f -
apiVersion: v1
kind: Namespace
metadata:
  name: team-a
  labels:
    example.com/owner: payments
    example.com/cost-centre: CC-4711
EOF</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Remove a label or set it to an empty value.</strong> Both are rejected:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc label namespace team-a example.com/owner-
oc label namespace team-a example.com/owner= --overwrite</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">Error from server (Forbidden): namespaces &#34;team-a&#34; is forbidden: ValidatingAdmissionPolicy &#39;namespace-ownership-labels&#39; with binding &#39;namespace-ownership-labels&#39; denied request: The label(s) example.com/owner must not be removed from namespace team-a or set to an empty value.</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Change the value of a label, or add an annotation.</strong> Both are allowed:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc label namespace team-a example.com/owner=shop --overwrite
oc annotate namespace team-a example.com/comment=hello</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Platform namespaces</strong> are not affected:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create namespace openshift-demo</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Old namespaces</strong> that were created before the policy existed can still be updated. Once a label has been added, it is protected as well. Here <code>legacy-app</code> stands for any namespace that existed before the policy:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc annotate namespace legacy-app example.com/comment=hello      # allowed
oc label namespace legacy-app example.com/owner=legacy          # allowed
oc label namespace legacy-app example.com/owner-                # rejected</code></pre>
</div>
</div>
<div class="paragraph">
<p>Clean up:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc delete namespace team-a openshift-demo app-warn</code></pre>
</div>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_what_if_i_need_an_emergency_exit">What if I need an emergency exit?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The policy above also applies to cluster administrators. Unlike RBAC, admission policies cannot be bypassed with <code>cluster-admin</code>. The labels are protected against accidents, no matter who makes the change.</p>
</div>
<div class="paragraph">
<p>If you need an emergency exit, you have to build it into the policy yourself, for example with an additional <code>matchCondition</code> on <code>request.userInfo.username</code> for the break-glass account from the cluster-admin allow-list of the previous article.</p>
</div>
<div class="paragraph">
<p>On purpose I did not build this into the policy, because I think it is a bad idea to have an emergency exit in the policy. If you need namespaces without such labels, add dummy labels that indicate that the namespace is not an application namespace. At least that’s my opinion :)</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_variant_b_only_namespaces_following_a_naming_convention">Variant B: Only Namespaces Following a Naming Convention</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Many organisations use a naming convention to distinguish &#34;real&#34; application namespaces from sandboxes or personal projects, for example <code>app-&lt;name&gt;</code> and <code>sandbox-&lt;name&gt;</code>. In that case, copy the policy from Step 1 to <code>01-vap-namespace-ownership-labels-naming.yaml</code> and replace the <code>matchConditions</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">  matchConditions:
    - name: only-application-namespaces
      expression: &gt;-
        object.metadata.name.matches(&#39;^app-[a-z0-9-]+$&#39;)</code></pre>
</div>
</div>
<div class="paragraph">
<p>We only move from an exclude list to an include list. Everything else stays the same. To test it, we create the following namespaces:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;"/>
<col style="width: 16.6666%;"/>
<col style="width: 50.0001%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Namespace</th>
<th class="tableblock halign-left valign-top">Labels</th>
<th class="tableblock halign-left valign-top">Result</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>sandbox-test</code></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">allowed (does not follow the convention)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>application</code></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">allowed (does not start with <code>app-</code>)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>app-shop</code></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">rejected</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>app-shop</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">both</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">allowed; removing a label afterwards is rejected</p></td>
</tr>
</tbody>
</table>
<div class="admonitionblock caution">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-caution" title="Caution"></i>
</td>
<td class="content">
Use <strong>one</strong> of the two variants only. Both policies have the same name, so applying one replaces the other.
</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">
If you use the naming convention, adapt the <code>filter()</code> of the CustomRules from the previous article in the same way, for example <code>.filter(ns, ns.metadata.name.matches(&#39;^app-[a-z0-9-]+$&#39;))</code>. Otherwise the Compliance Operator reports namespaces that the admission policy deliberately ignores.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_openshift_specifics_self_service_projects">OpenShift Specifics: Self-Service Projects</h2>
<div class="sectionbody">
<div class="paragraph">
<p>On OpenShift, users usually do not create namespaces directly. They run <code>oc new-project</code>, which creates a <code>ProjectRequest</code>. The OpenShift API server then processes the project template and creates the project with its own privileged client. The resulting namespace passes the same admission chain, and therefore the same policy.</p>
</div>
<div class="paragraph">
<p><strong>A project request cannot pass arbitrary labels</strong>. As a consequence, with Variant A in <code>Deny</code> mode, <strong>self-service project requests are rejected</strong>. You have the following options:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Disable self-provisioning</strong> (Recommended) and create application namespaces only through your onboarding process (GitOps, a pipeline, a service catalogue). This is what most regulated customers do anyway. Remove the subjects from the cluster role binding <code>self-provisioners</code> and prevent the API server from restoring them:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc patch clusterrolebinding.rbac self-provisioners -p &#39;{&#34;subjects&#34;: null}&#39;
oc patch clusterrolebinding.rbac self-provisioners \
  -p &#39;{&#34;metadata&#34;:{&#34;annotations&#34;:{&#34;rbac.authorization.kubernetes.io/autoupdate&#34;:&#34;false&#34;}}}&#39;</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Use Variant B.</strong> Self-service projects that do not follow the naming convention (for example <code>sandbox-<strong></strong></code><strong>) are still possible, while <code>app-</code></strong> namespaces must be created with labels through the official process.</p>
</li>
<li>
<p><strong>Set labels in the project template.</strong> Labels defined on the <code>Project</code> object of the template end up on the namespace. However, the template only knows a few parameters, such as the project name and the requesting user, so it cannot fill in a meaningful cost centre. A static value such as <code>unassigned</code> would satisfy the policy, but not the auditor.</p>
</li>
</ol>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With the two objects <code>ValidatingAdmissionPolicy</code> and <code>ValidatingAdmissionPolicyBinding</code>, the kube-apiserver itself makes sure that every new application namespace is created with its ownership labels and that nobody removes them by accident. No webhook, no additional operator, no extra pods everything here is native Kubernetes. Together with the CustomRule from the previous article, you now have both sides: <strong>prevention</strong> at admission time and <strong>detection</strong> on a schedule, with evidence for the auditor.</p>
</div>
<div class="paragraph">
<p>The same idea works for the other two guardrails of the previous article. A VAP on <code>ClusterRoleBindings</code> could reject new <code>cluster-admin</code> bindings for identities that are not on the allow-list. Whether this is a good idea depends on how many operators in your cluster create such bindings themselves, so I highly recommend to start in <code>Warn</code> mode there as well.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_thank_you">Thank You</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This article would not exist without <a href="https://www.linkedin.com/in/mthuring/" rel="noopener" target="_blank">Max Thüringer</a> and <a href="https://www.linkedin.com/in/steffen-l-b0a840249/" rel="noopener" target="_blank">Steffen Lützenkirchen</a>. After listening to the talk <strong>&#34;More than just Compliance&#34;</strong> at OpenShift User Conference in Vienna, I wanted to see how far the CEL scanner of the Compliance Operator can go.</p>
</div>
<div class="paragraph">
<p>Thank you, <a href="https://www.linkedin.com/in/mthuring/" rel="noopener" target="_blank">Max Thüringer</a> and <a href="https://www.linkedin.com/in/steffen-l-b0a840249/" rel="noopener" target="_blank">Steffen Lützenkirchen</a>, for sharing your ideas and for the inspiration.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/" rel="noopener" target="_blank">Kubernetes Documentation: Validating Admission Policy</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>Compliance Operator: Writing Your Own Checks with CEL and CustomRules</title><link>https://blog.stderr.at/openshift-platform/security/compliance/2026-10-09-compliance-operator-customrules-cel/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/compliance/2026-10-09-compliance-operator-customrules-cel/</guid><pubDate>Fri, 09 Oct 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><category>Compliance</category><description>Turn organisation-specific audit requirements into automated checks with the CEL scanner and the CustomRule resource of the OpenShift Compliance Operator.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Five years ago I first tested and described how to achieve compliance for a Kubernetes cluster in my article <a href="/openshift-platform/security/compliance/2021-07-19-complianceoperator/">Compliance Operator</a>. Many years passed since then, but up to this day the Compliance Operator is still one of the most important tools I recommend to my customers and one of the first that is installed on a new cluster. Since the first release of the Operator, it has been constantly improved and extended, for example by adding your own guardrails to the cluster to make sure that the cluster is compliant with your organisation’s requirements.</p>
</div>
<div class="paragraph">
<p>Today I would like to show you how to write your own checks with the CEL scanner and the CustomRule resource.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Compliance Operator does a great job when it comes to industry benchmarks such as CIS, NIST 800-53, PCI-DSS or BSI. The idea described at <a href="/openshift-platform/security/compliance/2021-07-19-complianceoperator/">Compliance Operator</a> still works today. You define or select a profile and a time of scanning and the operator does the rest for you. Sooner or later, however, every auditor asks a question that is not part of any benchmark because it is individual for each organisation.</p>
</div>
<div class="paragraph">
<p>For example: <em>&#34;Who owns this namespace?&#34;</em>, <em>&#34;Show me that every application is isolated on the network by default.&#34;</em> or <em>&#34;Who exactly is cluster-admin, and why?&#34;</em> Until now, the answer usually was a shell script, an automation playbook, a screenshot or a check mark in a spreadsheet. With the <strong>CEL scanner</strong> and the <strong>CustomRule</strong> resource, the Compliance Operator can finally check such organisation-specific requirements itself — scheduled, repeatable and with results in the same place as all other compliance checks. All of this defined declaratively, so you can easily integrate it into your GitOps pipeline.</p>
</div>
<div class="paragraph">
<p>In this article I will build a small but real-world examples: three custom checks that act as <strong>platform guardrails</strong>. Two of them look at <code>application namespaces</code>, the third one audits who holds <code>cluster-admin</code>. This will extend the standard profile of the Compliance Operator and make it more useful for your organisation.</p>
</div>
<div class="paragraph">
<p>Once you have the rules in place, you can add them to a <code>TailoredProfile</code> so they become part of your compliance assessment.</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 idea is to build the three rules and then add them to a <code>TailoredProfile</code> to make them part of your compliance assessment. If you just need one of the rules, simply remove the other two from the profile.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_a_bit_of_history_cel_in_the_compliance_operator">A Bit of History: CEL in the Compliance Operator</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Compliance Operator traditionally uses OpenSCAP to evaluate its rules. The content (<a href="https://csrc.nist.gov/projects/security-content-automation-protocol/specifications/xccdf" rel="noopener" target="_blank">XCCDF</a> / <a href="https://ovalproject.github.io/" rel="noopener" target="_blank">OVAL</a>) is generated by the <a href="https://github.com/ComplianceAsCode/content" rel="noopener" target="_blank">ComplianceAsCode1</a> project and shipped with the operator. Writing your own rules in that format is possible, but let us be honest: nobody enjoys building their own content image just to check a label.</p>
</div>
<div class="paragraph">
<p>The <strong>Common Expression Language (CEL)</strong> changes this. CEL is a small, side-effect free expression language. If you have ever written a <code>ValidatingAdmissionPolicy</code>, you already know it. The integration into the Compliance Operator was finally globally available in version 1.10.0.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
CEL does not replace the existing XCCDF profiles. It extends them. Your CIS or PCI-DSS scans continue to work exactly as before.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_use_case_platform_guardrails">The Use Case: Platform Guardrails</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Many customers have some kind of &#34;platform contract&#34;. It is written down in a Confluence page, and it is usually not checked by anybody. Three requirements appear in nearly all of them:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Ownership</strong>: every application namespace carries labels that tell who owns it and who pays for it. That is the asset inventory an auditor asks for.</p>
</li>
<li>
<p><strong>Network segmentation by default</strong>: every application namespace contains a <em>default-deny</em> NetworkPolicy for incoming traffic. Applications then explicitly allow what they need.</p>
</li>
<li>
<p><strong>Privileged access</strong>: only an approved list of identities is bound to the ClusterRole <code>cluster-admin</code>. The platform’s own service accounts are allowed, of course, but personal accounts or application service accounts are not.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Why are these good candidates for a CustomRule?</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The label keys and the list of administrators are specific to each organisation. The operator cannot ship a generic rule for them.</p>
</li>
<li>
<p>The built-in CIS rule <code>ocp4-configure-network-policies-namespaces</code> only verifies that a namespace has <em>at least one</em> NetworkPolicy. A single policy that allows everything would pass. We want a real check: <strong>we want the deny-baseline</strong>.</p>
</li>
<li>
<p>All three checks only need information from the Kubernetes API. This is exactly what CustomRules are designed for.</p>
</li>
</ul>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
CustomRules evaluate Kubernetes/OpenShift API resources only. They cannot inspect files or processes on the nodes. For node-level checks you still use the shipped node profiles, such as <code>ocp4-cis-node</code>.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>An OpenShift cluster with cluster-admin permissions.</p>
</li>
<li>
<p>The Compliance Operator <strong>1.10.0 or newer</strong> installed in the namespace <code>openshift-compliance</code>. Version 1.8.0 and 1.9.x work as well, but the feature is Technology Preview there.</p>
</li>
<li>
<p>The command line tools <code>oc</code> and <code>jq</code>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If the operator is not installed yet, have a look at my older articles:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="/openshift-platform/security/compliance/2021-07-19-complianceoperator/">Compliance Operator</a> for the manual way, or</p>
</li>
<li>
<p><a href="/gitopscollection/2024-04-25-installing-compliance-operator/">[Ep.5] Setup &amp; Configure Compliance Operator</a> for the GitOps way.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Verify the installed version:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get csv -n openshift-compliance</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_how_a_customrule_works">How a CustomRule Works</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before we write our own rules, let us look at the anatomy of a <code>CustomRule</code>. Such YAML files can get large and messy, but the most important parts are <code>expression</code> and <code>inputs</code>:</p>
</div>
<div class="listingblock">
<div class="title">CustomRule YAML</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: CustomRule
metadata:
  name: my-rule
  namespace: openshift-compliance <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  id: my_rule <i class="conum" data-value="2"></i><b>(2)</b>
  title: A short title
  severity: medium <i class="conum" data-value="3"></i><b>(3)</b>
  checkType: Platform <i class="conum" data-value="4"></i><b>(4)</b>
  scannerType: CEL <i class="conum" data-value="5"></i><b>(5)</b>
  inputs: <i class="conum" data-value="6"></i><b>(6)</b>
    - name: pods
      kubernetesInputSpec:
        apiVersion: v1
        resource: pods
  expression: |- <i class="conum" data-value="7"></i><b>(7)</b>
    pods.items.all(p, has(p.spec.securityContext))
  failureReason: Text shown when the check fails <i class="conum" data-value="8"></i><b>(8)</b>
  instructions: How to find and fix the problem <i class="conum" data-value="9"></i><b>(9)</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>CustomRules live in the namespace of the operator.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The ID becomes part of the name of the ComplianceCheckResult (underscores are automatically converted to dashes).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Can be one of <code>info</code>, <code>low</code>, <code>medium</code>, <code>high</code> (default is <code>medium</code>).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>CustomRules only support <code>Platform</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Must be <code>CEL</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The Kubernetes resources the rule needs. Each input becomes a variable in the expression. Without <code>resourceName</code> you get a <strong>list</strong> object, so the actual objects are found in <code>.items</code>. With <code>resourceNamespace</code> you can limit the query to one namespace.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The CEL expression. It must return <code>true</code> when the cluster is <strong>compliant</strong>.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The <code>failureReason</code> is added to the warnings of the ComplianceCheckResult if the check fails.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td><code>instructions</code> (as well as <code>description</code> and <code>rationale</code>) are copied into the ComplianceCheckResult. Use them to tell the reader how to find the offending objects.</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 operator reads the inputs with the ServiceAccount <code>api-resource-collector</code>. This account is basically a cluster-reader, so namespaces, NetworkPolicies, pods, RBAC objects etc. can be read without any additional configuration. If your rule needs resources of an operator (for example <code>HyperConverged</code> of OpenShift Virtualization), you must grant read access to this ServiceAccount yourself.
</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">
A CustomRule produces <strong>one</strong> result for the whole rule, not one result per object. If one namespace out of 200 violates the policy, the rule fails. That is why the <code>instructions</code> field should always contain a command that lists the offending objects.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_1_the_ownership_rule">Step 1: The Ownership Rule</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The first rule, that I would like to build, verifies that every application namespace has the labels <code>example.com/owner</code> and <code>example.com/cost-centre</code> with a non-empty value. Our auditor wants to know who owns the namespace and who pays for it.</p>
</div>
<div class="paragraph">
<p>Platform namespaces must be excluded, otherwise the rule would fail immediately as they do no not have such labels. A regular expression for this: everything that starts with <code>openshift</code> or <code>kube-</code>, plus the namespace <code>default</code> is ignored. In addition, I have also added the namespaces <code>open-cluster-management</code>, <code>stackrox</code> and <code>rhacs-</code> to the exclusion list, these are namespace for <strong>Advanced Cluster Management</strong> and <strong>Advanced Cluster Security</strong> respectively and at least on my own demo cluster they exist.</p>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
Do not worry about the following YAML. It looks huge, but most of it is <strong>just comments</strong>. The important parts are the <code>expression</code> field and the <code>inputs</code> section: they define <strong>what</strong> to check and <strong>where</strong>.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="title">01-customrule-namespace-ownership-labels.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: CustomRule
metadata:
  name: namespace-ownership-labels
  namespace: openshift-compliance
  annotations:
    example.com/controls: &#34;Nist Rule 1.2.3.4&#34; <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  id: namespace_ownership_labels
  title: Application namespaces must have ownership labels set <i class="conum" data-value="2"></i><b>(2)</b>
  severity: medium <i class="conum" data-value="3"></i><b>(3)</b>
  checkType: Platform
  scannerType: CEL
  inputs:
    - name: namespaces <i class="conum" data-value="4"></i><b>(4)</b>
      kubernetesInputSpec:
        apiVersion: v1
        resource: namespaces
  expression: |- <i class="conum" data-value="5"></i><b>(5)</b>
    namespaces.items
      .filter(ns, !ns.metadata.name.matches(&#39;^(openshift.*|kube-.*|open-cluster-management.*|cert-manager.*|stackrox.*|rhacs-.*|default)$&#39;))
      .all(ns,
        has(ns.metadata.labels) &amp;&amp;
        [&#39;example.com/owner&#39;, &#39;example.com/cost-centre&#39;].all(key,
          key in ns.metadata.labels &amp;&amp; ns.metadata.labels[key] != &#39;&#39;
        )
      )
  description: |- <i class="conum" data-value="6"></i><b>(6)</b>
    Every application namespace must have the labels &#39;example.com/owner&#39;
    and &#39;example.com/cost-centre&#39; with a non-empty value set. Platform namespaces (openshift*, kube-*, default)
    are excluded.
  rationale: |- <i class="conum" data-value="7"></i><b>(7)</b>
    Auditors expect an up-to-date inventory of system components and a named
    owner for each of them.
  failureReason: |- <i class="conum" data-value="8"></i><b>(8)</b>
    At least one application namespace is missing the label
    &#39;example.com/owner&#39; or &#39;example.com/cost-centre&#39; (or the value is empty).
    Run the command from the instructions of this check to list the
    offending namespaces and label them, for example:
    oc label namespace &lt;name&gt; example.com/owner=&lt;team&gt; example.com/cost-centre=&lt;id&gt;
  instructions: |- <i class="conum" data-value="9"></i><b>(9)</b>
    List all application namespaces without complete ownership labels:
    oc get namespaces -o json | jq -r &#39;.items[]
      | select(.metadata.name | test(&#34;^(openshift.*|kube-.*|open-cluster-management.*|cert-manager.*|stackrox.*|rhacs-.*|default)$&#34;) | not)
      | select((.metadata.labels[&#34;example.com/owner&#34;] // &#34;&#34;) == &#34;&#34;
            or (.metadata.labels[&#34;example.com/cost-centre&#34;] // &#34;&#34;) == &#34;&#34;)
      | .metadata.name&#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><strong>Optional</strong>: map the rule to your control framework.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The <code>title</code> of the rule.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The <code>severity</code> of the rule. Can be one of <code>info</code>, <code>low</code>, <code>medium</code>, <code>high</code> (default is <code>medium</code>).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The <code>input</code> section defines the <strong>WHERE</strong> of the check. The resource <code>namespaces</code> contains the list of all namespaces.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The <code>expression</code> field reads like a sentence:
<div class="ulist">
<ul>
<li>
<p><code>filter(…​)</code> removes all platform namespaces. <code>matches()</code> uses RE2 syntax. Note the anchors <code>^</code> and <code>$</code>: without them <code>matches()</code> searches for a substring.</p>
</li>
<li>
<p><code>all(…​)</code> returns <code>true</code> only if the condition is true for every of the remaining namespaces.</p>
</li>
<li>
<p><code>has(ns.metadata.labels)</code> protects against namespaces without any label. On a real cluster this does not happen, since Kubernetes always sets <code>kubernetes.io/metadata.name</code>, but it costs nothing.</p>
</li>
<li>
<p>The inner <code>all()</code> iterates over the list of mandatory label keys. <code>key in map</code> checks whether the key exists and that the value is not empty.</p>
</li>
</ul>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Detailed description of the rule.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Rationale: why are we checking this?</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The <code>failureReason</code> is added to the warnings of the ComplianceCheckResult if the check fails.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>The <code>instructions</code> are copied into the ComplianceCheckResult. Use it to tell the reader how to find the offending objects.</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 is our first <strong>CustomRule</strong> object. We will define the other rules in the same way, then apply them all at once.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_2_the_default_deny_rule">Step 2: The Default-Deny Rule</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The second rule is more interesting because it combines <strong>two</strong> inputs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>the list of namespaces and</p>
</li>
<li>
<p>the list of all NetworkPolicies.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For every application namespace there must <code>exist</code> at least one NetworkPolicy that:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>lives in that namespace,</p>
</li>
<li>
<p>selects all pods (empty <code>podSelector</code>),</p>
</li>
<li>
<p>covers the policy type <code>Ingress</code> and</p>
</li>
<li>
<p>does not define any ingress rule, which means: nothing is allowed.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In short, every application namespace must have a <strong>deny-all</strong> NetworkPolicy for ingress.</p>
</div>
<div class="paragraph">
<p>Create the file <code>02-customrule-namespace-default-deny-ingress.yaml</code>:</p>
</div>
<div class="listingblock">
<div class="title">02-customrule-namespace-default-deny-ingress.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: CustomRule
metadata:
  name: namespace-default-deny-ingress
  namespace: openshift-compliance
  annotations:
    example.com/controls: &#34;Nist Rule 1.2.3.4&#34;
spec:
  id: namespace_default_deny_ingress
  title: Application namespaces have a default-deny ingress NetworkPolicy
  description: |-
    Every application namespace must contain a NetworkPolicy that selects
    all pods (empty podSelector), covers the policy type &#39;Ingress&#39; and
    defines no ingress rules.
    Additional allow policies are expected on top of it. Platform namespaces
    (openshift*, kube-*, default) are excluded.
  rationale: |-
    Without a default-deny baseline every pod accepts traffic from every
    other pod in the cluster.
  severity: high
  checkType: Platform
  scannerType: CEL
  inputs:
    - name: namespaces
      kubernetesInputSpec:
        apiVersion: v1
        resource: namespaces
    - name: networkpolicies <i class="conum" data-value="1"></i><b>(1)</b>
      kubernetesInputSpec:
        apiVersion: networking.k8s.io/v1 <i class="conum" data-value="2"></i><b>(2)</b>
        resource: networkpolicies
  expression: |-
    namespaces.items
      .filter(ns, !ns.metadata.name.matches(&#39;^(openshift.*|kube-.*|open-cluster-management.*|cert-manager.*|stackrox.*|rhacs-.*|default)$&#39;))
      .all(ns,
        networkpolicies.items.exists(np,
          np.metadata.namespace == ns.metadata.name &amp;&amp;
          (!has(np.spec.podSelector.matchLabels) || size(np.spec.podSelector.matchLabels) == 0) &amp;&amp;
          (!has(np.spec.podSelector.matchExpressions) || size(np.spec.podSelector.matchExpressions) == 0) &amp;&amp;
          (!has(np.spec.policyTypes) || &#39;Ingress&#39; in np.spec.policyTypes) &amp;&amp;
          (!has(np.spec.ingress) || size(np.spec.ingress) == 0)
        )
      )
  failureReason: |-
    At least one application namespace has no default-deny ingress
    NetworkPolicy (empty podSelector, policyType Ingress, no ingress rules).
    Run the command from the instructions of this check to list the
    offending namespaces and add a default-deny policy to each of them.
  instructions: |-
    Lists every application namespace that has no default-deny ingress policy.
    A policy counts as default-deny if it selects all pods, covers Ingress and
    allows nothing. Copy the lines below into a bash shell:

    for ns in $(oc get namespaces -o name | cut -d/ -f2 \
        | grep -Ev &#39;^(openshift.*|kube-.*|open-cluster-management.*|cert-manager.*|stackrox.*|rhacs-.*|default)$&#39;); do
      oc get networkpolicies -n &#34;$ns&#34; -o json | jq -e &#39;.items[] | select(
          (.spec.podSelector.matchLabels      // {} | length) == 0 and
          (.spec.podSelector.matchExpressions // [] | length) == 0 and
          (.spec.policyTypes // [&#34;Ingress&#34;] | index(&#34;Ingress&#34;)) and
          (.spec.ingress // [] | length) == 0
        )&#39; &gt; /dev/null || echo &#34;missing default-deny: $ns&#34;
    done</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 second input. NetworkPolicies are namespace-scoped; since no <code>resourceNamespace</code> is set, the policies of <strong>all</strong> namespaces are fetched.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>For resources outside the core API group, group and version are written together, exactly like the <code>apiVersion</code> in a manifest.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Some details of the <code>expression</code> field are worth a second look:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>filter(…​)</code> removes all platform namespaces that <code>matches()</code></p>
</li>
<li>
<p><code>all(…​)</code> returns <code>true</code> only if the condition is true for every of the remaining namespaces.</p>
</li>
<li>
<p>a network policy object must exist that:</p>
<div class="ulist">
<ul>
<li>
<p>lives in that namespace,</p>
</li>
<li>
<p>has an empty <code>podSelector</code>,</p>
</li>
<li>
<p>has not <code>policyTypes</code> set to <code>Ingress</code>,</p>
</li>
<li>
<p>has no ingress rules,</p>
</li>
</ul>
</div>
</li>
<li>
<p>Additional allow policies (for example to let the OpenShift router in) are fine. We only require that the deny baseline 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 is just an example that shows how to use two inputs in a CustomRule. If you enforce the baseline cluster-wide with a <code>BaselineAdminNetworkPolicy</code> or an <code>AdminNetworkPolicy</code> instead of per-namespace NetworkPolicies, this rule is not the right one for you. In that case write a rule that checks the (cluster-scoped) admin policy instead.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_3_the_cluster_admin_allow_list">Step 3: The cluster-admin Allow-List</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The third rule answers the classic auditor question <em>&#34;Who is cluster-admin?&#34;</em>.</p>
</div>
<div class="paragraph">
<p>The CIS OpenShift Benchmark (control 5.1.1) recommends to restrict the use of <code>cluster-admin</code>, but it cannot know <strong>who</strong> is allowed in your organisation. That is a perfect job for a <strong>CustomRule</strong>.</p>
</div>
<div class="paragraph">
<p>A common mistake is to look only at the ClusterRoleBinding that is called <code>cluster-admin</code>. Any ClusterRoleBinding can reference the ClusterRole <code>cluster-admin</code>, and OpenShift itself ships several of them. Therefore, the rule looks at <strong>all</strong> ClusterRoleBindings whose <code>roleRef</code> points to <code>cluster-admin</code>, and checks <strong>every</strong> subject of these bindings.</p>
</div>
<div class="paragraph">
<p>Before you write the <strong>allow-list</strong>, look at the current state of your cluster:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get clusterrolebindings -o json | jq -r &#39;.items[]
  | select(.roleRef.kind == &#34;ClusterRole&#34; and .roleRef.name == &#34;cluster-admin&#34;)
  | .metadata.name as $crb | .subjects[]?
  | &#34;\($crb)\t\(.kind)\t\(.namespace // &#34;-&#34;)\t\(.name)&#34;&#39; | column -t</code></pre>
</div>
</div>
<div class="paragraph">
<p>This selects all ClusterRoleBindings that reference the ClusterRole <code>cluster-admin</code> and lists the subjects of each binding. The output looks like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">cluster-admin                    Group           -                                   system:masters
cluster-admin-0                  ServiceAccount  openshift-gitops                    openshift-gitops-argocd-application-controller
cluster-admin-crb                Group           -                                   cluster-admin
cluster-admins                   Group           -                                   system:cluster-admins
cluster-admins                   User            -                                   system:admin
cluster-network-operator         ServiceAccount  openshift-network-operator          cluster-network-operator
cluster-storage-operator-role    ServiceAccount  openshift-cluster-storage-operator  cluster-storage-operator
cluster-version-operator         ServiceAccount  openshift-cluster-version           default
...</code></pre>
</div>
</div>
<div class="paragraph">
<p>You will find the platform-internal groups <code>system:masters</code> and <code>system:cluster-admins</code>, the user <code>system:admin</code> and a number of service accounts in <code>openshift-*</code> namespaces that belong to the platform operators. Everything else was added later by someone and deserves a closer look.</p>
</div>
<div class="paragraph">
<p>The allow-list — the subjects the rule treats as acceptable — has three parts:</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">Subject kind</th>
<th class="tableblock halign-left valign-top">Allowed</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Group</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The platform groups <code>system:masters</code> and <code>system:cluster-admins</code>, plus the group of the platform team (here <code>cluster-admin</code>, for example synchronised from LDAP or Entra ID).</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>User</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The platform user <code>system:admin</code> and one named break-glass account. Personal accounts are <strong>not</strong> allowed. The platform team gets its rights through the group.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>ServiceAccount</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Every service account in a platform namespace (<code>openshift*</code>, <code>kube-*</code>), plus an explicit list of <code>namespace/name</code> pairs for tools such as a cluster-wide Argo CD instance.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The following file is a full example of a CustomRule that checks the allow-list for <code>cluster-admin</code>. The callouts below walk through every part of the expression.</p>
</div>
<div class="listingblock">
<div class="title">03-customrule-cluster-admin-allow-list.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: CustomRule
metadata:
  name: cluster-admin-allow-list
  namespace: openshift-compliance
  annotations:
    example.com/controls: &#34;Nist Rule 1.2.3.4&#34;
spec:
  id: cluster_admin_allow_list
  title: Only approved identities are allowed to hold cluster-admin privileges
  description: |-
    Every subject of every ClusterRoleBinding that grants cluster-admin
    privileges must be on the organisation&#39;s allow-list. A binding grants
    cluster-admin privileges if it references the ClusterRole &#39;cluster-admin&#39;
    or any other ClusterRole with a wildcard rule (&#39;*&#39; API groups, &#39;*&#39;
    resources, &#39;*&#39; verbs), for example a renamed copy of cluster-admin.
    Allowed are: the platform-internal groups and users of OpenShift,
    service accounts in platform namespaces (openshift*, kube-*), an
    explicitly named break-glass account, explicitly listed service accounts
    and the group of platform administrators - but only if that group exists
    and every member of it is an approved administrator. Everything else, in
    particular personal user accounts, application service accounts and
    broad groups such as &#39;system:authenticated&#39;, fails the check.
  rationale: |-
    cluster-admin grants unrestricted access to every resource in the
    cluster. Privileged access must be limited to a small, documented and
    reviewed set of identities.
  severity: high
  checkType: Platform
  scannerType: CEL
  inputs:
    - name: crbs <i class="conum" data-value="1"></i><b>(1)</b>
      kubernetesInputSpec:
        apiVersion: rbac.authorization.k8s.io/v1
        resource: clusterrolebindings
    - name: clusterroles <i class="conum" data-value="2"></i><b>(2)</b>
      kubernetesInputSpec:
        apiVersion: rbac.authorization.k8s.io/v1
        resource: clusterroles
    - name: groups <i class="conum" data-value="3"></i><b>(3)</b>
      kubernetesInputSpec:
        apiVersion: user.openshift.io/v1
        resource: groups
  expression: |-
    // ---- allow-list: might be exported into a ConfigMap ---- <i class="conum" data-value="4"></i><b>(4)</b>
    // ---- every dynamic value is stored in a map ----
    [{
      &#39;platformGroups&#39;:         [&#39;system:masters&#39;, &#39;system:cluster-admins&#39;],
      &#39;adminGroups&#39;:            [&#39;cluster-admin&#39;],
      &#39;approvedAdmins&#39;:         [&#39;alice.admin@example.com&#39;, &#39;bob.admin@example.com&#39;],
      &#39;allowedUsers&#39;:           [&#39;system:admin&#39;, &#39;breakglass-admin&#39;],
      &#39;allowedServiceAccounts&#39;: [&#39;gitops-system/argocd-application-controller&#39;, &#39;rhacs-operator/rhacs-operator-controller-manager&#39;]
    }].all(cfg,
      crbs.items <i class="conum" data-value="5"></i><b>(5)</b>
        .filter(crb,
          crb.roleRef.kind == &#39;ClusterRole&#39; &amp;&amp;
          has(crb.subjects) &amp;&amp; crb.subjects != null &amp;&amp;
          (crb.roleRef.name == &#39;cluster-admin&#39; || <i class="conum" data-value="6"></i><b>(6)</b>
           clusterroles.items.exists(cr,
             cr.metadata.name == crb.roleRef.name &amp;&amp;
             has(cr.rules) &amp;&amp; cr.rules != null &amp;&amp;
             cr.rules.exists(r,
               has(r.apiGroups) &amp;&amp; &#39;*&#39; in r.apiGroups &amp;&amp;
               has(r.resources) &amp;&amp; &#39;*&#39; in r.resources &amp;&amp;
               &#39;*&#39; in r.verbs))))
        .all(crb, crb.subjects.all(s, <i class="conum" data-value="7"></i><b>(7)</b>
          // groups: built-in groups, or an admin group that exists and has only approved members
          (s.kind == &#39;Group&#39; &amp;&amp; ( <i class="conum" data-value="8"></i><b>(8)</b>
            s.name in cfg.platformGroups ||
            (s.name in cfg.adminGroups &amp;&amp;
             groups.items.exists(g, g.metadata.name == s.name) &amp;&amp;
             groups.items.filter(g, g.metadata.name == s.name).all(g,
               !has(g.users) || g.users == null ||
               g.users.all(u, u in cfg.approvedAdmins)))
          )) ||
          // users: allowed users, or service accounts of platform namespaces written as User
          (s.kind == &#39;User&#39; &amp;&amp; ( <i class="conum" data-value="9"></i><b>(9)</b>
            s.name in cfg.allowedUsers ||
            s.name.matches(&#39;^system:serviceaccount:(openshift[^:]*|kube-[^:]*):[^:]+$&#39;)
          )) ||
          // service accounts: platform namespaces, or explicitly listed namespace/name pairs
          (s.kind == &#39;ServiceAccount&#39; &amp;&amp; has(s.namespace) &amp;&amp; ( <i class="conum" data-value="10"></i><b>(10)</b>
            s.namespace.matches(&#39;^(openshift.*|kube-.*)$&#39;) ||
            (s.namespace + &#39;/&#39; + s.name) in cfg.allowedServiceAccounts
          ))
        ))
    )
  failureReason: |-
    At least one subject that holds cluster-admin privileges is not on the
    allow-list, or the platform administrator group contains a member that
    is not an approved administrator.
  instructions: |- <i class="conum" data-value="11"></i><b>(11)</b>
    List all subjects with cluster-admin privileges that are not on the
    allow-list:
    jq -rn \
      --slurpfile crbs &lt;(oc get clusterrolebindings -o json) \
      --slurpfile roles &lt;(oc get clusterroles -o json) \
      --slurpfile groups &lt;(oc get groups -o json) &#39;
      # ---- allow-list: edit here ----
      {
        platformGroups:         [&#34;system:masters&#34;, &#34;system:cluster-admins&#34;],
        adminGroups:            [&#34;cluster-admin&#34;],
        approvedAdmins:         [&#34;alice.admin@example.com&#34;, &#34;bob.admin@example.com&#34;],
        allowedUsers:           [&#34;system:admin&#34;, &#34;breakglass-admin&#34;],
        allowedServiceAccounts: [&#34;gitops-system/argocd-application-controller&#34;, &#34;rhacs-operator/rhacs-operator-controller-manager&#34;]
      } as $cfg
      | [$roles[0].items[]
          | select(.metadata.name == &#34;cluster-admin&#34; or any(.rules[]?;
              ((.apiGroups // []) | index(&#34;*&#34;)) and ((.resources // []) | index(&#34;*&#34;))
              and ((.verbs // []) | index(&#34;*&#34;))))
          | .metadata.name] as $adminRoles
      | $crbs[0].items[]
      | select(.roleRef.kind == &#34;ClusterRole&#34;
          and (.roleRef.name == &#34;cluster-admin&#34; or (.roleRef.name | IN($adminRoles[]))))
      | .metadata.name as $crb | .roleRef.name as $role | .subjects[]? | . as $s
      | select(
          ((.kind == &#34;Group&#34;) and ((.name | IN($cfg.platformGroups[]))
             or ((.name | IN($cfg.adminGroups[]))
                 and ([$groups[0].items[] | select(.metadata.name == $s.name)] as $g
                      | ($g | length) &gt; 0
                        and all($g[]; (.users // []) | all(IN($cfg.approvedAdmins[])))))))
          or ((.kind == &#34;User&#34;) and ((.name | IN($cfg.allowedUsers[]))
                or (.name | test(&#34;^system:serviceaccount:(openshift[^:]*|kube-[^:]*):[^:]+$&#34;))))
          or ((.kind == &#34;ServiceAccount&#34;) and (((.namespace // &#34;&#34;) | test(&#34;^(openshift.*|kube-.*)$&#34;))
                or ((.namespace // &#34;&#34;) + &#34;/&#34; + .name | IN($cfg.allowedServiceAccounts[]))))
          | not)
      | &#34;\($crb) -&gt; \($role): \(.kind) \(.namespace // &#34;-&#34;)/\(.name)&#34;
        + (if .kind == &#34;Group&#34; then
             ([$groups[0].items[] | select(.metadata.name == $s.name) | (.users // [])[]]
              | if length == 0 then &#34; (no Group object or no members)&#34;
                else &#34; (members: &#34; + join(&#34;, &#34;) + &#34;)&#34; end)
           else &#34;&#34; end)&#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>The list of all ClusterRoleBindings.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The list of all ClusterRoles. It is used to find roles that are equivalent to <code>cluster-admin</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The list of all OpenShift <code>Group</code> objects. It is used to verify the members of the allowed group.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>A map for the alow list and any dynamic values. Easier to manage than a long list of strings.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Selecting the relevant ClusterRoleBindings: kind == ClusterRole, subject exists</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>Role reference name is cluster-admin or any other ClusterRole with a wildcard rule (&#39;<strong>&#39; API groups, &#39;</strong>&#39; resources, &#39;*&#39; verbs)</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Subject is a Group OR a User OR a ServiceAccount</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>Group is either a platform group OR an admin group that exists and has only approved admins</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>User is either an allowed user OR a service account of a platform namespace written as User</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>ServiceAccount is either a platform namespace OR an explicitly listed namespace/name pair (here: the Argo CD application controller)</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>Pretty decent command to list the offending bindings.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Some details are important here, and they are the reason why I did not simply allow everything that starts with <code>system:</code>:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Broad system groups</strong>: <code>system:authenticated</code>, <code>system:unauthenticated</code> and <code>system:serviceaccounts:&lt;namespace&gt;</code> are system groups as well. Binding one of them to <code>cluster-admin</code> is about the worst thing you can do to a cluster. A prefix match on <code>system:</code> would happily accept them. Therefore the rule uses an explicit list of groups.</p>
</li>
<li>
<p><strong>Service accounts as User subjects</strong>: A service account can also appear as a subject of kind <code>User</code> with the name <code>system:serviceaccount:&lt;namespace&gt;:&lt;name&gt;</code>. The rule treats such subjects like service accounts and only accepts them if the namespace is a platform namespace.</p>
</li>
<li>
<p><strong>Exact namespace/name pairs</strong>: For service accounts outside the platform namespaces the rule compares <code>namespace/name</code>. A service account with the same name in another namespace does not pass.</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 rule deliberately ignores RoleBindings. A RoleBinding to <code>cluster-admin</code> only grants full access <strong>within one namespace</strong>. ClusterRoles that grant broad privileges without using <code><strong></strong></code><strong>/<code></code></strong>/<code>*</code> wildcards are also outside the scope of this example; extend the expression if you need to treat those as equivalent to <code>cluster-admin</code>.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_4_create_the_rules_and_check_their_status">Step 4: Create the Rules and Check Their Status</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Apply the three rules:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f 01-customrule-namespace-ownership-labels.yaml
oc apply -f 02-customrule-namespace-default-deny-ingress.yaml
oc apply -f 03-customrule-cluster-admin-allow-list.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The operator validates the CEL expression immediately. Only rules in the state <code>Ready</code> can be used in a profile:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get customrules -n openshift-compliance</code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">NAME                             STATUS   AGE
cluster-admin-allow-list         Ready    10s
namespace-default-deny-ingress   Ready    12s
namespace-ownership-labels       Ready    14s</code></pre>
</div>
</div>
<div class="paragraph">
<p>If the status is <code>Error</code>, the reason can be found in the status of the object:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get customrule namespace-ownership-labels -n openshift-compliance -o jsonpath=&#39;{.status.errorMessage}{&#34;\n&#34;}&#39;</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">
Do not use the short name <code>cr</code>. In the Compliance Operator, <code>cr</code> stands for <code>complianceremediations</code>. I fell into that trap more than once.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_5_tailoredprofile_and_scansettingbinding">Step 5: TailoredProfile and ScanSettingBinding</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CustomRules are never scanned directly. They must be bundled into a <code>TailoredProfile</code>, which is then bound to a <code>ScanSetting</code> (when to scan) via a <code>ScanSettingBinding</code> (which profile to scan).</p>
</div>
<div class="paragraph">
<p>Create the file <code>tailoredprofile.yaml</code>:</p>
</div>
<div class="listingblock">
<div class="title">tailoredprofile.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: TailoredProfile
metadata:
  name: platform-guardrails               <i class="conum" data-value="1"></i><b>(1)</b>
  namespace: openshift-compliance
spec:
  title: Platform guardrails
  description: Organisation-specific checks for namespaces and privileged access
  enableRules:
    - kind: CustomRule                    <i class="conum" data-value="2"></i><b>(2)</b>
      name: namespace-ownership-labels
      rationale: Asset inventory and accountability for every namespace
    - kind: CustomRule
      name: namespace-default-deny-ingress
      rationale: Network segmentation as the default for every namespace
    - kind: CustomRule
      name: cluster-admin-allow-list
      rationale: Privileged access limited to approved identities</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 TailoredProfile becomes the name of the ComplianceScan and the prefix of all results.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The <code>kind</code> must be set to <code>CustomRule</code>. Without it, the operator looks for a regular <code>Rule</code> with that name.</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">
A TailoredProfile cannot mix CEL-based checks with the classic OpenSCAP-based <code>Rule</code> objects (such as the CIS rules). CustomRules may only be combined with other CEL rules. Keep your custom checks in their own profile, which is a good idea anyway.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Create the file <code>scansettingbinding.yaml</code>:</p>
</div>
<div class="listingblock">
<div class="title">scansettingbinding.yaml</div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: compliance.openshift.io/v1alpha1
kind: ScanSettingBinding
metadata:
  name: platform-guardrails
  namespace: openshift-compliance
profiles:
  - apiGroup: compliance.openshift.io/v1alpha1
    kind: TailoredProfile
    name: platform-guardrails
settingsRef:
  apiGroup: compliance.openshift.io/v1alpha1
  kind: ScanSetting
  name: default                           <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 <code>default</code> ScanSetting created by the operator. It runs the scan daily at 01:00 (<code>0 1 * * *</code>). Use your own ScanSetting if you need a different schedule.</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_6_check_the_results">Step 6: Check the Results</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Creating the binding starts the first scan immediately. Watch the ComplianceSuite until the phase is <code>DONE</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get compliancesuite platform-guardrails -n openshift-compliance</code></pre>
</div>
</div>
<div class="paragraph">
<p>This returns something like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">NAME                  PHASE   RESULT
platform-guardrails   DONE    NON-COMPLIANT</code></pre>
</div>
</div>
<div class="paragraph">
<p>Why is it <strong>non-compliant</strong>? Let us look at the results.</p>
</div>
<div class="paragraph">
<p>To list the results of this scan, run:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get ccr -n openshift-compliance -l compliance.openshift.io/scan-name=platform-guardrails</code></pre>
</div>
</div>
<div class="paragraph">
<p>On a cluster that has been running for a while, the output will most likely look like this (example output):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">NAME                                                 STATUS   SEVERITY
platform-guardrails-cluster-admin-allow-list         FAIL     high
platform-guardrails-namespace-default-deny-ingress   FAIL     high
platform-guardrails-namespace-ownership-labels       FAIL     medium</code></pre>
</div>
</div>
<div class="paragraph">
<p>Do not be surprised: this is the actual state of the cluster, and exactly what an auditor wants to know. The failure reason and the instructions are stored in the result:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get ccr platform-guardrails-namespace-ownership-labels -n openshift-compliance \
  -o jsonpath=&#39;{.warnings}{&#34;\n&#34;}{.instructions}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Copy the command from the instructions to get the list of namespaces that must be fixed.</p>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_step_7_test_the_rules">Step 7: Test the Rules</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To be sure the rules do what they should, create objects that violate all three of them, verify that the checks fail, fix the findings and verify that the checks pass. On a lab cluster that is already compliant, that gives a clean before-and-after picture.</p>
</div>
<div class="paragraph">
<p>Create a test namespace without labels and without a NetworkPolicy, and bind <code>cluster-admin</code> to a personal account that is not on the allow-list:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create namespace cel-demo
oc create clusterrolebinding cel-demo-admin --clusterrole=cluster-admin --user=alice</code></pre>
</div>
</div>
<div class="paragraph">
<p>Trigger a rescan so you do not have to wait until 01:00 — annotate the ComplianceScan:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc annotate compliancescans/platform-guardrails -n openshift-compliance compliance.openshift.io/rescan=</code></pre>
</div>
</div>
<div class="paragraph">
<p>Wait until the suite is <code>DONE</code> again and check the results: all three checks are <code>FAIL</code>. The helper commands from the instructions list the namespace <code>cel-demo</code> and the binding <code>cel-demo-admin: User -/alice</code>.</p>
</div>
<div class="paragraph">
<p>Now fix the findings. Remove the binding and label the namespace:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc delete clusterrolebinding cel-demo-admin
oc label namespace cel-demo example.com/owner=platform-team example.com/cost-centre=CC-4711

cat &lt;&lt;&#39;EOF&#39; | oc apply -f -
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-ingress
  namespace: cel-demo
spec:
  podSelector: {}
  policyTypes:
  - Ingress
EOF</code></pre>
</div>
</div>
<div class="paragraph">
<p>Rescan again:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc annotate compliancescans/platform-guardrails -n openshift-compliance compliance.openshift.io/rescan=</code></pre>
</div>
</div>
<div class="paragraph">
<p>As long as these were the only offenders, all three checks now report <code>PASS</code>. Finally, remove the test namespace:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc delete namespace cel-demo</code></pre>
</div>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With <code>CustomRule</code> and the CEL scanner, the Compliance Operator finally covers the &#34;last mile&#34; of compliance: the requirements that are specific to your organisation. The three rules in this article are quite huge YAML files, most of it documentation, they run on the same schedule as your CIS or PCI-DSS scans, and their results end up in the same place, with the same labels, metrics and alerts.</p>
</div>
<div class="paragraph">
<p>Namespace ownership, default-deny NetworkPolicies and the cluster-admin allow-list are just a starting point. Other good candidates are: mandatory TLS settings on Routes, allowed image registries, or an audit that no application team runs its own database. If you can express it with <code>oc get …​ -o json | jq</code>, you can most likely express it in CEL.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_thank_you">Thank You</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This article would not exist without <a href="https://www.linkedin.com/in/mthuring/" rel="noopener" target="_blank">Max Thüringer</a> and <a href="https://www.linkedin.com/in/steffen-l-b0a840249/" rel="noopener" target="_blank">Steffen Lützenkirchen</a>. After listening to the talk <strong>&#34;More than just Compliance&#34;</strong> at OpenShift User Conference in Vienna, I wanted to see how far the CEL scanner of the Compliance Operator can go.</p>
</div>
<div class="paragraph">
<p>Thank you, <a href="https://www.linkedin.com/in/mthuring/" rel="noopener" target="_blank">Max Thüringer</a> and <a href="https://www.linkedin.com/in/steffen-l-b0a840249/" rel="noopener" target="_blank">Steffen Lützenkirchen</a>, for sharing your ideas and for the inspiration.</p>
</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/openshift_container_platform/4.20/html/security_and_compliance/compliance-operator" rel="noopener" target="_blank">Red Hat Documentation: Compliance Operator (incl. release notes)</a></p>
</li>
<li>
<p><a href="https://developers.redhat.com/articles/2025/12/02/automate-unique-compliance-checks-openshift-and-customrule" rel="noopener" target="_blank">Red Hat Developer: Automate unique compliance checks with OpenShift and CustomRule</a></p>
</li>
<li>
<p><a href="https://github.com/google/cel-spec" rel="noopener" target="_blank">CEL specification</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>The Guide to OpenBao - Kubernetes Integration - Part 10</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-08-03-openbao-part-10-kubernetes-integration/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-08-03-openbao-part-10-kubernetes-integration/</guid><pubDate>Mon, 03 Aug 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><description>Integrating OpenBao with Kubernetes workloads using Agent Injector, CSI Provider, and External Secrets Operator on OpenShift</description><content:encoded><![CDATA[<div class="paragraph">
<p>With authentication and secrets engines configured, the next step is enabling applications to consume secrets. This article covers three integration patterns on OpenShift:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>the <strong>Agent Injector</strong> for sidecar injection</p>
</li>
<li>
<p>the <strong>CSI Provider</strong> for volume mounts</p>
</li>
<li>
<p>the <strong>External Secrets Operator (ESO)</strong> for syncing to native Kubernetes Secrets.</p>
</li>
</ol>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>There are three main patterns for Kubernetes workloads to consume OpenBao secrets:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 14.2857%;"/>
<col style="width: 28.5714%;"/>
<col style="width: 28.5714%;"/>
<col style="width: 28.5715%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">How It Works</th>
<th class="tableblock halign-left valign-top">Pros</th>
<th class="tableblock halign-left valign-top">Cons</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Agent Injector</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Sidecar injects secrets as files under <code>/vault/secrets/</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Automatic renewal, templates, dynamic secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Extra container per pod</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">CSI Provider</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Mounts secrets as volumes (optional sync to a Secret)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No sidecar needed</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No continuous auto-renewal (refresh on pod restart)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">External Secrets Operator</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Syncs to native Kubernetes Secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">GitOps-friendly, standard <code>secretKeyRef</code> / volumes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Additional operator + NetworkPolicy considerations on OpenShift</p></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">
OpenBao keeps a Vault-compatible API. Agent Injector annotations still use the <code>vault.hashicorp.com/</code> prefix, and ESO uses its Vault provider. The CSI provider, however, uses <code>provider: openbao</code> and <code>baoAddress</code> / <code>baoCACertPath</code> parameters. Still, it should be easy to understand the differences and map everything to HashiCorp Vault.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_lab_assumptions">Lab assumptions</h3>
<div class="paragraph">
<p>These examples assume:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenBao is installed in namespace <code>openbao</code> with TLS (see the series articles on OpenShift deployment and TLS, and test case <a href="https://tests.stdin.at/tests/TC-OPENBAO-OCP-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-OCP-001</a>).</p>
</li>
<li>
<p>Kubernetes auth is enabled and configured (<a href="https://tests.stdin.at/tests/TC-OPENBAO-AUTH-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-AUTH-001</a> / <a href="/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/" rel="noopener" target="_blank">Part 7</a>).</p>
</li>
<li>
<p>A KV v2 mount exists at <code>secret/</code> (<a href="/openshift-platform/security/secrets-management/openbao/2026-03-25-openbao-part-8-secrets-engines-kv/" rel="noopener" target="_blank">Part 8</a>).</p>
</li>
<li>
<p>Policy <code>myapp</code> allows <code>read</code> on <code>secret/data/myapp/*</code> (and metadata list 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">
<div class="paragraph">
<p>Related <strong>Test Cases</strong> are:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-KV-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-KV-001</a> — Enable and Use KV v2 Secrets Engine</p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-KV-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-KV-003</a> — KV Secret Rotation Pattern with CAS</p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-UC-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-UC-003</a> — Multi-Tenant Secret Isolation</p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-DB-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-DB-001</a> — Dynamic PostgreSQL Credentials</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>These and other test cases are available on <a href="https://tests.stdin.at/" rel="noopener" target="_blank">tests.stdin.at</a>.</p>
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Create the lab namespace and ServiceAccount. This namespace will be reused for all three patterns below:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc new-project myapp
oc create serviceaccount myapp-sa -n myapp</code></pre>
</div>
</div>
<div class="paragraph">
<p>Store sample secrets and bind the auth role to <strong>this</strong> namespace:</p>
</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="paragraph">
<p>OpenBao must be installed and you need proper access to the API.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Brief reminder:
export BAO_CACERT=&#34;$HOME/openbao-tests/openbao-ca.crt&#34;
export BAO_ADDR=&#39;https://127.0.0.1:8200&#39;
export BAO_TOKEN=$(jq -r &#39;.root_token&#39; openbao-init.json)
bao status</code></pre>
</div>
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Allow the myapp identity to read KV v2 data (and list metadata) under secret/myapp/
bao policy write myapp - &lt;&lt;&#39;EOF&#39;
path &#34;secret/data/myapp/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}
path &#34;secret/metadata/myapp/*&#34; {
  capabilities = [&#34;list&#34;]
}
EOF

# Map ServiceAccount myapp-sa in namespace myapp to that policy via Kubernetes auth
bao write auth/kubernetes/role/myapp \
  bound_service_account_names=myapp-sa \
  bound_service_account_namespaces=myapp \
  policies=myapp \
  ttl=1h

# Seed sample secrets for Injector / CSI / ESO examples later in this article
bao kv put secret/myapp/config db_host=pg.example.com db_password=s3cret
bao kv put secret/myapp/api key=api-key-123</code></pre>
</div>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
If <code>cas_required</code> is enabled on the KV mount (<a href="https://tests.stdin.at/tests/TC-OPENBAO-KV-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-KV-002</a>), every write must include <code>-cas=&lt;current_version&gt;</code>. When updating values that ESO or CSI consume, rewrite <strong>all</strong> properties the consumer expects — a partial put replaces the whole version and drops missing keys.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pattern_1_agent_injector">Pattern 1: Agent Injector</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Agent Injector uses a mutating webhook to <strong>inject an init container</strong> and an optional sidecar that authenticates to OpenBao and renders secrets under <code>/vault/secrets/</code>.</p>
</div>
<div class="sect2">
<h3 id="_how_it_works">How It Works</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">1. Pod created with vault.hashicorp.com/* annotations
2. Mutating webhook intercepts admission
3. vault-agent-init (and optionally vault-agent sidecar) injected
4. Agent authenticates with the pod ServiceAccount JWT (Kubernetes auth)
5. Agent retrieves secrets and writes templated files
6. Application reads from /vault/secrets/
7. Sidecar renews tokens / leases and re-renders as needed</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_prerequisites">Prerequisites</h3>
<div class="paragraph">
<p>On the OpenShift Helm deployment used in this series, the injector is enabled with the chart (typically two replicas) as part of <a href="https://tests.stdin.at/tests/TC-OPENBAO-OCP-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-OCP-001</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">injector:
  enabled: true
  replicas: 2</code></pre>
</div>
</div>
<div class="paragraph">
<p>Verify it is running:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get pods -n openbao -l app.kubernetes.io/name=openbao-agent-injector

# Check webhook
oc get mutatingwebhookconfigurations | grep openbao</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_tls_trust_in_the_application_namespace">TLS trust in the application namespace</h3>
<div class="paragraph">
<p>With a TLS listener, the Agent must trust the OpenBao CA. Copy the CA into the app namespace and reference it from annotations (<code>tls-secret</code> / <code>ca-cert</code>):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc create secret generic openbao-ca -n myapp \
  --from-literal=ca.crt=&#34;$(oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d)&#34; \
  --dry-run=client -o yaml | oc apply -f -</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_deploy_an_application_with_annotations">Deploy an application with annotations</h3>
<div class="paragraph">
<p>The Deployment below follows <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-003</a> (OpenBao Agent Sidecar Injector). That test case validates the full path: mutating webhook injection, Kubernetes auth as ServiceAccount <code>myapp-sa</code>, OpenBao role <code>myapp</code>, TLS trust via the <code>openbao-ca</code> secret copied earlier, and rendered files under <code>/vault/secrets/</code>.</p>
</div>
<div class="paragraph">
<p>In practical terms, the annotations tell the Agent to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>authenticate with role <code>myapp</code> (bound to <code>myapp-sa</code> in namespace <code>myapp</code>);</p>
</li>
<li>
<p>fetch KV v2 paths <code>secret/data/myapp/config</code> and <code>secret/data/myapp/api</code>;</p>
</li>
<li>
<p>write templated output to <code>/vault/secrets/config.txt</code> and <code>/vault/secrets/api-key</code>.</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">cat &lt;&lt;EOF | oc apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
      annotations:
        vault.hashicorp.com/agent-inject: &#34;true&#34; <i class="conum" data-value="1"></i><b>(1)</b>
        vault.hashicorp.com/role: &#34;myapp&#34; <i class="conum" data-value="2"></i><b>(2)</b>
        vault.hashicorp.com/tls-secret: &#34;openbao-ca&#34; <i class="conum" data-value="3"></i><b>(3)</b>
        vault.hashicorp.com/ca-cert: &#34;/vault/tls/ca.crt&#34;
        vault.hashicorp.com/agent-inject-secret-config.txt: &#34;secret/data/myapp/config&#34; <i class="conum" data-value="4"></i><b>(4)</b>
        vault.hashicorp.com/agent-inject-template-config.txt: |
          {{- with secret &#34;secret/data/myapp/config&#34; -}}
          DB_HOST={{ .Data.data.db_host }}
          DB_PASSWORD={{ .Data.data.db_password }}
          {{- end }}
        vault.hashicorp.com/agent-inject-secret-api-key: &#34;secret/data/myapp/api&#34;
        vault.hashicorp.com/agent-inject-template-api-key: |
          {{- with secret &#34;secret/data/myapp/api&#34; -}}
          {{ .Data.data.key }}
          {{- end }}
    spec:
      serviceAccountName: myapp-sa <i class="conum" data-value="5"></i><b>(5)</b>
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: app
          image: curlimages/curl:latest
          command: [&#34;sleep&#34;, &#34;infinity&#34;]
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: [&#34;ALL&#34;]
            runAsNonRoot: true
            seccompProfile:
              type: RuntimeDefault
EOF</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 injection (API-compatible <code>vault.hashicorp.com</code> annotations).</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Kubernetes auth role name in OpenBao.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Secret in the app namespace that holds the OpenBao CA.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>KV v2 path includes the <code>/data/</code> segment for the Agent template.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Must match <code>bound_service_account_names</code> / <code>namespaces</code> on the role.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_verify_injection">Verify injection</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get pods -n myapp
# Expect READY 2/2 (app + vault-agent) when the sidecar is enabled

oc get pods -n myapp -o jsonpath=&#39;{.items[0].spec.containers[*].name}{&#34;\n&#34;}&#39;
# Expected: app vault-agent

oc get pods -n myapp -o jsonpath=&#39;{.items[0].spec.initContainers[*].name}{&#34;\n&#34;}&#39;
# Expected: vault-agent-init

oc exec -it deploy/myapp -c app -n myapp -- cat /vault/secrets/config.txt
# Expected: DB_HOST=pg.example.com
#           DB_PASSWORD=s3cret

oc exec -it deploy/myapp -c app -n myapp -- cat /vault/secrets/api-key
# Expected: api-key-123</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_common_annotations">Common annotations</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 40%;"/>
<col style="width: 60%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Annotation</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-inject</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable/disable injection (<code>&#34;true&#34;</code> / <code>&#34;false&#34;</code>)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/role</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenBao Kubernetes auth role</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/tls-secret</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Secret containing the CA used to verify OpenBao TLS</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/ca-cert</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Path to the CA file inside the Agent (for example <code>/vault/tls/ca.crt</code>)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-inject-secret-&lt;name&gt;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Secret path; creates <code>/vault/secrets/&lt;name&gt;</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-inject-template-&lt;name&gt;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Consul Template syntax for rendering the file</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-inject-status</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Set to <code>&#34;update&#34;</code> to force re-injection</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-pre-populate-only</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>&#34;true&#34;</code> = init container only, no sidecar</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/agent-revoke-on-shutdown</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>&#34;true&#34;</code> = revoke the token when the pod terminates</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">vault.hashicorp.com/tls-skip-verify</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Skip TLS verification (lab only — prefer a real CA)</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_init_container_only_mode">Init-container-only mode</h3>
<div class="paragraph">
<p>By default the injector adds both <code>vault-agent-init</code> and a long-running <code>vault-agent</code> sidecar. Set <code>agent-pre-populate-only: &#34;true&#34;</code> when the application only needs secrets <strong>during the init phase</strong> (for example: static KV, config files, API keys). The init container still authenticates, renders files under <code>/vault/secrets/</code>, then exits; the sidecar is omitted, so the pod stays <code>1/1</code> Ready and uses less CPU and memory.</p>
</div>
<div class="paragraph">
<p>Trade-off: there is <strong>no</strong> continuous lease renewal or re-render. If OpenBao rotates a secret or a dynamic credential expires, the application will not see the update until the pod restarts.</p>
</div>
<div class="paragraph">
<p>Minimal annotations for this mode:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">annotations:
  vault.hashicorp.com/agent-inject: &#34;true&#34; <i class="conum" data-value="1"></i><b>(1)</b>
  vault.hashicorp.com/agent-pre-populate-only: &#34;true&#34; <i class="conum" data-value="2"></i><b>(2)</b>
  vault.hashicorp.com/role: &#34;myapp&#34; <i class="conum" data-value="3"></i><b>(3)</b>
  vault.hashicorp.com/tls-secret: &#34;openbao-ca&#34; <i class="conum" data-value="4"></i><b>(4)</b>
  vault.hashicorp.com/ca-cert: &#34;/vault/tls/ca.crt&#34;
  vault.hashicorp.com/agent-inject-secret-config.txt: &#34;secret/data/myapp/config&#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 the mutating webhook for this pod.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Init container only — skip the sidecar.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Kubernetes auth role (must match SA name/namespace bindings).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>CA Secret in the app namespace so the Agent trusts OpenBao TLS.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>KV v2 path to render as <code>/vault/secrets/config.txt</code> (add further <code>agent-inject-secret-*</code> / template annotations as needed).</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
For dynamic database credentials with lease renewal, prefer the full sidecar mode, see <a href="https://tests.stdin.at/tests/TC-OPENBAO-UC-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-UC-002</a> (Agent sidecar + PostgreSQL role).
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pattern_2_csi_provider">Pattern 2: CSI Provider</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Secrets Store CSI Driver mounts secrets as files without an application sidecar. On OpenShift the lab flow is: install the driver (OperatorHub/Software Catalog preferred), manage <code>ClusterCSIDriver</code>, grant the provider SCC, enable the OpenBao CSI DaemonSet on the existing Helm release, then create a <code>SecretProviderClass</code>.</p>
</div>
<div class="paragraph">
<p>This section aligns with <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-002</a> and the <a href="https://openbao.org/docs/platform/k8s/csi/" rel="noopener" target="_blank">OpenBao CSI documentation</a>.</p>
</div>
<div class="sect2">
<h3 id="_installing_the_secrets_store_csi_driver">Installing the Secrets Store CSI Driver</h3>
<div class="paragraph">
<p>Prefer the OpenShift Operator:</p>
</div>
<div class="paragraph">
<p>Install <strong>Secrets Store CSI Driver for Red Hat OpenShift</strong> from OperatorHub. Search for &#34;Secrets Store CSI Driver for Red Hat OpenShift&#34; and install the operator with the default settings.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part10_CSIStorageOperator.png?width=840px" alt="OperatorHub/Software Catalog — Secrets Store CSI Driver for Red Hat OpenShift"/>
</div>
</div>
<div class="paragraph">
<p>On OpenShift, each CSI driver is switched on with a cluster-scoped <code>ClusterCSIDriver</code> whose <code>metadata.name</code> must match the driver identifier — here it is <code>secrets-store.csi.k8s.io</code>.</p>
</div>
<div class="paragraph">
<p>Create that object next:</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: ClusterCSIDriver
metadata:
  name: secrets-store.csi.k8s.io <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  managementState: Managed</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Must equal the Secrets Store CSI driver name</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_openbao_csi_provider_on_openshift">OpenBao CSI provider on OpenShift</h3>
<div class="paragraph">
<p>The provider uses <code>hostPath</code> and needs the privileged SCC:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc adm policy add-scc-to-user privileged -z openbao-csi-provider -n openbao</code></pre>
</div>
</div>
<div class="paragraph">
<p>Enable CSI on the existing OpenBao Helm release (chart <strong>0.18.0+</strong>), mounting the OpenBao CA into the DaemonSet — same steps (Step 4) as <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-002</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">
If this was done already, you can skip this step. The important part here is to enable the CSI part in OpenBao.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm upgrade --install openbao openbao/openbao -n openbao --reuse-values \
  --set csi.enabled=true \
  --set csi.daemonSet.securityContext.container.privileged=true \
  --set &#39;csi.volumes[0].name=openbao-ca&#39; \
  --set &#39;csi.volumes[0].secret.secretName=openbao-ca-secret&#39; \
  --set &#39;csi.volumeMounts[0].name=openbao-ca&#39; \
  --set &#39;csi.volumeMounts[0].mountPath=/openbao/tls&#39; \
  --set &#39;csi.volumeMounts[0].readOnly=true&#39; \
  --set &#39;csi.agent.extraArgs[0]=-ca-path=/openbao/tls/ca.crt&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Verify:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get ds -n openbao openbao-csi-provider
# Desired/Ready should match the node count</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_creating_a_secretproviderclass">Creating a SecretProviderClass</h3>
<div class="paragraph">
<p>A <code>SecretProviderClass</code> tells the Secrets Store CSI driver <strong>which provider</strong> to call and <strong>which secrets to mount</strong>. The CSI node plugin talks to the OpenBao CSI provider DaemonSet over gRPC; that provider then authenticates to OpenBao (Kubernetes auth role <code>myapp</code> in our test case) and fetches the listed objects.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Unlike the Agent Injector annotations and ESO’s Vault provider, the CSI parameters are OpenBao-specific. The CA file path must match the volume mounted into the provider DaemonSet in the Helm step above (<code>/openbao/tls/ca.crt</code>), so TLS verification succeeds.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: openbao-secrets
  namespace: myapp
spec:
  provider: openbao <i class="conum" data-value="1"></i><b>(1)</b>
  parameters:
    baoAddress: &#34;https://openbao.openbao.svc:8200&#34; <i class="conum" data-value="2"></i><b>(2)</b>
    baoCACertPath: &#34;/openbao/tls/ca.crt&#34; <i class="conum" data-value="3"></i><b>(3)</b>
    roleName: &#34;myapp&#34; <i class="conum" data-value="4"></i><b>(4)</b>
    objects: |
      - objectName: &#34;db_password&#34;
        secretPath: &#34;secret/data/myapp/config&#34;
        secretKey: &#34;db_password&#34;
      - objectName: &#34;api_key&#34;
        secretPath: &#34;secret/data/myapp/api&#34;
        secretKey: &#34;key&#34;
  secretObjects: <i class="conum" data-value="5"></i><b>(5)</b>
    - secretName: myapp-synced
      type: Opaque
      data:
        - objectName: db_password
          key: db_password
        - objectName: api_key
          key: api_key</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>OpenBao CSI provider name — do not use <code>vault</code> here.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>In-cluster Service DNS and HTTPS listener; avoid the public Route for node-local mounts.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>CA path <strong>inside the CSI provider DaemonSet</strong> (from the Helm <code>csi.volumeMounts</code>), not a path in the app pod.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Kubernetes auth role; the mounting pod’s ServiceAccount must match the role bindings.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Optional: also sync mounted files into a native Secret (<code>myapp-synced</code>) for <code>secretKeyRef</code> / env vars.</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_using_csi_in_a_pod">Using CSI in a Pod</h3>
<div class="paragraph">
<p>The application pod does <strong>not</strong> talk to OpenBao itself. It mounts an ephemeral CSI volume that references the <code>SecretProviderClass</code>. On start, kubelet asks the Secrets Store CSI driver; the driver calls the OpenBao provider, which logs in with the pod’s ServiceAccount JWT and writes the secret objects into the volume (and, if configured, into the synced Secret).</p>
</div>
<div class="paragraph">
<p>Use the same ServiceAccount (<code>myapp-sa</code>) that the OpenBao role allows. Unlike the Agent Injector, there is no sidecar — the pod stays a single container, and secret files appear under the mount path you choose (here <code>/mnt/secrets</code>).</p>
</div>
<div class="paragraph">
<p>This time a simple Pod …​ because I am too lazy to create a Deployment.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  namespace: myapp
spec:
  serviceAccountName: myapp-sa <i class="conum" data-value="1"></i><b>(1)</b>
  securityContext:
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault
  containers:
    - name: app
      image: curlimages/curl:latest
      command: [&#34;sleep&#34;, &#34;infinity&#34;]
      securityContext:
        allowPrivilegeEscalation: false
        capabilities:
          drop: [&#34;ALL&#34;]
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      volumeMounts:
        - name: secrets
          mountPath: /mnt/secrets <i class="conum" data-value="2"></i><b>(2)</b>
          readOnly: true
      env:
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: myapp-synced <i class="conum" data-value="3"></i><b>(3)</b>
              key: db_password
  volumes:
    - name: secrets
      csi:
        driver: secrets-store.csi.k8s.io <i class="conum" data-value="4"></i><b>(4)</b>
        readOnly: true
        volumeAttributes:
          secretProviderClass: openbao-secrets <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>Must match <code>bound_service_account_names</code> / <code>namespaces</code> on role <code>myapp</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Files such as <code>db_password</code> and <code>api_key</code> appear here (<code>objectName</code> from the SecretProviderClass).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Optional env consumption via the synced Secret from <code>secretObjects</code> — only works if that block was defined.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Driver registered by the <code>ClusterCSIDriver</code> earlier in this section.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Links this volume to the <code>SecretProviderClass</code> in the same namespace.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc exec -it myapp-pod -n myapp -- ls -la /mnt/secrets/
oc exec -it myapp-pod -n myapp -- cat /mnt/secrets/db_password</code></pre>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_pattern_3_external_secrets_operator_eso">Pattern 3: External Secrets Operator (ESO)</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The External Secrets Operator (ESO) synchronises secrets from OpenBao into native Kubernetes Secrets. It is a controller that talks to an external secrets backend (OpenBao here) and creates a native Secret in the namespace for the application to consume. The OpenShift lab path is <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-001</a>.</p>
</div>
<div class="sect2">
<h3 id="_installing_external_secrets_operator">Installing External Secrets Operator</h3>
<div class="paragraph">
<p>On OpenShift, install <strong>External Secrets Operator for Red Hat OpenShift</strong> from OperatorHub/Software Catalog. After the Operator is installed, create an <code>ExternalSecretsConfig</code> named <code>cluster</code>. This is a cluster-scoped object and will start the controller.</p>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
The default NetworkPolicies for the Red Hat ESO operand deny egress. Without an allow rule to OpenBao on TCP/8200, SecretStore login fails with <code>context deadline exceeded</code>.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: operator.openshift.io/v1alpha1
kind: ExternalSecretsConfig
metadata:
  name: cluster
spec:
  controllerConfig:
    networkPolicies:
      - name: allow-openbao-egress
        componentName: ExternalSecretsCoreController
        egress:
          - ports:
              - protocol: TCP
                port: 8200
            to:
              - namespaceSelector:
                  matchLabels:
                    kubernetes.io/metadata.name: openbao</code></pre>
</div>
</div>
<div class="paragraph">
<p>Verify the deployment:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get pods -n external-secrets</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_creating_a_secretstore">Creating a SecretStore</h3>
<div class="paragraph">
<p>A <code>SecretStore</code> is a <strong>namespaced</strong> object that defines the connection to OpenBao: it tells ESO how to reach OpenBao and how to authenticate. It does not create application Secrets by itself — that is the job of an <code>ExternalSecret</code> in the next step.</p>
</div>
<div class="paragraph">
<p>Because the lab uses TLS, first fetch the CA certificate from the OpenBao CA Secret and use it for the <strong>SecretStore</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Base64 CA PEM (one line) for caBundle
oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}{&#34;\n&#34;}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>ESO has no separate “OpenBao” provider. Use the <strong>Vault</strong> provider against OpenBao’s compatible API, with Kubernetes auth and the same <code>myapp</code> / <code>myapp-sa</code> bindings as Injector and CSI:</p>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
Replace the <code>&lt;BASE64_CA_PEM&gt;</code> with the base64 encoded CA certificate.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
  name: openbao-backend
  namespace: myapp
spec:
  provider:
    vault: <i class="conum" data-value="1"></i><b>(1)</b>
      server: &#34;https://openbao.openbao.svc:8200&#34; <i class="conum" data-value="2"></i><b>(2)</b>
      path: &#34;secret&#34; <i class="conum" data-value="3"></i><b>(3)</b>
      version: &#34;v2&#34;
      caBundle: &#34;&lt;BASE64_CA_PEM&gt;&#34; <i class="conum" data-value="4"></i><b>(4)</b>
      auth:
        kubernetes:
          mountPath: &#34;kubernetes&#34;
          role: &#34;myapp&#34; <i class="conum" data-value="5"></i><b>(5)</b>
          serviceAccountRef:
            name: myapp-sa</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Vault provider → OpenBao’s compatible HTTP API (there is no <code>openbao:</code> block in ESO yet).</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>In-cluster Service over HTTPS; the ESO controller must be allowed to reach it (NetworkPolicy above).</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>KV mount path <strong>without trailing slash</strong>; version.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Paste the base64 value from <code>openbao-ca-secret</code> (do not wrap or re-encode).</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Role and SA must match OpenBao’s Kubernetes auth bindings for namespace <code>myapp</code>.</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 secretstore openbao-backend -n myapp
# STATUS should indicate Ready / Valid</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">
If the store stays Not Ready, check NetworkPolicy egress to OpenBao, the <code>caBundle</code>, and that role <code>myapp</code> still allows <code>myapp-sa</code> in <code>myapp</code>.
</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">
For cluster-wide access, use a <code>ClusterSecretStore</code> with a ServiceAccount that OpenBao trusts (role + policy bound to that SA/namespace).
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_creating_an_externalsecret">Creating an ExternalSecret</h3>
<div class="paragraph">
<p>An <code>ExternalSecret</code> maps remote OpenBao keys onto a <strong>native</strong> Kubernetes Secret. ESO periodically authenticates via the <code>SecretStore</code>, reads the listed properties, and writes (or updates) the target Secret. Applications then use ordinary <code>secretKeyRef</code> or volume mounts — they never call OpenBao directly. This keeps applications secret-agnostic so developers can keep using ordinary Kubernetes Secret consumption.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: myapp-secrets
  namespace: myapp
spec:
  refreshInterval: &#34;5m&#34; <i class="conum" data-value="1"></i><b>(1)</b>
  secretStoreRef:
    name: openbao-backend
    kind: SecretStore
  target:
    name: myapp-secrets <i class="conum" data-value="2"></i><b>(2)</b>
    creationPolicy: Owner
    template:
      type: Opaque
  data:
    - secretKey: db_host <i class="conum" data-value="3"></i><b>(3)</b>
      remoteRef:
        key: myapp/config <i class="conum" data-value="4"></i><b>(4)</b>
        property: db_host
    - secretKey: db_password
      remoteRef:
        key: myapp/config
        property: db_password
    - secretKey: api_key
      remoteRef:
        key: myapp/api
        property: key</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>How often ESO re-reads OpenBao; use <code>force-sync</code> (below) for an immediate refresh in the lab.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Name of the Kubernetes Secret that ESO creates or owns in this namespace.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Key name <strong>inside</strong> the Kubernetes Secret (what the app will reference).</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Path relative to the store’s <code>path: secret</code> — <strong>without</strong> the KV v2 <code>/data/</code> segment.</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">
For KV v2, ESO’s <code>remoteRef.key</code> is typically <code>myapp/config</code>, while Agent/CSI templates use <code>secret/data/myapp/config</code>. Mixing the two path styles is a common source of sync errors.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify:</p>
</div>
<div class="paragraph">
<p>The first command will show the status of the sync process. The second command will fetch the actual generated secret and show the keys and values.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get ExternalSecret myapp-secrets -n myapp
# STATUS should be SecretSynced

oc get secret myapp-secrets -n myapp -o jsonpath=&#39;{.data}&#39; | \
  jq &#39;to_entries[] | {key: .key, value: (.value | @base64d)}&#39;
# Should show db_host, db_password, api_key</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_fetching_all_keys_from_a_specific_path">Fetching all keys from a specific path</h3>
<div class="paragraph">
<p>When every field under one OpenBao secret should become a Kubernetes Secret key, use <code>dataFrom.extract</code> instead of listing each <code>property</code>. Here all keys from <code>secret/myapp/config</code> (for example <code>db_host</code>, <code>db_password</code>) are copied into <code>myapp-all-config</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: myapp-all-config
  namespace: myapp
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: openbao-backend
    kind: SecretStore
  target:
    name: myapp-all-config
  dataFrom:
    - extract:
        key: myapp/config</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_using_the_generated_secret">Using the generated Secret</h3>
<div class="paragraph">
<p>Once the ExternalSecret is synced, treat <code>myapp-secrets</code> like any other Opaque Secret: environment variables via <code>secretKeyRef</code>, or files via a <code>secret</code> volume. No Injector annotations or CSI <code>SecretProviderClass</code> are required on the workload.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-eso
  namespace: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp-eso
  template:
    metadata:
      labels:
        app: myapp-eso
    spec:
      containers:
        - name: app
          image: registry.access.redhat.com/ubi9/ubi-minimal:latest
          command: [&#34;sleep&#34;, &#34;infinity&#34;] <i class="conum" data-value="1"></i><b>(1)</b>
          env:
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: myapp-secrets <i class="conum" data-value="2"></i><b>(2)</b>
                  key: db_host
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: myapp-secrets
                  key: db_password
          volumeMounts:
            - name: config
              mountPath: /etc/config
              readOnly: true
      volumes:
        - name: config
          secret:
            secretName: myapp-secrets <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>Keeps the lab Pod running so <code>oc exec</code> verification works; replace with the real application entrypoint in production.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Keys match <code>secretKey</code> values from the ExternalSecret <code>data</code> list.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Same Secret mounted as files under <code>/etc/config</code> (one file per key).</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Verify:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Environment variables from secretKeyRef
oc exec -n myapp deploy/myapp-eso -- printenv DB_HOST DB_PASSWORD
# Expect the decoded values from myapp-secrets

# Files from the secret volume (one file per key)
oc exec -n myapp deploy/myapp-eso -- ls -l /etc/config
# Expect db_host, db_password, api_key</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_refresh_after_an_openbao_update">Refresh after an OpenBao update</h3>
<div class="paragraph">
<p>KV v2 writes replace the <strong>entire</strong> version. When you rotate a password, rewrite every property the ExternalSecret still expects, or those keys disappear from the synced Secret. If <code>cas_required</code> is enabled, include <code>-cas=&lt;current_version&gt;</code> (see <a href="https://tests.stdin.at/tests/TC-OPENBAO-KV-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-KV-002</a>).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Rewrite all fields the ExternalSecret reads (KV v2 put replaces the version)
bao kv put --cas=&lt;latest_version&gt; secret/myapp/config \
  db_host=pg.example.com \
  db_password=newP@ssw0rd

# Force an immediate sync (do not wait for refreshInterval)
oc annotate externalsecret myapp-secrets -n myapp force-sync=$(date +%s) --overwrite</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_verifying_externalsecret_status">Verifying ExternalSecret status</h3>
<div class="paragraph">
<p>Confirm both the ExternalSecret condition and the materialised Secret contents:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get externalsecret -n myapp
# Expect SecretSynced / Ready

oc get secret myapp-secrets -n myapp -o jsonpath=&#39;{.data}&#39; | \
  jq &#39;to_entries[] | {key: .key, value: (.value | @base64d)}&#39;</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_comparing_integration_methods">Comparing integration methods</h2>
<div class="sectionbody">
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
<col style="width: 25%;"/>
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Feature</th>
<th class="tableblock halign-left valign-top">Agent Injector</th>
<th class="tableblock halign-left valign-top">CSI Provider</th>
<th class="tableblock halign-left valign-top">ESO</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Auto-renewal</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No (pod lifecycle)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (refresh interval / force-sync)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Sidecar needed</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</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">No</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">GitOps-friendly</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Annotations on workloads</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">SecretProviderClass + pod volume</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (ExternalSecret CRs)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Standard K8s Secret</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">No (files; optional app logic)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Optional via <code>secretObjects</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Dynamic secrets</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Limited</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Limited</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Template support</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Yes (Agent templates)</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 (ESO templates)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift extras</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Injector CA secret</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ClusterCSIDriver, SCC, Helm CSI</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ExternalSecretsConfig + NetworkPolicy</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="_best_practices">Best practices</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_choose_the_right_pattern">Choose the right pattern</h3>
<div class="ulist">
<ul>
<li>
<p><strong>Agent Injector</strong>: auto-renewal, dynamic secrets, or Consul Template-style files (<a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-003</a>, <a href="https://tests.stdin.at/tests/TC-OPENBAO-UC-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-UC-002</a>).</p>
</li>
<li>
<p><strong>CSI Provider</strong>: simple file mounts or synced Secrets without a sidecar (<a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-002</a>).</p>
</li>
<li>
<p><strong>ESO</strong>: GitOps and native <code>Secret</code> consumption (<a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-001</a>); combine with Sealed Secrets migration patterns in <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-004?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-004</a> if you are moving off Bitnami Sealed Secrets.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_security_considerations">Security considerations</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Bind roles to a single namespace and SA
bao write auth/kubernetes/role/myapp \
  bound_service_account_names=myapp-sa \
  bound_service_account_namespaces=myapp \
  policies=myapp \
  ttl=1h

# Prefer short TTLs for dynamic database roles
bao write database/roles/myapp-readonly \
  default_ttl=1h \
  max_ttl=4h</code></pre>
</div>
</div>
<div class="paragraph">
<p>Always trust OpenBao TLS with a real CA (<code>caBundle</code>, <code>baoCACertPath</code>, or <code>tls-secret</code>) instead of <code>tls-skip-verify</code> outside throwaway labs.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This article covered three patterns for integrating OpenBao with Kubernetes and OpenShift:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Agent Injector</strong>: dynamic secrets and auto-renewal via annotated pods</p>
</li>
<li>
<p><strong>CSI Provider</strong>: volume mounts (and optional synced Secrets) with the OpenBao CSI provider</p>
</li>
<li>
<p><strong>External Secrets Operator</strong>: GitOps-friendly native Secrets, including OpenShift NetworkPolicy and TLS details</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Choose the pattern that fits each workload, or combine them. Step-by-step validation lives in the OpenBao plan on <a href="https://tests.stdin.at/?product=openbao" rel="noopener" target="_blank">tests.stdin.at</a>: <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-001 — ESO</a>, <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-002 — CSI</a>, <a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-003 — Injector</a>.</p>
</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/platform/k8s/injector" rel="noopener" target="_blank">Agent Injector documentation</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/platform/k8s/csi" rel="noopener" target="_blank">CSI Provider documentation</a></p>
</li>
<li>
<p><a href="https://external-secrets.io/latest/provider/hashicorp-vault/" rel="noopener" target="_blank">External Secrets Operator — Vault provider</a></p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-001?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-001 — ESO</a></p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-002?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-002 — CSI</a></p>
</li>
<li>
<p><a href="https://tests.stdin.at/tests/TC-OPENBAO-INT-003?product=openbao" rel="noopener" target="_blank">TC-OPENBAO-INT-003 — Injector</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>RBAC Overview — an OpenShift Console plugin</title><link>https://blog.stderr.at/openshift-platform/security/rbac/2026-06-10-rbac-overview-console-plugin/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/rbac/2026-06-10-rbac-overview-console-plugin/</guid><pubDate>Wed, 10 Jun 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><category>Day-2</category><description>Install the RBAC Overview console plugin to inspect OpenShift cluster admins, namespace access, subjects, who-can queries and SCC authorisations in the UI.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Answering the question <strong>&#34;who can do what on this cluster?&#34;</strong> usually means juggling oc commands, YAML dumps, and several console pages. RoleBindings live in namespaces, ClusterRoleBindings are cluster-scoped, OpenShift adds Users and Groups on top of Kubernetes subjects, and SecurityContextConstraints have their own authorisation model. For a quick audit before a change window, that is a lot of clicking and I always struggled to find a quick and reliable way to get and overview. For example, I always wanted to see immediately which users have cluster-admin rights or which service accounts are on the privileged SCC.</p>
</div>
<div class="paragraph">
<p>The <strong>RBAC Overview</strong> is a dynamic <strong>OpenShift Console plugin</strong> that pulls these views into one place. This article walks through what it does, how to install or test it, and how I use the tabs in practice. This open source plugin is available on <a href="https://github.com/tjungbauer/openshift-console-rbac-overview" rel="noopener" target="_blank">GitHub</a></p>
</div>
<div class="sect1">
<h2 id="_why_another_rbac_view">Why another RBAC view?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The console already lists RoleBindings, ClusterRoleBindings, Users, and Groups. That is sufficient when you know exactly which resource you need. It is less helpful when you start from a question:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Who has cluster-admin outside the usual system groups?</p>
</li>
<li>
<p>What can user alice do in the namespace openshift-gitops?</p>
</li>
<li>
<p>Which groups may get pods in the namespace default?</p>
</li>
<li>
<p>Which service accounts are on the privileged SCC?</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The RBAC Overview plugins tries to fix these questions. Each tab uses the Kubernetes and OpenShift authorization APIs (<code>SelfSubjectReview</code>, <code>ResourceAccessReview</code>, <code>SubjectAccessReview</code>, and list permissions) rather than re-implementing policy evaluation in the browser.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_you_get">What you get</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Navigation: The plugin hooks into the <strong>Administrator perspective → User Management → RBAC Overview</strong> (entry appears above <strong>Users</strong>).</p>
</div>
<div class="paragraph">
<p>As direct URL you can use: <code>&lt;cluster-url&gt;/rbac-overview</code>.</p>
</div>
<div class="paragraph">
<p>The following tabs are available:</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">Tab</th>
<th class="tableblock halign-left valign-top">Question it answers</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Who can</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Who may perform a certain action or whether one subject is allowed to do certain actions. It basically mirrors the <code>oc adm policy who-can</code> command and presents the results in a more user-friendly way.
The tab also includes a <strong>Show my access</strong> button for the logged-in user, which shows what the logged in user can do on the cluster.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Cluster admins</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Cluster-wide and namespace-scoped bindings to sensitive roles (<code>cluster-admin</code>, <code>admin</code>, or roles you configure). This helps to see which users have elevated rights and which namespaces are affected.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Namespace access</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All bindings that affect one namespace — local RoleBindings and applicable ClusterRoleBindings.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Subjects</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pick a user, group, or service account and inspect its bindings. This helps to inspect a certain subject and see which roles are bound to it.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Role access</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pick a ClusterRole and list every ClusterRoleBinding and RoleBinding that references it — the inverse of the Subjects tab when you start from a role name instead of a user or group.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>SCC access</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All SCCs with key fields, direct <code>users</code> / <code>groups</code> / <code>serviceAccounts</code> on each SCC, and RBAC grants to <code>use securitycontextconstraints</code>. This helps to see which users, groups, and service accounts are on which SCCs and which RBAC grants are in place.</p></td>
</tr>
</tbody>
</table>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_architecture_in_brief">Architecture in brief</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The plugin follows the usual dynamic plugin pattern:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Webpack builds static assets (<code>plugin-manifest.json</code>, JavaScript bundles, locales).</p>
</li>
<li>
<p>A container image serves those files over <strong>HTTPS on port 9443</strong> (required by the <code>ConsolePlugin</code> API).</p>
</li>
<li>
<p>Helm installs Deployment, Service, ConsolePlugin, ConfigMap (<code>plugin-config.json</code>), and optionally a Job that enables the plugin on the console. (Plugins must be enabled by the console operator.)</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The runtime image uses <a href="https://hummingbird-project.io/" rel="noopener" target="_blank">Project Hummingbird</a> (<code>registry.access.redhat.com/hi/nginx</code>). I tried this as they are expected to be super-small distroless images, with the goal to have zero CVEs …​ and the size of the image is really only 19MB.</p>
</div>
<div class="paragraph">
<p>The nginx that is used in this image is serving <code>dist/</code> with a serving certificate injected by OpenShift. There is no application logic in the container beyond static files.</p>
</div>
<div class="paragraph">
<p>Configuration for <strong>sensitive roles</strong> on the Cluster admins tab is delivered via <code>plugin-config.json</code> (Helm values → ConfigMap).
Default entries include <code>cluster-admin</code> and <code>admin</code>; you can add names or label ClusterRoles with <code>rbac-overview.io/elevated: &#34;true&#34;</code>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>OpenShift Container Platform or OKD <strong>4.10+</strong> (dynamic console plugins)</p>
</li>
<li>
<p>For cluster install: Helm 3, <code>oc</code>, Podman or Docker, and permission to push your image registry</p>
</li>
<li>
<p>For local development: Node.js 22+, npm, and <code>oc login</code> with a <strong>bearer token</strong> (not certificate-only kubeconfig)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The plugin is tested against recent 4.20+ consoles. Match the console SDK generation to your cluster (the repository currently targets <code>@openshift-console/dynamic-plugin-sdk@4.21-latest</code>).</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_install_on_a_cluster">Install on a cluster</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_install_with_helm">Install with Helm</h3>
<div class="paragraph">
<p>Log in to the cluster, then install the chart. The published and public plugin image is <code>quay.io/tjungbau/openshift-console-rbac-overview:1.0.5</code> (chart version <strong>1.0.5</strong>).</p>
</div>
<div class="paragraph">
<p>From the <a href="https://github.com/tjungbauer/openshift-console-rbac-overview" rel="noopener" target="_blank">repository</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc login https://&lt;api-url&gt;:6443 -u &lt;user&gt; -p &#39;&lt;password&gt;&#39;

git clone https://github.com/tjungbauer/openshift-console-rbac-overview.git
cd openshift-console-rbac-overview

helm upgrade --install rbac-overview ./chart/rbac-overview \
  --namespace rbac-overview \
  --create-namespace \
  --set namespace.create=false \
  --set image.tag=1.0.5 \
  --set image.pullPolicy=Always \
  --wait</code></pre>
</div>
</div>
<div class="paragraph">
<p>Or add the published Helm repository (no clone required):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm repo add rbac-overview https://tjungbauer.github.io/openshift-console-rbac-overview
helm repo update

helm upgrade --install rbac-overview rbac-overview/rbac-overview \
  --namespace rbac-overview \
  --create-namespace \
  --set namespace.create=false \
  --set image.tag=1.0.5 \
  --wait</code></pre>
</div>
</div>
<div class="paragraph">
<p>The chart defaults to <code>quay.io/tjungbau/openshift-console-rbac-overview</code>; set <code>image.tag</code> only when you need a specific release.</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 combine <code>helm --create-namespace</code> with <code>--set namespace.create=true</code>. Helm 4 reports an ownership error on the Namespace object. Use <code>--create-namespace</code> and <code>namespace.create=false</code> as shown above. I will clean this up in the future.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_build_your_own_image">Build your own image</h3>
<div class="paragraph">
<p>If you prefer to create your own image, for example in an air-gapped environment, you are free to do so. The runtime image is a thin nginx layer on top of webpack output — there is no <code>npm</code> step inside the container. This helps keep the image small and avoids unnecessary dependencies.</p>
</div>
<div class="paragraph">
<p>From the repository root:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">npm install
npm run build    # writes dist/ (plugin-manifest.json, bundles, locales)

podman build --platform=linux/amd64 \ <i class="conum" data-value="1"></i><b>(1)</b>
  -t &lt;your-registry-repository&gt;/:&lt;tag&gt; .

podman login &lt;your-registry-repository&gt;    # if your repository is private

podman push &lt;your-registry-repository&gt;/:&lt;tag&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>Use your own registry, repository and version tag.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Then point Helm at your image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm upgrade --install rbac-overview ./chart/rbac-overview \
  --namespace rbac-overview \
  --create-namespace \
  --set namespace.create=false \
  --set image.repository=&lt;your-registry-repository&gt; \ <i class="conum" data-value="1"></i><b>(1)</b>
  --set image.tag=&lt;tag&gt; \ <i class="conum" data-value="2"></i><b>(2)</b>
  --set image.pullPolicy=Always \
  --wait</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 your own registry and repository.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Use your own version tag.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The repository also ships <code>scripts/build-install.sh</code>, which runs <code>npm run build</code>, builds and pushes the image, installs the chart, and runs verification checks in one pass:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">chmod +x scripts/build-install.sh
QUAY_USER=&lt;your-quay-user&gt; ./scripts/build-install.sh</code></pre>
</div>
</div>
<div class="paragraph">
<p>Override <code>VERSION</code> or <code>PLATFORM</code> when the tag should differ from <code>package.json</code> or when you build on Apple Silicon for a <code>linux/amd64</code> 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">
The script was created due to my own lazyness and it has quay.io hardcoded.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>After install, confirm the plugin is enabled:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get console.operator cluster -o jsonpath=&#39;{.spec.plugins}{&#34;\n&#34;}&#39;
oc -n rbac-overview get deploy,consoleplugin</code></pre>
</div>
</div>
<div class="paragraph">
<p>Open the console, switch to <strong>Administrator</strong>, and reload <strong>User Management → RBAC Overview</strong>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_local_development">Local development</h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you like to test the plugin locally first, you can do so by running the following commands - no image build required:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># terminal 1
npm install
npm run start

# terminal 2
oc login ...           # must provide a token: oc whoami --show-token
npm run start-console  # console on http://localhost:9000</code></pre>
</div>
</div>
<div class="paragraph">
<p>Open <a href="http://localhost:9000/rbac-overview" rel="noopener" target="_blank">http://localhost:9000/rbac-overview</a>. The console loads the plugin from <code>localhost:9001</code> while API calls use your <code>oc</code> session.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
On Apple Silicon, set <code>CONSOLE_IMAGE_PLATFORM=linux/amd64</code> before <code>npm run start-console</code>.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_using_the_plugin">Using the plugin</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_who_can">Who can</h3>
<div class="paragraph">
<p>The default tab mirrors <code>oc adm policy who-can</code> for namespaced and cluster-scoped resources.</p>
</div>
<div class="paragraph">
<p><strong>Query mode</strong> offers:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Who can</strong> — list subjects allowed to perform the action</p>
</li>
<li>
<p><strong>Can subject</strong> — check one user, group, or service account</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Set <strong>Scope</strong>, <strong>Verb</strong>, <strong>Resource</strong>, optional <strong>API group</strong>, <strong>Subresource</strong>, <strong>Resource name</strong>, and for namespaced queries a real <strong>Namespace</strong>.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-who-can-results.png?width=900px" alt="Who can results for get pods in default"/>
</div>
</div>
<div class="paragraph">
<p>The button <strong>Show my access</strong> lists groups, visible namespaces, and role bindings for the logged-in user. This becomes handy when someone asks <strong>what can I actually see on this cluster?</strong></p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-my-access.png?width=900px" alt="Show my access panel"/>
</div>
</div>
<div class="paragraph">
<p>From <strong>My access</strong> you can jump to <strong>Can subject</strong> with your user pre-filled, or open the <strong>Subjects</strong> tab on yourself.</p>
</div>
</div>
<div class="sect2">
<h3 id="_cluster_admins">Cluster admins</h3>
<div class="paragraph">
<p>This tab highlights bindings to roles you treat as <strong>elevated</strong> (configured in plugin-config.json or via the rbac-overview.io/elevated label on ClusterRoles).</p>
</div>
<div class="paragraph">
<p>Sub tabs:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Cluster-wide admins</strong> — ClusterRoleBindings to sensitive ClusterRoles.</p>
</li>
<li>
<p><strong>Namespace elevated</strong> — RoleBindings in any namespace that reference sensitive roles.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-cluster-admins.png?width=900px" alt="Cluster-wide sensitive bindings"/>
</div>
</div>
<div class="paragraph">
<p>Use <strong>View rules</strong> on a row to expand policy rules below the table.</p>
</div>
</div>
<div class="sect2">
<h3 id="_namespace_access">Namespace access</h3>
<div class="paragraph">
<p>Select a namespace, then browse:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>In namespace</strong> — RoleBindings defined in that namespace.</p>
</li>
<li>
<p><strong>Cluster-wide</strong> — ClusterRoleBindings whose ClusterRoles apply there.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-namespace-access.png?width=900px" alt="Namespace access for openshift-gitops"/>
</div>
</div>
<div class="paragraph">
<p>The default filter shows <strong>User</strong> and <strong>Group</strong> subjects; add <strong>ServiceAccount</strong> when you care about workload identities.</p>
</div>
</div>
<div class="sect2">
<h3 id="_subjects">Subjects</h3>
<div class="paragraph">
<p>If you are interested to query a specific subject (user, group etc.) you can use this tab. The list merges:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>subjects found in RoleBindings and ClusterRoleBindings across the cluster, and</p>
</li>
<li>
<p>Users, Groups, and ServiceAccounts returned by the OpenShift user API (where your account may list them).</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-subjects.png?width=900px" alt="Subjects tab with user and group filter"/>
</div>
</div>
<div class="paragraph">
<p>Select an entry to see binding details on the right, open linked resources, or continue in <strong>Who can → Can subject</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 error message that appears in the screenshot for the selected user is due to the fact that there are no bindings for this user. This is normal and expected.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_role_access">Role access</h3>
<div class="paragraph">
<p>The <strong>Subjects</strong> tab answers <strong>who has what bound to them?</strong> <strong>Role access</strong> flips the question: <strong>who is bound to this ClusterRole?</strong> That is useful when you audit a built-in or custom ClusterRole (<code>view</code>, <code>edit</code>, <code>cluster-admin</code>, or a role you ship with an operator) and need every ClusterRoleBinding and RoleBinding that references it in one table.</p>
</div>
<div class="paragraph">
<p>Pick a <strong>ClusterRole</strong> from the dropdown. The table lists matching bindings with scope, namespace (for namespaced RoleBindings), role kind, subjects, and <strong>View rules</strong> to expand the ClusterRole policy inline.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-role-access.png?width=900px" alt="Role access for ClusterRole cluster-admin"/>
</div>
</div>
<div class="paragraph">
<p>The screenshot shows <code>cluster-admin</code> with 30 bindings — a mix of human users, the <code>cluster-admins</code> group, and OpenShift system groups such as <code>system:openshift:operator:kube-apiserver-operator</code>.</p>
</div>
</div>
<div class="sect2">
<h3 id="_scc_access">SCC access</h3>
<div class="paragraph">
<p>To get a quick overview about SCC and who is on which SCC was always tricky.</p>
</div>
<div class="paragraph">
<p>OpenShift SCCs authorise subjects in two ways:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>direct fields on the SCC object</p>
</li>
<li>
<p>RBAC to <code>use securitycontextconstraints</code>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This tab shows every SCC and their configuration.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/RBAC/images/rbac-overview-scc-access.png?width=900px" alt="All security context constraints"/>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>All SCCs</strong> — every SCC you can list, with priority, privileged/host settings, run-as-user and SELinux strategy, volumes, and direct subject count.</p>
</li>
<li>
<p><strong>Direct authorizations</strong> — users, groups, and service accounts listed on each SCC.</p>
</li>
<li>
<p><strong>RBAC use grants</strong> — ClusterRoleBindings that grant <code>use</code> on SCC resources.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This tab does not replace a full SCC compliance review, but it saves time when you are tracing why a pod was allowed a privileged context.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_limitations">Limitations</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>Who can</strong> requires the same elevated create permissions as <code>oc adm policy who-can</code>.</p>
</li>
<li>
<p>Large clusters: tables paginate, but initial binding scans can take a moment on first tab open.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>RBAC Overview does not replace <code>oc</code> or your GitOps RBAC manifests. It gives operators and auditors a single console entry point for the questions that come up every week — who is admin, what does this namespace grant, what is bound to this service account, who can touch this verb/resource, and which identities sit on sensitive SCCs.</p>
</div>
<div class="paragraph">
<p>The plugin was created with the help of AI (I always want to be open about that), especially the initial layout, some styling elements like dropdowns and buttons and the README …​ which I never want to write.</p>
</div>
<div class="paragraph">
<p>If you try it, feedback and issues are welcome on the <a href="https://github.com/tjungbauer/openshift-console-rbac-overview" rel="noopener" target="_blank">repository</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_references">References</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/tjungbauer/openshift-console-rbac-overview" rel="noopener" target="_blank">openshift-console-rbac-overview on GitHub</a></p>
</li>
<li>
<p><a href="https://quay.io/repository/tjungbau/openshift-console-rbac-overview?tab=tags" rel="noopener" target="_blank">openshift-console-rbac-overview on Quay</a></p>
</li>
<li>
<p><a href="https://github.com/openshift/console/tree/main/frontend/packages/console-dynamic-plugin-sdk" rel="noopener" target="_blank">OpenShift Console dynamic plugin SDK</a></p>
</li>
<li>
<p><a href="https://docs.openshift.com/container-platform/latest/web_console/dynamic-plugins-overview.html" rel="noopener" target="_blank">OpenShift dynamic plugins documentation</a></p>
</li>
<li>
<p><a href="https://hummingbird-project.io/" rel="noopener" target="_blank">Project Hummingbird</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>Creating an auditd rule to monitor Ansible Automation Platform static secrets</title><link>https://blog.stderr.at/ansible/2026/06/creating-an-auditd-rule-to-monitor-ansible-automation-platform-static-secrets/</link><guid isPermaLink="true">https://blog.stderr.at/ansible/2026/06/creating-an-auditd-rule-to-monitor-ansible-automation-platform-static-secrets/</guid><pubDate>Tue, 09 Jun 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Toni Schmidbauer</dc:creator><category>Ansible</category><category>Security</category><description>How to create a Linux auditd rule to log events if an AAP static secret is accessed.</description><content:encoded><![CDATA[<div class="paragraph">
<p>Ansible Automation Platform (AAP) comes with an elaborate credential
management solution. All credentials within AAP are stored encrypted
in a PostgreSQL database. But the keys used for encrypting database
fields are currently stored on the machine(s) running AAP. In this
blog post, we show we created an auditd rule to get at least some kind
of monitoring if those keys are accessed.</p>
</div>
<div class="sect1">
<h2 id="_ansible_automation_platform_local_secret_key">Ansible Automation Platform local SECRET_KEY</h2>
<div class="sectionbody">
<div class="paragraph">
<p>AAP comes with a
<a href="https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.7/secure-con_controller_how_credentials_work">credential
management solution</a>. Credentials are used to</p>
</div>
<div class="ulist">
<ul>
<li>
<p>access remote machines</p>
</li>
<li>
<p>provide configuration data for automation, like API keys</p>
</li>
<li>
<p>connect AAP to source code repositories and inventories</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>and much more. You can even integrate external credential management
solutions like <a href="https://www.hashicorp.com/products/vault">HashiCorp
Vault</a> or <a href="https://openbao.org/">OpenBao</a>.</p>
</div>
<div class="paragraph">
<p>All credentials stored within AAP are saved as encrypted database
fields in a PostgreSQL database. There is a main key and AAP creates
for every encrypted database field a derived AES-256
encryption key. For more details see the
<a href="https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.7/secure-con_controller_secret_handling#controller-secret-handling-operational-use">documentation</a>.</p>
</div>
<div class="paragraph">
<p>But there is one caveat: the main secret key is stored on the local
file system. There is currently no supported option to integrate
something like a HSM (High Security Module) for storing the main
secret securely.</p>
</div>
<div class="paragraph">
<p>To mitigate this issue we deployed a Linux audit rule that monitors
read/write and attribute changes to the main secret.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_configuring_linux_auditd">Configuring Linux auditd</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We use the containerized version of AAP 2.6. In the containerized
version of AAP those secrets are stored as <em>podman</em> secrets as the
user running the AAP containers.</p>
</div>
<div class="paragraph">
<p>To list AAP podman secrets execute</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">$ podman secret list
ID                         NAME                        DRIVER      CREATED      UPDATED
02a2eb397dc5cedefde6ae411  hub_resource_server         file        2 hours ago  2 hours ago
0dd84dc7b808917c4efb6ea9f  controller_channels         file        2 hours ago  2 hours ago
85fb73ff57729250c019976ed  hub_database_fields         file        2 hours ago  2 hours ago
c482ff7c07f908e443d327293  controller_postgres         file        2 hours ago  2 hours ago
e6750121a8997cce8185072bf  gateway_admin_password      file        2 hours ago  2 hours ago
2731b2d03806f88f35809de66  eda_admin_password          file        2 hours ago  2 hours ago
31ca44577b4c5b61dd3f0a0b6  eda_secret_key              file        2 hours ago  2 hours ago
856473626bad9ff37b1b979d4  eda_resource_server         file        2 hours ago  2 hours ago
b20ec0897fc2b6533544c4441  gateway_redis_url           file        2 hours ago  2 hours ago
1dfdd812847ed4c1c01b194e2  gateway_db_password         file        2 hours ago  2 hours ago
32d04575881dd781be192ef49  eda_db_password             file        2 hours ago  2 hours ago
5102f69350717c15177b80821  hub_secret_key              file        2 hours ago  2 hours ago
d1faf92922182604cfa746318  controller_resource_server  file        2 hours ago  2 hours ago
d29f0d8c2fc709655dd918f2c  postgresql_admin_password   file        2 hours ago  2 hours ago
1b3ee24261bdff50d2c70e3f0  gateway_secret_key          file        2 hours ago  2 hours ago
ae6c9e78e91dea180d22db6ee  hub_settings                file        2 hours ago  2 hours ago
b348d89bfb7d3b18f33a67d07  controller_secret_key       file        2 hours ago  2 hours ago <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 controller secret key</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>If we want to know where those secrets are stored we can execute</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">$ podman secret inspect controller_secret_key
[
    {
        &#34;ID&#34;: &#34;b348d89bfb7d3b18f33a67d07&#34;,
        &#34;CreatedAt&#34;: &#34;2026-06-09T10:57:28.278138715Z&#34;,
        &#34;UpdatedAt&#34;: &#34;2026-06-09T10:57:28.278138715Z&#34;,
        &#34;Spec&#34;: {
            &#34;Name&#34;: &#34;controller_secret_key&#34;,
            &#34;Driver&#34;: {
                &#34;Name&#34;: &#34;file&#34;,
                &#34;Options&#34;: {
                    &#34;path&#34;: &#34;/home/admin/.local/share/containers/storage/secrets/filedriver&#34;
                }
            },
            &#34;Labels&#34;: {}
        }
    }
]</code></pre>
</div>
</div>
<div class="paragraph">
<p>Let’s see what’s in the filedriver directory:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">$ ls /home/admin/.local/share/containers/storage/secrets/filedriver
secretsdata.json  secretsdata.lock<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>we are mainly interested in the <em>secretsdata.json</em> file</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>So the <em>secretsdata.json</em> file stores all podman secrets that are
using the <em>filedriver</em>. For more information see the section
<a href="https://docs.podman.io/en/latest/markdown/podman-secret-create.1.html#secret-drivers">Secret
Drivers</a> in the podman-secrets-create(1) manpage.</p>
</div>
<div class="paragraph">
<p>Let’s create a Linux auditd rule to monitor access to this file. As we
are using Red Hat Enterprise Linux 10 a more detailed introduction to
the Linux audit system is available
<a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/risk_reduction_and_recovery_operations/auditing-the-system">here</a>.</p>
</div>
<div class="paragraph">
<p>We created the file <em>/etc/audit/rules.d/aap_secrets.rules</em> with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">-w /home/admin/.local/share/containers/storage/secrets/filedriver/secretsdata.json -p rwa -k aap_secrets <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>-p rwa means monitor read/write/attribute changes, -k tells the audit system log events with an additional key &#34;aap_secrets&#34;</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>To activate the rule we need to load the audit rule via:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal"># auditctl -R /etc/audit/rules.d/aap_secrets.rules</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can list loaded audit rules via</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal"># auditctl -l
-w /home/admin/.local/share/containers/storage/secrets/filedriver/secretsdata.json -p rwa -k aap_secrets</code></pre>
</div>
</div>
<div class="paragraph">
<p>As a test we can cat the secrets file and check if auditd logged an event:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal"># cat /home/admin/.local/share/containers/storage/secrets/filedriver/secretsdata.json
...
# grep aap_secrets  /var/log/audit/audit.log
type=SYSCALL msg=audit(1781009319.993:204): arch=c000003e syscall=257 success=yes exit=3 a0=ffffff9c a1=7ffc5276b65c a2=0 a3=0 items=1 ppid=6186 pid=6695 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=3 comm=&#34;cat&#34; exe=&#34;/usr/bin/cat&#34; subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=&#34;aap_secrets&#34;ARCH=x86_64 SYSCALL=openat AUID=&#34;admin&#34; UID=&#34;root&#34; GID=&#34;root&#34; EUID=&#34;root&#34; SUID=&#34;root&#34; FSUID=&#34;root&#34; EGID=&#34;root&#34; SGID=&#34;root&#34; FSGID=&#34;root&#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>We can see that the <em>cat</em> command (comm=cat) was used by the root user to display the file contents</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_summary">Summary</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this blog post we demonstrated how to configure the Linux audit
system to log events if the AAP database secret key is accessed. The
audit subsystem can also monitor system calls, for a detailed
introduction see
<a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/risk_reduction_and_recovery_operations/auditing-the-system#audit-system-architecture">Audit system architecture</a>.</p>
</div>
</div>
</div>]]></content:encoded></item><item><title>Using a local Renovate bot to manage Ansible collection dependencies</title><link>https://blog.stderr.at/ansible/2026/05/using-a-local-renovate-bot-to-manage-ansible-collection-dependencies/</link><guid isPermaLink="true">https://blog.stderr.at/ansible/2026/05/using-a-local-renovate-bot-to-manage-ansible-collection-dependencies/</guid><pubDate>Tue, 26 May 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Toni Schmidbauer</dc:creator><category>Ansible</category><description>How to use a local renovate bot to automatically update Ansible collections dependencies.</description><content:encoded><![CDATA[<div class="paragraph">
<p>We wanted to use <a href="https://github.com/renovatebot/renovate">renovate</a> bot
to automatically update collection dependencies for one of our
Ansible playbook repositories. This blog post describes the basics of
renovate, how we configured it and how we actually run renovate
locally.</p>
</div>
<div class="sect1">
<h2 id="_understanding_renovate">Understanding renovate</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As this was our first try of using renovate for dependency updates, we
struggled to understand how renovate works and how it is configured.</p>
</div>
<div class="paragraph">
<p>Renovate is a bot that is able to scan multiple repositories for
dependencies and create pull/merge requests with updated dependencies.</p>
</div>
<div class="paragraph">
<p>Configuration is split between a configuration for the bot and a local
one for each repository.</p>
</div>
<div class="paragraph">
<p>So you basically have</p>
</div>
<div class="ulist">
<ul>
<li>
<p>One or more global configuration files that configure the bot
(<em>config.js</em>) written in JavaScript or TypeScript</p>
</li>
<li>
<p>One configuration file per repository (renovate.json) written in
JSON that contains local configuration options just for this
repository.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Renovate is very flexible on how to structure the configuration. For
more information see
<a href="https://docs.renovatebot.com/config-overview/">config-overview</a> in the
docs.</p>
</div>
<div class="paragraph">
<p>Renovate also supports multiple platforms, like GitHub, GitLab or
Forgejo. For a complete list see
<a href="https://docs.renovatebot.com/modules/platform/">renovate platforms</a>.</p>
</div>
<div class="paragraph">
<p>The idea is that you run the bot once, it scans all configured
repositories and creates pull requests in every repository with
dependency updates.</p>
</div>
<div class="paragraph">
<p>If your projects are hosted on GitHub and you would like to use GitHub
Actions for running renovate the straight forward solution is to
follow <a href="https://github.com/marketplace/renovate">Mend Renovate on GitHub
Marketplace</a>.</p>
</div>
<div class="paragraph">
<p>But we wanted more control and tried to</p>
</div>
<div class="ulist">
<ul>
<li>
<p>run renovate on a local machine. This should be migrated to a Job Template or
Kubernetes CronJob later (might be worth another post)</p>
</li>
<li>
<p>use a private Automation Hub for hosting dependencies. So renovate
should query collections on our Private Automation Hub for
dependency updates</p>
</li>
<li>
<p>credentials should be made available via environment variables to the bot</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_configuring_and_running_renovate">Configuring and running renovate</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As a first test we created a local bot configuration file <em>config.js</em>
in our home directory. The GIT repository we used for testing is
<a class="bare" href="https://github.com/tosmi-ansible/aap-setup">https://github.com/tosmi-ansible/aap-setup</a>.</p>
</div>
<div class="paragraph">
<p>The first thing to be aware of is that the renovate bot by default
<strong>always</strong> searches the repository configuration file (<em>renovate.json</em>)
in the <strong>upstream</strong> repository. Changes to local files are ignored.</p>
</div>
<div class="paragraph">
<p>One way to avoid this is using <em>--platform=local</em>. This actually uses
the local <em>renovate.json</em> file, but has the caveat that not all
renovate functionality is available.</p>
</div>
<div class="paragraph">
<p>But in our case this was good enough as we just wanted to test AAP Hub
authentication.</p>
</div>
<div class="paragraph">
<p>It is also helpful to run renovate with debugging enabled, this dumps
the configuration currently used to STDOUT.</p>
</div>
<div class="paragraph">
<p>For example we had the following <em>renovate.json</em> config for testing:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
    &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
    &#34;extends&#34;: [
        &#34;config:best-practices&#34;
    ],
    &#34;timezone&#34;: &#34;Europe/London&#34;,
    &#34;schedule&#34;: [
        &#34;at any time&#34;
    ],
    &#34;packageRules&#34;: [
        {
            &#34;matchDatasources&#34;: [&#34;galaxy-collection&#34;]
        },
        {
            &#34;matchDatasources&#34;: [&#34;github-tags&#34;],
            &#34;enabled&#34;: &#34;false&#34;
        }
    ],
    &#34;hostRules&#34;: [
        {
            &#34;matchHost&#34;: &#34;aap.apps.hub.aws.tntinfra.net&#34;,
            &#34;token&#34;: &#34;Token &lt;the token&gt;&#34;,
            &#34;authType&#34;: &#34;Token-Only&#34;
        }
    ]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>But running renovate with <em>LOG_LEVEL=debug</em> set in the environment
revealed the following settings:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">DEBUG: Repository config (repository=tosmi-ansible/aap-setup)
       &#34;fileName&#34;: &#34;renovate.json&#34;,
       &#34;config&#34;: {
         &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
         &#34;extends&#34;: [&#34;config:recommended&#34;]
       }</code></pre>
</div>
</div>
<div class="paragraph">
<p>The configuration above is the configuration available in the remote
GIT repository and not our local configuration.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Renovate does not use a local <em>renovate.json</em> repository config
by default. It always pulls the configuration from the remote
repository except when you use _—​platform=local.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Furthermore renovate heavily relies on local caching. We wanted to test
if renovate is using our hub token for connecting to the Hub, but we
could not see any log entry in the AAP Hub container.</p>
</div>
<div class="paragraph">
<p>Renovate creates its cache files in a directory called <em>baseDir</em>. You
can specify the location (and later wipe the cache) with the
<em>--base-dir</em> option.</p>
</div>
<div class="paragraph">
<p>As we are using a self signed certificate in our AAP Hub test
installation we had to specify <em>NODE_TLS_REJECT_UNAUTHORIZED=0</em> to
disable TLS verification.</p>
</div>
<div class="paragraph">
<p>To summarize our test configuration:</p>
</div>
<div class="paragraph">
<p>We used the following <em>config.js</em> global renovate configuration file:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-javascript hljs" data-lang="javascript">module.exports = {
    token: &#39;&lt;github token&gt;&#39;,
    platform: &#39;github&#39;,
    onboardingConfig: {
	extends: [&#39;config:recommended&#39;],
    },
    //repositories: [&#39;tosmi-ansible/aap-setup&#39;], <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>Repository listing is not allowed when using <em>--platform=local</em></td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>In the repository where we want to test automatic dependency updates
we used the following <em>renovate.json</em> configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
    &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
    &#34;extends&#34;: [
	&#34;config:best-practices&#34;
    ],
    &#34;timezone&#34;: &#34;Europe/London&#34;,
    &#34;schedule&#34;: [
        &#34;at any time&#34;
    ],
    &#34;packageRules&#34;: [
	{
	    &#34;matchDatasources&#34;: [&#34;galaxy-collection&#34;]
	},
	{
	    &#34;matchDatasources&#34;: [&#34;github-tags&#34;],
	    &#34;enabled&#34;: &#34;false&#34; <i class="conum" data-value="1"></i><b>(1)</b>
	}
    ],
    &#34;hostRules&#34;: [
	{
	    &#34;matchHost&#34;: &#34;aap.apps.hub.aws.tntinfra.net&#34;,
	    &#34;token&#34;: &#34;Token &lt;the token&gt;&#34;,
	    &#34;authType&#34;: &#34;Token-Only&#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>We disabled GitHub tag lookup explicitly as renovate would find some of our dependencies on GitHub</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>This is our <em>collections/requirements.yaml</em> file with a test dependency:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">roles:

collections:
  - name: kubernetes.core
    version: 6.3.0
    source: https://aap.apps.hub.aws.tntinfra.net/api/galaxy/content/rh-certified/</code></pre>
</div>
</div>
<div class="paragraph">
<p>On our AAP Private Automation Hub we had <em>kubernetes.core</em> version
6.4.0 available.</p>
</div>
<div class="paragraph">
<p>So to run and test renovate locally we used the following command line:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">NODE_TLS_REJECT_UNAUTHORIZED=0 LOG_LEVEL=debug RENOVATE_CONFIG_FILE=~/config.js renovate --platform=github --repository-cache=disabled --base-dir=/tmp/cache</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_secret_management_and_configuration_cleanup">Secret management and configuration cleanup</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The next step is to remove the hard-coded tokens from our
configuration. We wanted to use environment variables, as this allows
us to run renovate as:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A Kubernetes <em>CronJob</em> with a <em>Pod</em>. We could inject the token via a <em>Secret</em></p>
</li>
<li>
<p>As a job template within AAP with tokens stored as AAP credentials or</p>
</li>
<li>
<p>A normal Unix cron job with environment variables set</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>As the global renovate configuration <em>config.js</em> is written in
JavaScript we could leverage <em>process.env</em> to retrieve required tokens
from environment variables.</p>
</div>
<div class="paragraph">
<p>Here is our modified <em>config.js</em>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-javascript hljs" data-lang="javascript">module.exports = {
    platform: &#39;github&#39;,
    onboardingConfig: {
	extends: [&#39;config:recommended&#39;],
    },
    // repositories: [&#39;tosmi-ansible/aap-setup&#39;], <i class="conum" data-value="1"></i><b>(1)</b>
    secrets: {
	AAP_HUB_TOKEN: process.env.AAP_HUB_TOKEN, <i class="conum" data-value="2"></i><b>(2)</b>
    },

    hostRules: [
        {
            matchHost: &#34;aap.apps.hub.aws.tntinfra.net&#34;,
            token: &#34;{{ secrets.AAP_HUB_TOKEN }}&#34;, <i class="conum" data-value="3"></i><b>(3)</b>
            authType: &#34;Token&#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>We disable repository listing for <em>--platform=local</em>. Otherwise renovate will raise an error.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>We define a new secret AAP_HUB_TOKEN and read the value from the environment variable AAP_HUB_TOKEN</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>We use the secret as our token for authenticating to AAP Hub</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The <em>authType</em> setting is a little bit special, see the following section</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>For GitHub authentication renovate expects a GitHub token in the
environment variable
<a href="https://docs.renovatebot.com/self-hosted-configuration/#token">RENOVATE_TOKEN</a>.</p>
</div>
<div class="paragraph">
<p>A few words about the <em>authType</em> setting. AAP Hub requires the
following authorization header in the HTTP request for authentication:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">Authorization: Token &lt;the token&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>With renovate we have two options to achieve this:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Either set <em>authType</em> to &#34;Token-Only&#34; and specify the token as
&#34;Token &lt;the token&gt;&#34;. So with token-only renovate takes the token
string verbatim</p>
</li>
<li>
<p>Or set the <em>authType</em> to the string we would like to prepend to the
token as we did</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>We had to dig into the
<a href="https://github.com/renovatebot/renovate/blob/6c6a6b793d6f339a18222e6aec851df77ceaa8f4/lib/util/http/auth.ts#L33">source code</a>
of renovate to understand how it functions.</p>
</div>
<div class="paragraph">
<p>And here is the <em>renovate.json</em> repository configuration that we used:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
    &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
    &#34;extends&#34;: [
	&#34;config:best-practices&#34;
    ],
    &#34;timezone&#34;: &#34;Europe/London&#34;,
    &#34;schedule&#34;: [
        &#34;at any time&#34;
    ],
    &#34;packageRules&#34;: [
	{
	    &#34;matchDatasources&#34;: [&#34;galaxy-collection&#34;]
	},
	{
	    &#34;matchDatasources&#34;: [&#34;github-tags&#34;],
	    &#34;enabled&#34;: &#34;false&#34;
	}
    ]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>You could also move the <em>hostRules</em> to the repository local
<em>renovate.json</em> file and still use <em>secrets.AAP_HUB_TOKEN</em>, but as
this is going to be our global configuration for Ansible code base
covering multiple repositories our current idea is to store the
authentication in the global configuration.</p>
</div>
<div class="paragraph">
<p>To set the required environment variables containing our secrets we
execute</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ export AAP_HUB_TOKEN=$(pass show other/ansible/aws-aap-tokens | awk &#39;/hub/ {print $2}&#39;) <i class="conum" data-value="1"></i><b>(1)</b>
$ export RENOVATE_TOKEN=$(pass show other/github/tosmi-rw-token | awk &#39;/token/ {print $2}&#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>We use the <a href="https://www.passwordstore.org/">pass utility</a> for secret management.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_integration_with_github">Integration with GitHub</h2>
<div class="sectionbody">
<div class="paragraph">
<p>So the last step is to store everything (the global and local
configuration) on GitHub.</p>
</div>
<div class="paragraph">
<p>For the global repository we created the
<a href="https://github.com/tosmi-ansible/renovate-config">tosmi-ansible/renovate-config</a>
repository.</p>
</div>
<div class="paragraph">
<p>Here is our final <em>config.js</em> global configuration file in this repository:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-javascript hljs" data-lang="javascript">module.exports = {
    platform: &#39;github&#39;,
    gitAuthor: &#34;Renovate Bot &lt;renovate-bot@stderr.at&gt;&#34;,
    dryRun: null,
    onboardingConfig: {
	extends: [&#39;config:recommended&#39;],
    },

    repositories: [&#39;tosmi-ansible/aap-setup&#39;], <i class="conum" data-value="1"></i><b>(1)</b>

    secrets: {
	AAP_HUB_TOKEN: process.env.AAP_HUB_TOKEN,
    },

    hostRules: [
        {
            matchHost: &#34;aap.apps.hub.aws.tntinfra.net&#34;,
            token: &#34;{{ secrets.AAP_HUB_TOKEN }}&#34;,
            authType: &#34;Token&#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 time we tell renovate which repositories it should scan.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The default configuration <em>default.json</em>, also stored in the global
repository:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
    &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
    &#34;extends&#34;: [
	&#34;config:best-practices&#34;
    ],
    &#34;timezone&#34;: &#34;Europe/London&#34;,
    &#34;schedule&#34;: [
        &#34;at any time&#34;
    ],
    &#34;enabledManagers&#34;: [&#34;ansible&#34;, &#34;ansible-galaxy&#34;], <i class="conum" data-value="1"></i><b>(1)</b>
    &#34;packageRules&#34;: [
	{
	    &#34;matchDatasources&#34;: [&#34;galaxy-collection&#34;]
	},
	{
	    &#34;matchDatasources&#34;: [&#34;github-tags&#34;],
	    &#34;enabled&#34;: &#34;false&#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>We only enable ansible and ansible-galaxy managers. Otherwise renovate would search for various other sources for dependencies.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p><a href="https://github.com/tosmi-ansible/aap-setup">tosmi-ansible/aap-setup</a> contains our local configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
    &#34;$schema&#34;: &#34;https://docs.renovatebot.com/renovate-schema.json&#34;,
    &#34;extends&#34;: [
	&#34;tosmi-ansible/renovate-config&#34;,
	&#34;config:best-practices&#34;
    ]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This only contains a reference to our global configuration and we
would like to use the
<a href="https://docs.renovatebot.com/presets-config/#configbest-practices">best-practices</a>
preset.</p>
</div>
<div class="paragraph">
<p>We can now run renovate from the <em>renovate-config</em> repository and it
will scan the configured repository and create a pull request with updated
dependencies if required.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ git clone git@github.com:tosmi-ansible/renovate-config.git
$ cd renovate-config
$ NODE_TLS_REJECT_UNAUTHORIZED=0 renovate --platform=github --base-dir=/tmp/renovate-cache <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>We still need to set <em>NODE_TLS_REJECT_UNAUTHORIZED</em> to 0, because our AAP Hub instance uses a private certificate</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>One minor issue that we discovered is that if a pull request for an
update already existed (even a closed one) Renovate would not open a
new one. If you run renovate with <em>LOG_LEVEL=debug</em> you will see the
following message:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">DEBUG: Closed PR #19 already exists. Skipping branch. (repository=tosmi-ansible/aap-setup, branch=renovate/kubernetes.core-6.x)
       &#34;prTitle&#34;: &#34;Update dependency kubernetes.core to v6.4.0&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>To convince Renovate to create a new pull request just rename the
closed pull request on GitHub. We just added the prefix
&#34;RENAMED&#34;. After renaming the pull request, renovate will happily
create a new one.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_tips_and_tricks">Tips and tricks</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This section list various things we learning while running renovate locally</p>
</div>
<div class="sect2">
<h3 id="_renovate_does_not_honor_new_dependencies_in_requirements_yaml">Renovate does not honor new dependencies in <em>requirements.yaml</em></h3>
<div class="paragraph">
<p>We had an issues with new dependencies in <em>requirements.yaml</em>. Wiping
the renovate cache (<em>/tmp/renovate_cache</em>) in our case fixed this and
renovate created new pull requests for the added dependencies.</p>
</div>
</div>
<div class="sect2">
<h3 id="_renovate_does_not_open_new_pr_pull_requests_for_updated_dependencies">Renovate does not open new PR (pull requests) for updated dependencies</h3>
<div class="paragraph">
<p>We double checked AAP and our renovate configuration and there was
clearly a newer version of a collection but renovate just did not open
a new PR.</p>
</div>
<div class="paragraph">
<p>Running renovate with <em>LOG_LEVEL=debug</em> revealed the following message
(we tried to update the redhat.openshift_virtualization collection):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">         {
           &#34;branchName&#34;: &#34;renovate/redhat.openshift_virtualization-2.x&#34;,
           &#34;prNo&#34;: null,
           &#34;prTitle&#34;: &#34;Update dependency redhat.openshift_virtualization to v2.2.4&#34;,
           &#34;result&#34;: &#34;branch-limit-reached&#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>renovate does not open a new branch because of &#34;branch-limit-reached&#34;</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>We check our upstream repository on GitHub and there was just the main
branch, hm…​</p>
</div>
<div class="paragraph">
<p>Looking further up in the log we found:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">DEBUG: prHourlyLimit of the upgrades present in this branch (repository=tosmi-ansible/aap-setup, branch=renovate/infra.aap_utilities-3.x)
       &#34;limits&#34;: [{&#34;depName&#34;: &#34;infra.aap_utilities&#34;, &#34;prHourlyLimit&#34;: 2}]
DEBUG: Calculated lowest prHourlyLimit among the upgrades present in this branch is 2. (repository=tosmi-ansible/aap-setup, branch=renovate/infra.aap_utilities-3.x)
DEBUG: Hourly PRs limit reached (repository=tosmi-ansible/aap-setup, branch=renovate/infra.aap_utilities-3.x) <i class="conum" data-value="1"></i><b>(1)</b>
       &#34;hourlyPrCount&#34;: 2,
       &#34;hourlyPrLimit&#34;: 2
DEBUG: Reached branch limit - skipping branch creation (repository=tosmi-ansible/aap-setup, branch=renovate/infra.aap_utilities-3.x)</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>There is a hourly branch limit of two in place</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>As we just ran renovate to update another dependency, we seem to be
hitting this hourly limit. The
<a href="https://docs.renovatebot.com/configuration-options/#prhourlylimit">docs</a>
mention a default of 2.</p>
</div>
<div class="paragraph">
<p>The solution was to run renovate with the option <em>--pr-hourly-limit=0</em>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-terminal hljs" data-lang="terminal">NODE_TLS_REJECT_UNAUTHORIZED=0 renovate --platform=github --base-dir=/tmp/renovate-cache --pr-hourly-limit=0</code></pre>
</div>
</div>
</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>Creating a customized RHEL 10 VM image with image-builder</title><link>https://blog.stderr.at/other/2026-04-10-customize-rhel-image-builder/</link><guid isPermaLink="true">https://blog.stderr.at/other/2026-04-10-customize-rhel-image-builder/</guid><pubDate>Fri, 10 Apr 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Toni Schmidbauer</dc:creator><category>Other</category><category>Virtualization</category><description>Creating a customized RHEL 10 VM image with image-builder</description><content:encoded><![CDATA[<div class="paragraph">
<p>In the blog post
<a href="https://blog.stderr.at/other/2026-04-09-macos-rhel10-bootc/">Creating a
RHEL 10 VM on macOS with bootc-image-builder</a> we described how to
quickly create a bootc (<a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/using_image_mode_for_rhel_to_build_deploy_and_manage_operating_systems/introducing-image-mode-for-rhel">image mode</a>) base image on macOS. Now we would like to
create a customized standard RHEL image.</p>
</div>
<div class="paragraph">
<p>For this exercise we re-use an already provisioned RHEL 10.1 machine, the reasons for this are</p>
</div>
<div class="ulist">
<ul>
<li>
<p>We are going to use the <em>image-builder</em> command instead of <em>bootc
image builder</em>. If there is a container image providing this
command, please let us know</p>
</li>
<li>
<p>We are going to install packages which requires a subscribed RHEL
machine. A RHEL subscription for up to 16 machines is free of charge. You
just need to register at the <a href="https://developers.redhat.com/" rel="noopener" target="_blank">Red Hat developer</a> site.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>First we need to install required tools onto our RHEL 10.1 host:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ sudo dnf install -y image-builder</code></pre>
</div>
</div>
<div class="paragraph">
<p>Next we create a blueprint file to customize the resulting qcow2
image. We use the resulting image for a &#34;services&#34; machine, running
Unifi OS, Kea for DHCP and ISC bind (dns server):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-toml hljs" data-lang="toml">name = &#34;services-rhel10&#34;
description = &#34;A VM running services&#34;
version = &#34;0.1&#34;

[[packages]]
name = &#34;podman&#34;
version = &#34;*&#34; <i class="conum" data-value="1"></i><b>(1)</b>

[customizations]
hostname = &#34;services&#34;

[[customizations.filesystem]]
mountpoint = &#34;/&#34;
minsize = &#34;50 GiB&#34; <i class="conum" data-value="2"></i><b>(2)</b>

[customizations.kernel]
append = &#34;ip=10.0.0.144::10.0.0.1:255.255.255.0:services:ens3:none:10.0.0.255&#34; <i class="conum" data-value="3"></i><b>(3)</b>

[[customizations.group]]
name = &#34;pinhead&#34;
gid = 1000

[[customizations.user]]
name = &#34;pinhead&#34;
password = &#34;&lt;password hash&gt;&#34; <i class="conum" data-value="4"></i><b>(4)</b>
key = &#34;&lt;ssh public key&gt;&#34; <i class="conum" data-value="5"></i><b>(5)</b>
home = &#34;/home/pinhead/&#34;
shell = &#34;/usr/bin/bash&#34;
groups = [&#34;users&#34;, &#34;wheel&#34;]
uid = 1000
gid = 1000

[[customizations.sshkey]]
user = &#34;root&#34;
key = &#34;&lt;public key&gt;&#34; <i class="conum" data-value="6"></i><b>(6)</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 latest version of this package</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>resize the resulting image to 50GB</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>we configure a static ip address for this machine, our default interface is <em>ens3</em></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Enter the generated password hash here (see below)</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>SSH public key to access this account</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>SSH public key to access the root account</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>To create a password hash use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">python3 -c &#39;import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass(&#34;Confirm: &#34;)) else exit())&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>For a detailed list of all customizations supported by <em>image-builder</em>
see the
<a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/composing_a_customized_rhel_system_image/supported-image-customizations" rel="noopener" target="_blank">image builder customizations</a>
documentation.</p>
</div>
<div class="paragraph">
<p>As mentioned in the
<a href="https://blog.stderr.at/other/2026-04-09-macos-rhel10-bootc/" rel="noopener" target="_blank">previous article</a>
image builder provides the option to configure the resulting
image via kickstart. A builder for kickstart files is available here:</p>
</div>
<div class="paragraph">
<p><a class="bare" href="https://access.redhat.com/labs/kickstartconfig/">https://access.redhat.com/labs/kickstartconfig/</a></p>
</div>
<div class="paragraph">
<p>For a complete list of options see the <a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/automatically_installing_rhel/kickstart-commands-and-options-reference" rel="noopener" target="_blank">kickstart documentation</a>.</p>
</div>
<div class="paragraph">
<p>One important note from the documentation (quoted):</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 following combined customizations are not supported: [customizations.user] and [customizations.installer.kickstart]. When you add a Kickstart, use a configuration file in the TOML format, because multi-line strings are prone to error.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Now we are ready to run <em>image-builder</em>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">image-builder build qcow2 --distro rhel-10.1 --arch x86_64 --blueprint services-blueprint.toml</code></pre>
</div>
</div>
<div class="paragraph">
<p>The command above failed for us with the following error message:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-console hljs" data-lang="console">Failed to open file &#34;/sys/fs/selinux/checkreqprot&#34;: Read-only file system
imported gpg key
Signature check failed on sha256:9d0a71d87912a815f837f8427438936d6e9842834cc1f1062b90b2a41fbde594, lookup package name in manifest.
Traceback (most recent call last):
  File &#34;/run/osbuild/bin/org.osbuild.rpm&#34;, line 260, in &lt;module&gt;
r = main(args[&#34;tree&#34;], args[&#34;inputs&#34;], args[&#34;options&#34;])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File &#34;/run/osbuild/bin/org.osbuild.rpm&#34;, line 162, in main
subprocess.run([
  File &#34;/usr/lib64/python3.12/subprocess.py&#34;, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command &#39;[&#39;rpmkeys&#39;, &#39;--root&#39;, &#39;/run/osbuild/tree&#39;, &#39;--checksig&#39;, &#39;sha256:9d0a71d87912a815f837f8427438936d6e9842834cc1f1062b90b2a41fbde594&#39;]&#39; returned non-zero exit status 1.
Finished module org.osbuild.rpm
Finished pipeline build
manifest - failed
Output:
Failed</code></pre>
</div>
</div>
<div class="paragraph">
<p>According to <a href="https://access.redhat.com/solutions/7136467">this
knowledge base article</a> this is a bug in the current (2026-04-10)
version of image builder.</p>
</div>
<div class="paragraph">
<p>You can download an updated JSON file containing the missing RPM GPG
keys from the article. Drop the <em>RHEL-10.1</em> JSON file in a directory
and run <em>image-builder</em> again:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">image-builder --data-dir override/ build qcow2 --distro rhel-10.1 --arch x86_64 --blueprint services-blueprint.toml <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>Use the <em>--data-dir</em> option and specify the folder with the <em>RHEL-10.1.json</em> file.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>You can find the resulting qcow image in the output directory under
<em>rhel-10.1-qcow2-x86_64/rhel-10.1-qcow2-x86_64.qcow2</em>.</p>
</div>
<div class="paragraph">
<p>A <em>Makefile</em> to streamline image creation can be found
<a href="https://codeberg.org/tosmi/playground/src/branch/master/rhel/image-builder/Makefile" rel="noopener" target="_blank">here</a>.</p>
</div>]]></content:encoded></item><item><title>Creating a RHEL 10 VM on macOS with bootc-image-builder</title><link>https://blog.stderr.at/other/2026-04-09-macos-rhel10-bootc/</link><guid isPermaLink="true">https://blog.stderr.at/other/2026-04-09-macos-rhel10-bootc/</guid><pubDate>Thu, 09 Apr 2026 00:00:00 +0200</pubDate><dc:creator>Articles by Toni Schmidbauer</dc:creator><category>Other</category><category>Virtualization</category><description>Creating a RHEL 10 VM on macOS with bootc-image-builder</description><content:encoded><![CDATA[<div class="paragraph">
<p>Yes, we have Apple machines in our lab because why not. So we needed a
RHEL 10 VM to set up Ansible Automation Platform, which seems to
support AARCH64 and Red Hat Enterprise Linux 10.</p>
</div>
<div class="paragraph">
<p>We need <a href="https://mac.getutm.app/" rel="noopener" target="_blank">UTM</a> installed on our Mac machine,
either
<a href="https://github.com/utmapp/UTM/releases/latest/download/UTM.dmg" rel="noopener" target="_blank">manually</a>,
via <a href="https://formulae.brew.sh/cask/utm" rel="noopener" target="_blank">Homebrew</a> or using a Nix
<a href="https://github.com/tosmi/nixos-config/blob/7faff0ed92d4bbefbef42641497cd2aa49c54b83/macos/fuji/flake.nix#L146" rel="noopener" target="_blank">flake</a>
(in order of increasing coolness).</p>
</div>
<div class="paragraph">
<p>Podman is also required, same rules as above apply:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://podman-desktop.io/" rel="noopener" target="_blank">manual installation</a></p>
</li>
<li>
<p><a href="https://formulae.brew.sh/cask/podman-desktop" rel="noopener" target="_blank">Homebrew</a></p>
</li>
<li>
<p><a href="https://github.com/tosmi/nixos-config/blob/3a6bc775d3164d080390590522956ad5399a34c6/macos/fuji/flake.nix#L147" rel="noopener" target="_blank">flake.nix</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>We followed the
<a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/using_image_mode_for_rhel_to_build_deploy_and_manage_operating_systems/creating-bootc-compatible-base-disk-images-by-using-bootc-image-builder" rel="noopener" target="_blank">RHEL documentation</a> for creating a bootable qcow image from a bootc
container image.</p>
</div>
<div class="paragraph">
<p>According to the <a href="https://github.com/osbuild/bootc-image-builder?tab=readme-ov-file#-installation" rel="noopener" target="_blank">upstream image builder docs</a>, we need to make sure
that our podman machine runs rootful. Otherwise image builder will not work. So let’s do this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ podman machine stop
$ podman machine set --rootful
$ podman machine start
$ podman machine info</code></pre>
</div>
</div>
<div class="paragraph">
<p>Next we need to pull the <em>bootc-image-builder</em> image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">$ podman login registry.redhat.io <i class="conum" data-value="1"></i><b>(1)</b>
$ podman pull registry.redhat.io/rhel10/bootc-image-builder</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 requires a valid Red Hat account. Registration is free of charge.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Then we can pull the RHEL 10 bootc container, as <em>bootc-image-builder</em> is not able to pull container images:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman pull registry.redhat.io/rhel10/rhel-bootc:latest</code></pre>
</div>
</div>
<div class="paragraph">
<p>Image builder provides the option to configure the resulting image via
kickstart. A builder for kickstart files is available here:</p>
</div>
<div class="paragraph">
<p><a class="bare" href="https://access.redhat.com/labs/kickstartconfig/">https://access.redhat.com/labs/kickstartconfig/</a></p>
</div>
<div class="paragraph">
<p>For a complete list of options see the <a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/automatically_installing_rhel/kickstart-commands-and-options-reference" rel="noopener" target="_blank">kickstart documentation</a>.</p>
</div>
<div class="paragraph">
<p>One important note from the documentation (quoted):</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 following combined customizations are not supported: [customizations.user] and [customizations.installer.kickstart]. When you add a Kickstart, use a configuration file in the TOML format, because multi-line strings are prone to error.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>For running the image builder we created a <a href="https://codeberg.org/tosmi/playground/src/branch/master/rhel/bootc/config.toml" rel="noopener" target="_blank"><em>toml</em> config file</a> to configure the final qcow image:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-toml hljs" data-lang="toml">[[customizations.user]]
name = &#34;pinhead&#34;
password = &#34;thepassword&#34;
key = &#34;ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIYhjnWzsArZVyyTa1E6sDbH06rUGDAhAF3bf3pmeBtm toni@stderr.at&#34;
groups = [&#34;wheel&#34;]

[[customizations.filesystem]]
mountpoint = &#34;/&#34;
minsize = &#34;50 GiB&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Now we are ready to trigger <em>bootc-image-builder</em>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">podman run \
    --rm \
    --privileged \
    --pull=newer \
    --security-opt label=type:unconfined_t \
    -v /var/lib/containers/storage:/var/lib/containers/storage \ <i class="conum" data-value="1"></i><b>(1)</b>
    -v ./config.toml:/config.toml:ro \
    -v ./output:/output \
    registry.redhat.io/rhel10/bootc-image-builder:latest \
    --type qcow2 \
    --config /config.toml \
  registry.redhat.io/rhel10/rhel-bootc:latest</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>We had to map this directory into the container, maybe this is required because we run podman in a VM on macOS (podman machine).</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>You can find the resulting qcow image in the output directory under
<em>output/qcow2/disk.qcow2</em>. This image can be used to create a RHEL 10
VM in UTM on macOS.</p>
</div>
<div class="paragraph">
<p>It is also possible to customize the container image which is used as
an input for <em>bootc-image-builder</em>. But this requires a valid RHEL
subscription inside the container. The easiest way to achieve this is
by running bootc-image-builder on an already registered RHEL machine.</p>
</div>
<div class="paragraph">
<p>A <em>Makefile</em> to streamline image creation can be found <a href="https://codeberg.org/tosmi/playground/src/branch/master/rhel/bootc/Makefile" rel="noopener" target="_blank">here</a>.</p>
</div>]]></content:encoded></item><item><title>The Guide to OpenBao - Secrets Engines PKI - Part 9</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-26-openbao-part-9-secrets-engines-pki/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-26-openbao-part-9-secrets-engines-pki/</guid><pubDate>Thu, 26 Mar 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><description>Deep dive into OpenBao secrets engines: PKI for certificates</description><content:encoded><![CDATA[<div class="paragraph">
<p>Secrets engines are one of the most important concepts in OpenBao. <a href="/openshift-platform/security/secrets-management/openbao/2026-03-25-openbao-part-8-secrets-engines-kv/">Part 8</a> covered the KV secrets engine; this article covers the <strong>PKI</strong> secrets engine and its integration with <strong>cert-manager</strong> on Kubernetes and OpenShift.</p>
</div>
<div class="sect1">
<h2 id="_quick_navigation">Quick Navigation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Navigate directly to the main sections of this article:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="#sect-pki">PKI secrets engine</a></p>
</li>
<li>
<p><a href="#sect-cert-manager">Integration with cert-manager</a></p>
</li>
</ul>
</div>
<hr/>
</div>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="/openshift-platform/security/secrets-management/openbao/2026-03-25-openbao-part-8-secrets-engines-kv/">Part 8</a> of this series explained the basics of secrets engines and the KV secrets engine. This article focuses on the PKI secrets engine and on integrating OpenBao with <strong>cert-manager</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">
As a reminder: to <strong>log in</strong> to the OpenBao CLI, use the following (assuming HTTPS and a CA certificate available locally):
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">export BAO_ADDR=&#39;https://127.0.0.1:8200&#39;
export BAO_CACERT=&#34;$PWD/openbao-ca.crt&#34;
bao login</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sect-pki">PKI Secrets Engine</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The PKI engine dynamically generates X.509 certificates, acting as a <strong>Certificate Authority (CA)</strong>. You can obtain a certificate without manually generating a private key and CSR on the client: OpenBao provisions the key material and signed certificate according to the role.</p>
</div>
<div class="paragraph">
<p>The time to live (TTL) of each generated certificate can be kept short to reduce reliance on revocation. It is possible to store the certificates in memory during the startup of an application and discard them when the application shuts down. This way, a certificate is only valid during the application runtime, is kept in memory and is never written to disk.</p>
</div>
<div class="sect2">
<h3 id="_setting_up_pki_secrets_engine_root_ca">Setting Up PKI Secrets Engine (Root CA)</h3>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Before we can use the PKI secrets engine, we need to enable and configure it. To enable it, we can simply use the following command:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao secrets enable -path=pki pki</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will enable the PKI secrets engine at the path <strong>pki/</strong>. If the path parameter is not provided, the engine will use the name of the engine as path.</p>
</div>
<div class="paragraph">
<p>The default value of the TTL is 30 days. To increase the maximum lease time for certificates issued under this mount, use <strong><code>-max-lease-ttl=87600h</code></strong> (or another duration).</p>
</div>
</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">
<em>Note that individual roles can restrict this value to be shorter on a per-certificate basis. This just configures the global maximum for this secrets engine.</em> Source: <a href="https://openbao.org/docs/secrets/pki/setup/" rel="noopener" target="_blank">PKI secrets engine - setup and usage</a>
</td>
</tr>
</tbody></table>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Next we need to provide a CA certificate and a private key. OpenBao can either generate its own self-signed root certificate, or can use an existing one. Using an existing one is recommended for production environments. This is managed outside of OpenBao and OpenBao is provided with a signed intermediate CA.</p>
<div class="paragraph">
<p>We can simply generate a self-signed root certificate by using the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write pki/root/generate/internal \
  common_name=&#34;Example Root CA&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  issuer_name=&#34;root-ca&#34; \ <i class="conum" data-value="2"></i><b>(2)</b>
  ttl=8760h \ <i class="conum" data-value="3"></i><b>(3)</b>
  key_bits=4096 \ <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>Common name of the root certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Issuer name of the root certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Time to live of the root certificate, here 8760 hours (365 days)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Key bits of the root certificate, here 4096 bits (default is 2048 bits)
<div class="paragraph">
<p>The response will look something like:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Key              Value
---              -----
certificate      -----BEGIN CERTIFICATE-----...
expiration       1536807433
issuing_ca       -----BEGIN CERTIFICATE-----...
serial_number    7c:f1:fb:2c:6e:4d:99:0e:82:1b:08:0a:81:ed:61:3e:1d:fa:f5:29</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 certificate key is stored in OpenBao. The returned certificates are purely informational.
</td>
</tr>
</tbody></table>
</div></td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Set URL configuration</p>
<div class="paragraph">
<p>The location of the Certificate Revocation List (CRL) and the issuing certificate are stored in the configuration of the PKI secrets engine and must be updated manually.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Configure CA and CRL URLs
bao write pki/config/urls \
  issuing_certificates=&#34;https://openbao.example.com/v1/pki/ca&#34; \
  crl_distribution_points=&#34;https://openbao.example.com/v1/pki/crl&#34;</code></pre>
</div>
</div>
</li>
<li>
<p>Configure a Role</p>
<div class="paragraph">
<p>Now we need to define a role for the certificates. Roles define the allowed domains and the maximum time to live for the certificates. The following example creates a role for server certificates. It allows us to issue certificates for the domains <code>example.com</code> and <code>internal.example.com</code> with a maximum time to live of 720 hours (30 days) and a key size of 2048 bits.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write pki/roles/server-cert \
  allowed_domains=&#34;example.com,internal.example.com&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  allow_subdomains=true \ <i class="conum" data-value="2"></i><b>(2)</b>
  max_ttl=720h \
  key_bits=2048 \ <i class="conum" data-value="3"></i><b>(3)</b>
  key_type=rsa \ <i class="conum" data-value="4"></i><b>(4)</b>
  require_cn=false \
  allow_any_name=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>Allowed domains</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Allow subdomains</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Key size</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Key type, typically rsa or ec (elliptic curve)</td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Issuing Certificates</p>
<div class="paragraph">
<p>OpenBao is now ready to issue certificates. We will use the <code>issue</code> endpoint to request a new certificate.
The following example requests a new certificate for the domain <code>myapp.example.com</code> and the subdomain <code>myapp.internal.example.com</code> with a maximum time to live of 168 hours (7 days) and a key size of 2048 bits.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write pki/issue/server-cert \
  common_name=&#34;myapp.example.com&#34; \
  alt_names=&#34;myapp.internal.example.com&#34; \
  ttl=168h \</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will return the full certificate chain including the root CA certificate and the key.
For better readability, the output was shortened to show the certificate only:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Key                 Value
---                 -----
certificate         -----BEGIN CERTIFICATE-----
MIIE7zCCAtegAwIBAgIUH0eTVpXCP7iu0Y75dWAvjktbyxcwDQYJKoZIhvcNAQEL
BQAwGjEYMBYGA1UEAxMPRXhhbXBsZSBSb290IENBMB4XDTI2MDMyMjA1MjEyNVoX
DTI2MDMyOTA1MjE1NFowHDEaMBgGA1UEAxMRbXlhcHAuZXhhbXBsZS5jb20wggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDliY0K3qb8TwNBXOHdfBygs5+Y
Pwh83vtS0Nph6ZsPdI9JTuvI6AbzEz6M283aY7OeJ3m3G2fRwt7ZdgsAcyt+jnL8
Izx/MS/4ztsdZJ/wxs3M42/iFehSofqihgorY1+SGaTdveCFg9H7Egjn1eJFnGB/
iqANzxg5NohE4gf8zpAKDjl4CIPDSmNJX2xQ+3wXJgx1eKeVOeB0jFnMSYskS0hD
qwM+QyYRKodc/akI6Xu7OqWQLMW7qmNS+6TBHsGOopve9EP6ym65Jss6de4X9zIP
BYeWQ0gvG18i22eJrkISRWlO2uw+Fbho0tBhqfRfjsVpxrUrTKwIgxg+F0+5AgMB
AAGjggEpMIIBJTAOBgNVHQ8BAf8EBAMCA6gwHQYDVR0lBBYwFAYIKwYBBQUHAwEG
CCsGAQUFBwMCMB0GA1UdDgQWBBRbFm9oqRl//tc+Z0ert4DKp9KjkDAfBgNVHSME
GDAWgBSL03nIIcEY+IAz/1g2q5NBbufx9DBBBggrBgEFBQcBAQQ1MDMwMQYIKwYB
BQUHMAKGJWh0dHBzOi8vb3BlbmJhby5leGFtcGxlLmNvbS92MS9wa2kvY2EwOAYD
VR0RBDEwL4IRbXlhcHAuZXhhbXBsZS5jb22CGm15YXBwLmludGVybmFsLmV4YW1w
bGUuY29tMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHBzOi8vb3BlbmJhby5leGFtcGxl
LmNvbS92MS9wa2kvY3JsMA0GCSqGSIb3DQEBCwUAA4ICAQBUoLwWgpTaodRKpL3c
zp/yPgHNagZA8SQRLqKttywbHzfPNUSsC56XqfZnOHaq/gobNKrmirUAHPnXRUjO
Jd2+wXBO9aKqAhiy5is2ueNRo+C8IdPQpFNQ+5MW+G4FXJqSkvDUlT47mAoRkKUJ
nsjoV/xzHYKgw/YF7QZtmL8moM9W9Bhg3dB6KEaUvscpNn/9USfPquVLXOuQ/8Bs
6zQGijJUhb5gpRgGjmJhs0Oo/MkABxBUq2jFmvGWP0NklcJO7smtetx/RSrtyFZ0
X7zgMlD1yUy4DaHX13LhszAfercTFNodV/mAfEaJUrW+U9I97MzVg8QJvn9/AsaM
mWjfKHczhd9AzupOlogX8L3cdZxx9hkdD4NcR8tRb4QR5sOqzoBN7NfNpQ699b0F
kxESrHIysqBcx4dYjXLFsUqzRGm2sGZ4j1N8w1OZY/s0kfsG7RXpXJjwtQ2RwPo1
iSjbJ/VLjji2pz5BtVRtHiXnkoVtSD8QBpjCYqyHekXUArJCVkaDPzkB2MWNZXpk
2koi2fYa0U4x4ITqDsKeMpLvGAl2vqkp20lphXXqRwaAdNuEFd69YZ6qXzw/6GdI
TC/Ki7zApSvO0kJvMs9NILcHgDjpndCA/sMpG9iv4wFMpgYet9wc+dzPMXnHcj4o
PGbyb/WJomcxQMDuV1x1S1X2iA==
-----END CERTIFICATE-----
expiration          1774761714
issuing_ca          -----BEGIN CERTIFICATE-----
MIIFJTCCAw2gAwIBAgIUJde0eccC1TpbufxVsUBhZhq9hWwwDQYJKoZIhvcNAQEL
BQAwGjEYMBYGA1UEAxMPRXhhbXBsZSBSb290IENBMB4XDTI2MDMyMjA0NDI1OVoX
DTI2MDQyMzA0NDMyOVowGjEYMBYGA1UEAxMPRXhhbXBsZSBSb290IENBMIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1XGanJKZZYySc9+WCXuGp9MLMo/O
MCRAR0u+BQbmxaSBcFLsxfNdkB8Jcunx7RnaGZIJwYXNIy+tNejqwQfiah7pTwJq
SYnXcYqZAETJUFvdYygjs4MCeaebvogmBQcZRzxJNNPzUblYpVOhmSGLvZZ7Vs5F
zY9wsKUEc3c3fMhwbxe/n/KQzvT/VzXSrLOw54LTsG7GNnUIhkuKwNqkhXuVItDy
ps+3z7RG/hOAWN9vktqLybi/E/uTmUqpsMrHSg7EMjqJ2jP8FMyH9EARLRL9gUG3
XFFNhFzjjDKjFrMsTUyVr+9tp4ucCZaakP9ZhjN9R/6FCXXR1K/XTVhTgYkawPHd
+PJaXn2T7NOie+tChiZx5Sii2XZtDm7WMFfwb4xhOBV67pWCSWSjkKl/xIDSrdRj
qLtzVfP/wiSL4sL9fy7Pya2OBtF2d/bdXXQ54JbbRlw3eRP+y+ej63UD+OP602EE
bbzrGB+B7ozwnfCmNNBnF23GgVYtJPWfDvgjXicprvbgjpmQAjeFohA8IIC322w5
sFsYuDL46KEs/KREoHjQNo1pxHKnmITU5GIMmWWoPyidTZuNNc4qWM6cH5RAbJup
IBaJWcWAr4eZ8p7pZd1dMkWEld4tieLdoJv2ENK77rDhwrq8kz66Xw9/xDJ/Nuio
sw5sd3py6Ayz+ekCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFIvTecghwRj4gDP/WDark0Fu5/H0MB8GA1UdIwQYMBaA
FIvTecghwRj4gDP/WDark0Fu5/H0MA0GCSqGSIb3DQEBCwUAA4ICAQAJuRiReD46
H85vhc1wzg7JUy6k+q5aUA9iKOupGyYBtkvzniQzhouZGEP47AcWkbPNGqo/3yl+
SCUItkBfPjunBmzcAhhZqyxJJ1q/SgY21DBf3W7WB0yzPx+saCwEi74rf44HbslY
Gp9W9pv0NFDT1+lQGerp978ErGQZh2M8rrGFwhcHmx71/umZ9ju6xyaGRaoHba+Y
8bxhR11j/Zx/UGRQBpjdAe2+VuAHDGpHjd9ieQ45YgoyJYkjBbecXJFttcVnShwu
7rxu8HNV3fMjoa4M6TDaY4z8KDgzHChzQSRB085TJIZzcG+/4zpJredzLe+jEq0P
RAuFEx4FjpRqYQu08HUmepO0Vd8a2ut7WyIBOC5b+pM+55LaGDfDF6rt8H7g6G84
w/RYFP/w/elxp3T1cFgDXsuZ60mfK6SX5ZbH3ZGPN0+xF/VahncUWKSfxSaSjzRI
Eml/Aac22kgtbbtxf8Bn4tgtY30sxqQRVnldHKi02FxS+DNg3SZB1hIpw6myyUo0
XH/ZtyumDLkcCvKzz/KvQGDOWDBmaPfPOPfMgiFXryB+YFMfy75Bhm0+aE+GM8fP
sextO8kawYI62aCHiOClkm2qIBiFtbsNG2HMTL4HKaNDOh9vxesPD5EteVzxTvg4
Oyk8YPB4kGtloH569v2Fj2U24D6KRyqxvQ==
-----END CERTIFICATE-----
not_before          1774156885</code></pre>
</div>
</div>
</li>
</ol>
</div>
<div class="paragraph">
<p>That is it. We have just created our first certificate.</p>
</div>
</div>
<div class="sect2">
<h3 id="_setting_up_an_intermediate_ca">Setting Up an Intermediate CA</h3>
<div class="paragraph">
<p>The test above demonstrated the usage of the PKI secrets engine to issue a certificate. However, the certificate was issued by the root CA. This is not practical or recommended for production environments. Instead, we should use an intermediate CA. The setup is very similar to the root CA, but with a few key differences: Instead of directly signing with the root CA, we will create a CSR (Certificate Signing Request) and sign it with the root CA. This can then be used to issue certificates with the intermediate CA.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>First we enable the PKI secrets engine for the intermediate CA and tune it a little bit.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Enable PKI engine for intermediate CA
bao secrets enable -path=pki_int pki

# Configure maximum lease time
bao secrets tune -max-lease-ttl=43800h pki_int</code></pre>
</div>
</div>
<div class="paragraph">
<p>We set the maximum TTL of the intermediate CA to 43800 hours (5 years). It should be equal to or less than the root CA.</p>
</div>
</li>
<li>
<p>Generate a CSR (Certificate Signing Request)</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Generate intermediate CSR
bao write -format=json pki_int/intermediate/generate/internal \
  common_name=&#34;Example Intermediate CA&#34; \
  issuer_name=&#34;intermediate-ca&#34; \
  key_bits=4096 \
  | jq -r &#39;.data.csr&#39; &gt; pki_int.csr</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create the CSR and store it at <code>pki_int.csr</code>, which can be signed by the root CA and then used to issue certificates with the intermediate CA. As an example, the following CSR is generated:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">-----BEGIN CERTIFICATE REQUEST-----
MIIEZzCCAk8CAQAwIjEgMB4GA1UEAxMXRXhhbXBsZSBJbnRlcm1lZGlhdGUgQ0Ew
ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/dLEhNgiBeMiCIwrAq9S8
9m7SjqH59JaYPTBEpdAKCs1gsEBNROOaI+zftVaVJEGw/yi1gFRijTbjvBAbwAbc
YDV5VYLXqaoetkSE2hhIbsX92xwwch++J3BkGrgLt5y6uK0gLfODLp0hbxTdGhO0
RvIBKa2X1ctSLgEscgAr8PrlIfDlzahcxDgxpQQsN/1CASW2X5i/DEj160rbODzG
v10FEsVEcOLaJEee9qQ9yvwySiPLfH7KjEFV8qlQd/uY4gnGE8WW6nHhZEW+0Lsj
h1iO0Y4GA2Yw60FtTxsGAQlTCE3xCZTajInwc0XgDIYBtj/PEJhQUNU7mamchqng
jg+MJb9jzoqYmTw7dLvxTFTobu8s8y+7mjKQYevg7+FRNWQ467PmxGqaD++HQEw9
Ef1kaQ1Aw0L5ZuTZ2QaEzbJe2Rka5slHAja6rHxX2rNk6YkdbE2MfCUPqSVpqHBp
I+ptF8b73EgjgKINpWRXKvqH4QX2f6zUpVbr+5AikbS9TmPLQRqHHKtO0uDFEQzn
38w9PntU/N29BrYhzkeCzdGNFZTcL+Yijnp7fKrHl+iYasIUQD+MGWR3sUqaOODc
JmKvfl8H9UNulV4I7JXn0MBUUIT3uhTtsJ4Q62xr9pltZH5ijgR8Zqrl/q2kh+jf
pCoA7CpUKZXSiSou0zG3lwIDAQABoAAwDQYJKoZIhvcNAQELBQADggIBAGBAEsLK
QdeEejkFxP06xmEKypvGcy4GGw2g/ODp9lZQeNyaObwiABDjdJfj7CBgFGsPcMbq
DAFq/Kt/f+BmQwRulQf6ers9OIC8+4HAgHF9olgYJSn+lsrNXT9M4m02orIAodey
+xFxIcuUCHygQiXMIzb4QLzyvzW0/CqdsCysfbgHNN8P5deOR2/PseirYZKYFRQI
/ZxQrjB2Uj9gBND1Q5ew97Gm+mVvhqnb1T/Y1aIS+iEdRXADjxIvdweOPBXj3pDY
h8P+NgrP49pAKEvPuRFgfWMrkMrg4dQYPtVElcjN5XFMBXY2wZDketTu0rqroSlk
tcEhcwHdFFi+ILq6UHBDtMhZBkFtJG/82FgjcnR1G+1UOwKGSFOJ0HGiZpYGOXtc
hJM07eSZ0JzFCrg+2/geHM5c8X33yShe+4DRc3fi2KpsQbOAvvtH7Kb6AYwNu953
yBoOSpzI3Q9XjiFaAl1U8JDIr5DRfHGkUt1ozg4nf3ZHjPQC/NQNTq4XNEnjWgnJ
kiC+Ss4YZ6QnfvQU3aIwU97WKG6PIb5x9v+5mBwQe6AgDn2T1mmfyumsFfu/7aTB
87BUt3lWesvuW67JvE95LKs8NukNTW8FETR/x3Kn8TSYMulvXJsv7yb8g+Mm8k5w
f+LiteH/fEMVMYsoIdNL6MYJhiZNxStFDC2V
-----END CERTIFICATE REQUEST-----</code></pre>
</div>
</div>
</li>
<li>
<p>Sign the CSR with the root CA</p>
<div class="paragraph">
<p>The CSR must now be signed using the root CA that was generated previously. Use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write -format=json pki/root/sign-intermediate \
  csr=@pki_int.csr \ <i class="conum" data-value="1"></i><b>(1)</b>
  format=pem_bundle \
  ttl=43800h \
  | jq -r &#39;.data.certificate&#39; &gt; cert_bundle.pem <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 CSR file created in the previous step</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The signed certificate is stored in the file <code>cert_bundle.pem</code>
<div class="paragraph">
<p>This will sign the CSR with the root CA and store the signed certificate at <code>cert_bundle.pem</code>.</p>
</div></td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Configure the set-signed certificate</p>
<div class="paragraph">
<p>We need to configure the intermediate CA with the signed certificate, so we can issue new certificates:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write pki_int/intermediate/set-signed \
  certificate=@cert_bundle.pem</code></pre>
</div>
</div>
</li>
<li>
<p>Creating Certificate Roles</p>
<div class="paragraph">
<p>Before we can issue certificates, we need to create roles. The following defines a role for server certificates and a role for client certificates, including allowed domains, maximum TTL, and key type.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Create a role for issuing server certificates
bao write pki_int/roles/server-cert \
  allowed_domains=&#34;example.com,internal.example.com&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  allow_subdomains=true \ <i class="conum" data-value="2"></i><b>(2)</b>
  max_ttl=720h \
  key_bits=2048 \ <i class="conum" data-value="3"></i><b>(3)</b>
  key_type=rsa \
  require_cn=false \
  allow_any_name=false

# Create a role for client certificates
bao write pki_int/roles/client-cert \
  allowed_domains=&#34;example.com&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  allow_subdomains=true \
  max_ttl=168h \
  key_usage=&#34;DigitalSignature,KeyEncipherment&#34; \
  ext_key_usage=&#34;ClientAuth&#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 allowed domains, comma separated list</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Allow subdomains, true or false</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The key bits, 2048 or 4096
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Check out the official documentation for more details of possible options: <a href="https://openbao.org/docs/" rel="noopener" target="_blank">https://openbao.org/docs/</a>
</td>
</tr>
</tbody></table>
</div></td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Issuing Certificates</p>
<div class="paragraph">
<p>Finally we can issue certificates. The example below issues a server certificate via the intermediate mount (and the article’s role setup supports a separate client role if you need mutual TLS).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Issue a server certificate
bao write pki_int/issue/server-cert \
  common_name=&#34;myapp.example.com&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  alt_names=&#34;myapp.internal.example.com&#34; \ <i class="conum" data-value="2"></i><b>(2)</b>
  ttl=168h</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 common name, the subdomain under example.com is allowed.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The alternative names
<div class="paragraph">
<p>This will print a large amount of detail. Typical fields include:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>certificate</code></p>
</li>
<li>
<p><code>issuing_ca</code></p>
</li>
<li>
<p><code>private_key</code></p>
</li>
<li>
<p><code>serial_number</code></p>
</li>
</ul>
</div></td>
</tr>
</tbody></table>
</div>
</li>
</ol>
</div>
<div class="paragraph">
<p>The output contains the full chain (intermediate and root CA), the leaf certificate, and the private key, which you can use to configure TLS in an application.</p>
</div>
<div class="paragraph">
<p>+
TIP: It can also be printed out in JSON format which is easier to process later.</p>
</div>
<div class="paragraph">
<p>+
The following example creates the JSON file with all the components.</p>
</div>
<div class="paragraph">
<p>+</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write -format=json pki_int/issue/server-cert \
  common_name=&#34;api.example.com&#34; \
  ttl=168h &gt; api-cert.json</code></pre>
</div>
</div>
<div class="paragraph">
<p>+
This can then be extracted to the individual components using the <code>jq</code> command.</p>
</div>
<div class="paragraph">
<p>+</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">cat /tmp/api-cert.json | jq -r &#39;.data.certificate&#39;
cat /tmp/api-cert.json | jq -r &#39;.data.private_key&#39;
cat /tmp/api-cert.json | jq -r &#39;.data.ca_chain[]&#39;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="pki-policies">PKI Policies</h3>
<div class="paragraph">
<p>Every OpenBao request is checked against the token’s policies; without an explicit allow, paths are <strong>denied</strong>.
PKI is split into several API paths (<code>issue</code>, <code>sign</code>, <code>ca</code>, <code>crl</code>, …), so you grant only what each client needs.</p>
</div>
<div class="paragraph">
<p>For example: operators using <code>pki_int/issue/…​</code> need the <strong>issue</strong> path; cert-manager sending a CSR needs the <strong>sign</strong> path; workloads or validators that fetch trust material need <strong>read</strong> on the CA (and often the CRL) paths etc.</p>
</div>
<div class="paragraph">
<p>The example below is a single policy you can attach to a role or token; split into narrower policies in production if different actors should not share the same privileges.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">set -e

cat &lt;&lt;&#39;EOF&#39; | bao policy write pki-int-workload -
# Allow issuing certificates with the server-cert role (CLI / API issue endpoint)
path &#34;pki_int/issue/server-cert&#34; {
  capabilities = [&#34;create&#34;, &#34;update&#34;]
}

# Allow cert-manager (Vault issuer) to sign CSRs via the sign endpoint for the same role
path &#34;pki_int/sign/server-cert&#34; {
  capabilities = [&#34;create&#34;, &#34;update&#34;]
}

# Allow reading CA certificate
path &#34;pki_int/ca/pem&#34; {
  capabilities = [&#34;read&#34;]
}

# Allow reading CRL
path &#34;pki_int/crl/pem&#34; {
  capabilities = [&#34;read&#34;]
}
EOF

bao policy read pki-int-workload</code></pre>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sect-cert-manager">Integration with cert-manager</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://cert-manager.io/" rel="noopener" target="_blank">cert-manager</a> requests TLS certificates inside Kubernetes and stores them in Secrets.
It includes a <strong>Vault</strong> issuer that talks to HashiCorp Vault’s HTTP API; OpenBao exposes the same API for PKI and auth, so you can point that issuer at OpenBao instead of Vault.</p>
</div>
<div class="paragraph">
<p>cert-manager generates a private key and a CSR in the cluster, then calls the PKI <strong>sign</strong> endpoint for your role (not the <strong>issue</strong> endpoint you used from the CLI earlier).
The path in the issuer must therefore follow <code>mount/sign/role-name</code>, for example <code>pki_int/sign/server-cert</code>, matching the intermediate mount and role from this article.</p>
</div>
<div class="paragraph">
<p>Before the <code>ClusterIssuer</code> can log in to OpenBao, you need <strong>Kubernetes auth</strong> enabled, a <strong>policy</strong> that allows signing on <code>pki_int</code> (see <a href="#pki-policies">PKI policies</a>), and a <strong>role</strong> that binds the cert-manager controller’s service account to that policy.
<a href="/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/">Part 7 of this series</a> walks through Kubernetes authentication in detail; the commands below are a minimal summary for cert-manager.</p>
</div>
<div class="sect2">
<h3 id="_enable_the_kubernetes_auth_method">Enable the Kubernetes auth method</h3>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Skip this step if <code>kubernetes</code> is already listed under <code>bao auth list</code>.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao auth enable --description=&#34;Kubernetes/OpenShift service account auth&#34; kubernetes</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_configure_the_kubernetes_auth_method">Configure the Kubernetes auth method</h3>
<div class="paragraph">
<p>OpenBao’s server validates incoming service-account JWTs by calling the Kubernetes TokenReview API.
If OpenBao runs <strong>inside</strong> the cluster (the setup assumed here), configure <code>auth/kubernetes</code> with:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong><code>kubernetes_host</code></strong> — API URL reachable from the OpenBao pods (typically <code><a class="bare" href="https://kubernetes.default.svc:443">https://kubernetes.default.svc:443</a></code>).</p>
</li>
<li>
<p><strong><code>kubernetes_ca_cert</code></strong> — PEM of the cluster CA that signs the API server certificate (same material as in the service-account token Secret).</p>
</li>
<li>
<p><strong><code>token_reviewer_jwt</code></strong> — long-lived JWT for a dedicated service account that may create TokenReview objects (via <code>system:auth-delegator</code>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If OpenBao runs <strong>outside</strong> the cluster, use your public API URL for <code>kubernetes_host</code> (for example <code>$(oc whoami --show-server)</code>), the same CA and reviewer JWT extracted from the cluster, and ensure the OpenBao process can reach that URL on the network.</p>
</div>
<div class="sect3">
<h4 id="_in_cluster_example_reviewer_service_account_and_secret">In-cluster example: reviewer service account and Secret</h4>
<div class="paragraph">
<p>Create a service account in the OpenBao namespace (here openbao), bind <strong>system:auth-delegator</strong>, and request a <strong>long-lived token</strong> Secret (required from Kubernetes 1.24 onward unless you use another token source).</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-kube-auth
  namespace: openbao <i class="conum" data-value="1"></i><b>(1)</b>
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: openbao-kube-auth-delegator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:auth-delegator <i class="conum" data-value="2"></i><b>(2)</b>
subjects:
  - kind: ServiceAccount
    name: openbao-kube-auth
    namespace: openbao
---
apiVersion: v1
kind: Secret
metadata:
  name: openbao-kube-auth-token
  namespace: openbao
  annotations:
    kubernetes.io/service-account.name: openbao-kube-auth
type: kubernetes.io/service-account-token <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 namespace of the OpenBao service account</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The name of the ClusterRole that binds the service account to the system:auth-delegator role</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The type of the Secret, which is a long-lived token Secret</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Save the YAML manifest to a file (for example openbao-kube-auth.yaml), apply it, then wait until the Secret contains a token (the control plane fills <code>data.token</code>—often within a few seconds).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -n openbao -f openbao-kube-auth.yaml

until oc get secret openbao-kube-auth-token -n openbao -o jsonpath=&#39;{.data.token}&#39; | grep -q .
do
  sleep 2
done</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">
You can manage the reviewer service account, <code>ClusterRoleBinding</code>, and token Secret through GitOps so the configuration stays reproducible.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect3">
<h4 id="_configure_authkubernetesconfig">Configure auth/kubernetes/config</h4>
<div class="paragraph">
<p>Dump the reviewer JWT and CA to files and configure the Kubernetes auth backend.
Use the <strong>in-cluster</strong> API URL so OpenBao pods reach the Kubernetes API without relying on the external load balancer.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">TMP=$(mktemp -d) <i class="conum" data-value="1"></i><b>(1)</b>
trap &#39;rm -rf &#34;$TMP&#34;&#39; EXIT

oc get secret openbao-kube-auth-token -n openbao -o jsonpath=&#39;{.data.token}&#39; | base64 -d &gt; &#34;$TMP/reviewer.jwt&#34; <i class="conum" data-value="2"></i><b>(2)</b>
oc get secret openbao-kube-auth-token -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d &gt; &#34;$TMP/k8s-ca.crt&#34; <i class="conum" data-value="3"></i><b>(3)</b>

bao write auth/kubernetes/config \ <i class="conum" data-value="4"></i><b>(4)</b>
  kubernetes_host=&#34;https://kubernetes.default.svc:443&#34; \
  kubernetes_ca_cert=@&#34;$TMP/k8s-ca.crt&#34; \
  token_reviewer_jwt=@&#34;$TMP/reviewer.jwt&#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>Create a temporary directory to store the reviewer JWT and CA and remove it after the script exits</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Get the reviewer JWT from the Secret</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Get the CA from the Secret</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Write the configuration to the auth/kubernetes/config path using the internal API URL of the Kubernetes cluster.</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
On plain Kubernetes, replace <code>oc</code> with <code>kubectl</code> and the same Secret paths.
</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">
If logins fail after cluster upgrades or with projected service-account tokens, check whether you must set <code>issuer</code> or related options; see <a href="https://openbao.org/docs/auth/kubernetes/" rel="noopener" target="_blank">OpenBao Kubernetes auth</a> and <a href="/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/">Part 7</a>.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>To inspect the stored Kubernetes auth backend configuration:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao read auth/kubernetes/config</code></pre>
</div>
</div>
<div class="paragraph">
<p>You should see <code>kubernetes_host</code> and <code>kubernetes_ca_cert</code>; <code>token_reviewer_jwt</code> is often omitted or redacted on read.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_policy_and_role_for_cert_manager">Policy and role for cert-manager</h3>
<div class="paragraph">
<p>Attach a policy (here <code>cert-manager-pki</code>) that matches the PKI paths cert-manager uses—aligned with <a href="#pki-policies">PKI policies</a>—then map the controller’s service account to that policy.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Adjust <code>bound_service_account_names</code> and <code>bound_service_account_namespaces</code> if your cert-manager installation does not use the <code>cert-manager</code> service account in the <code>cert-manager</code> namespace.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao policy write cert-manager-pki - &lt;&lt;&#39;EOF&#39;
path &#34;pki_int/sign/server-cert&#34; {
  capabilities = [&#34;create&#34;, &#34;update&#34;]
}

path &#34;pki_int/ca/pem&#34; {
  capabilities = [&#34;read&#34;]
}

path &#34;pki_int/crl/pem&#34; {
  capabilities = [&#34;read&#34;]
}

path &#34;auth/token/renew-self&#34; {
  capabilities = [&#34;update&#34;]
}
EOF

bao write auth/kubernetes/role/cert-manager \
  bound_service_account_names=cert-manager \
  bound_service_account_namespaces=cert-manager \
  policies=cert-manager-pki \
  ttl=1h \
  max_ttl=24h</code></pre>
</div>
</div>
<div class="sect3">
<h4 id="_verify_with_a_kubernetes_login_optional">Verify with a Kubernetes login (optional)</h4>
<div class="paragraph">
<p>After the cert-manager auth role exists, prove that OpenBao accepts the same service-account identity cert-manager will use.
Request a short-lived projected token for that service account, then log in to the <strong>Kubernetes</strong> auth method:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">JWT=$(oc create token cert-manager -n cert-manager --duration=15m)

bao write -format=json auth/kubernetes/login role=cert-manager jwt=&#34;$JWT&#34; \
  | jq -r &#39;.auth.client_token&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>A printed <strong>client token</strong> means TokenReview and role binding succeeded.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_configure_the_clusterissuer_for_cert_manager">Configure the (Cluster)Issuer for cert-manager</h3>
<div class="paragraph">
<p>To integrate cert-manager with OpenBao we need to configure either a ClusterIssuer (cluster-wide) or an Issuer (namespace-scoped). The setup is very similar.</p>
</div>
<div class="paragraph">
<p>The ClusterIssuer manifest below must use the same OpenBao role name in <code>spec.vault.auth.kubernetes.role</code> (here <code>cert-manager</code>).</p>
</div>
<div class="paragraph">
<p>The server URL in the issuer must be reachable <strong>from the cert-manager pods</strong> (in-cluster Service DNS is typical), for example <a class="bare" href="https://openbao.openbao.svc:8200">https://openbao.openbao.svc:8200</a>.</p>
</div>
<div class="paragraph">
<p>The following is an example of a ClusterIssuer manifest.</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: ClusterIssuer
metadata:
  name: openbao-cluster-issuer
spec:
  vault:
    path: pki_int/sign/server-cert <i class="conum" data-value="1"></i><b>(1)</b>
    server: https://openbao.openbao.svc:8200 <i class="conum" data-value="2"></i><b>(2)</b>
    caBundle: LS0tLS1CRUdJTi... <i class="conum" data-value="3"></i><b>(3)</b>
    auth:
      kubernetes:
        role: cert-manager
        mountPath: /v1/auth/kubernetes <i class="conum" data-value="4"></i><b>(4)</b>
        serviceAccountRef:
          name: cert-manager <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>PKI sign path for the OpenBao role (mount/sign/role-name).</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>OpenBao Service URL as seen from cert-manager pods.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><strong>Required</strong> for private / self-signed OpenBao TLS: single-line base64 of the PEM CA (see the command block below). Omit only if the server uses a public CA trusted by default in the cert-manager image.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Kubernetes auth mount path in OpenBao (default is <code>/v1/auth/kubernetes</code>).</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Name of the cert-manager controller service account only. Do <strong>not</strong> add <code>namespace</code> under <code>serviceAccountRef</code>; it is not part of the cert-manager API.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>If OpenBao’s HTTPS certificate is not signed by a CA already trusted inside the cert-manager pods, you must supply trust material; otherwise TLS verification fails with <code>x509: certificate signed by unknown authority</code>.</p>
</div>
<div class="paragraph">
<p>Use <strong><code>caBundle</code></strong> (base64-encoded PEM of the CA that signed OpenBao’s server certificate) or <strong><code>caBundleSecretRef</code></strong> pointing to a Secret in the <code>cert-manager</code> namespace.</p>
</div>
<div class="paragraph">
<p>Fetch the certificate OpenBao is using:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get secret openbao-server-tls -n openbao -o jsonpath=&#39;{.data.ca\.crt}{&#34;\n&#34;}&#39;</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 secret was created in a previous article, when we were setting up the OpenBao server.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The returned string must be added to the <strong>ClusterIssuer</strong> manifest as the value of the <code>caBundle</code> field.</p>
</div>
<div class="paragraph">
<p>Alternatively, copy the CA PEM into a Secret in the <strong>cert-manager</strong> namespace and reference it (no giant line in the issuer):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># spec.vault fragment — use instead of caBundle if you prefer
    caBundleSecretRef:
      name: openbao-ca
      key: ca.crt</code></pre>
</div>
</div>
<div class="paragraph">
<p>However, this requires that the Secret exists in the appropriate namespace. For ClusterIssuer, the Secret must be in the <code>cert-manager</code> namespace.</p>
</div>
<div class="paragraph">
<p>Once the ClusterIssuer is created and is ready, we can issue a certificate.</p>
</div>
</div>
<div class="sect2">
<h3 id="_issue_a_certificate">Issue a Certificate</h3>
<div class="paragraph">
<p>With the ClusterIssuer in place, create a Certificate in the workload namespace (here myapp, this namespace must exist).
cert-manager will create a TLS Secret (myapp-tls below) containing <code>tls.crt</code> and <code>tls.key</code>, and renew the cert before it expires according to <code>renewBefore</code>.</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: myapp-tls
  namespace: myapp <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  secretName: myapp-tls <i class="conum" data-value="2"></i><b>(2)</b>
  issuerRef: <i class="conum" data-value="3"></i><b>(3)</b>
    name: openbao-cluster-issuer
    kind: ClusterIssuer
  commonName: myapp.example.com <i class="conum" data-value="4"></i><b>(4)</b>
  dnsNames:
    - myapp.example.com
  duration: 168h <i class="conum" data-value="5"></i><b>(5)</b>
  renewBefore: 48h <i class="conum" data-value="6"></i><b>(6)</b>
  privateKey:
    rotationPolicy: Always <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>The namespace of the workload</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The name of the TLS Secret</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The issuer of the certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The common name of the certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The duration of the certificate</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The duration before the certificate is renewed</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Explicit rotation policy: <code>Always</code> matches cert-manager ≥ v1.18 default (new key each renewal). Set <code>Never</code> only if you rely on a stable key across renewals.</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 values you set in <code>commonName</code> and <code>dnsNames</code> must be <strong>allowed by the OpenBao PKI role</strong> (<code>allowed_domains</code>, <code>allow_subdomains</code>, <code>allow_bare_domains</code>, and related settings).
</td>
</tr>
</tbody></table>
</div>
<div class="admonitionblock tip">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
If the Certificate never reaches <code>Ready=True</code>, check <code>kubectl describe certificate</code> / <code>kubectl describe certificaterequest</code> (or the same with <code>oc describe</code> on OpenShift) in that namespace, the cert-manager controller logs, and the OpenBao audit log for <code>403</code> policy denials or CSR rejection messages from the PKI engine.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>When everything is working, a Secret named <code>myapp-tls</code> is created in the <code>myapp</code> namespace containing <code>tls.crt</code> and <code>tls.key</code>.</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc describe secret/myapp-tls -n myapp

[source,bash]
----
Name:         myapp-tls
Namespace:    myapp
[...output omitted...]
Type:  kubernetes.io/tls

Data
====
tls.key:  1679 bytes
ca.crt:   1846 bytes
tls.crt:  3631 bytes</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This part showed how to turn OpenBao into a <strong>usable CA</strong> for cluster workloads and how to <strong>automate TLS</strong> with cert-manager.</p>
</div>
<div class="paragraph">
<p>You should now be able to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Enable the PKI engine, set CA and CRL URLs, define roles, and issue certificates via the <code>issue</code> API (CLI or automation).</p>
</li>
<li>
<p>Stand up an intermediate CA signed by the root, and keep day-to-day issuance on the intermediate mount (<code>pki_int</code>).</p>
</li>
<li>
<p>Express least-privilege with policies that separate <code>issue</code> from <code>sign</code>, and allow CA/CRL reads where validators or clients need them.</p>
</li>
<li>
<p>Wire cert-manager to OpenBao’s Vault-compatible API: Kubernetes auth in-cluster (reviewer JWT and CA), a ClusterIssuer with <code>caBundle</code> (or <code>caBundleSecretRef</code>) for private OpenBao TLS, <code>serviceAccountRef.name</code> only (no <code>namespace</code> field), and a Certificate with an explicit <code>privateKey.rotationPolicy</code> for cert-manager ≥ v1.18.</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="https://openbao.org/docs/secrets/pki" rel="noopener" target="_blank">PKI Secrets Engine</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>The Guide to OpenBao - Secrets Engines KV - Part 8</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-25-openbao-part-8-secrets-engines-kv/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-25-openbao-part-8-secrets-engines-kv/</guid><pubDate>Wed, 25 Mar 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><description>Deep dive into OpenBao secrets engines: KV for static secrets</description><content:encoded><![CDATA[<div class="paragraph">
<p>Secrets engines are the heart of OpenBao’s functionality. They store, generate, or encrypt data. This article covers the most commonly used secrets engine: KV for static secrets. It will demonstrate how to use the KV secrets engine to store and retrieve secrets. Upcoming articles will cover the PKI secrets engine and the integration with <strong>cert-manager</strong>.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Secrets engines are components which store, generate, or encrypt data. Some engines simply store and read data, others connect to other services and other engines provide encryption as a service.</p>
</div>
<div class="paragraph">
<p>They are enabled at a path in OpenBao (as everything is done as a path in OpenBao). This means each secrets engine defines its very own path including properties.</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 path is case-sensitive. For example, the KV secrets engine enabled at kv/ and KV/ are treated as two distinct instances of KV secrets engine.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The management of the secret engines is done via the CLI or API or, if enabled, the UI. Engines can be enabled, disabled, moved or tuned.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Enable - enables a secrets engine at the given path.</p>
</li>
<li>
<p>Disable - disables an existing secrets engine. All existing secrets are revoked and the data is deleted.</p>
</li>
<li>
<p>Move - moves the path for an existing secrets engine.</p>
</li>
<li>
<p>Tune - tunes global configuration for the secrets engine such as the TTLs.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_list_of_secrets_engines">List of Secrets Engines</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To list all enabled secrets engines, we 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">bao secrets list</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which will output something like:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Path          Type         Accessor              Description
----          ----         --------              -----------
cubbyhole/    cubbyhole    cubbyhole_f8b1e784    per-token private secret storage
identity/     identity     identity_76940581     identity store
secret/       kv           kv_ccb47c73           n/a
sys/          system       system_cb0d64b7       system endpoints used for control, policy and debugging</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">
As a reminder: To login to the OpenBao CLI, we can use the following command (assuming that you are using HTTPS and have the CA certificate ready):
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">export BAO_ADDR=&#39;https://127.0.0.1:8200&#39;
export BAO_CACERT=&#34;$PWD/openbao-ca.crt&#34;
bao login</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="sect-kv">KV (Key-Value) Secrets Engine</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <strong>KV</strong> secrets engine is probably the most commonly used engine. It is a generic key-value store.
When you work with KV secrets engine you will note very soon that there are two versions of the engine: <strong>KV v1</strong> and <strong>KV v2</strong>.</p>
</div>
<div class="sect2">
<h3 id="_kv_version_1">KV Version 1</h3>
<div class="paragraph">
<p>KV v1 is the older version of the KV secrets engine. It does not support versioning and only stores the recently written value for a key. Requests to this engine will be more performant because the storage requests will be fewer and no locking is required. The storage as such will be much smaller, since it does not need to retain any history.</p>
</div>
</div>
<div class="sect2">
<h3 id="_kv_version_2">KV Version 2</h3>
<div class="paragraph">
<p>KV v2 on the other hand supports versioning of secrets. When a version is deleted, the underlying data is not removed, instead you must destroy it intentionally. Storing the history of secrets will increase the required storage space. However, I would recommend using KV v2 in most cases as the benefit of versioning is too great to ignore.</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 following example will use KV v2.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_kv_version_1_vs_version_2">KV Version 1 vs Version 2</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">Feature</th>
<th class="tableblock halign-left valign-top">Version 1</th>
<th class="tableblock halign-left valign-top">Version 2</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Versioning</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 (up to 10 versions by default)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Check-and-Set</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 (prevents concurrent writes)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Soft delete</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 (recoverable)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Metadata</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 (custom metadata)</p></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">
KV v1 can be upgraded to KV v2 by using the following command as described in the documentation: <a href="https://openbao.org/docs/secrets/kv/kv-v2/#upgrading-from-version-1" rel="noopener" target="_blank">Upgrading from version 1</a>
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_enabling_kv_engine">Enabling KV Engine</h3>
<div class="paragraph">
<p>Let’s enable the KV v2 engine at the path <strong>secret/</strong> and give it the description &#34;Application secrets&#34;.</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 path was used in <a href="/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/">Part 7 of this series</a> already. So you might have to remove or rename the engine first if you have already enabled it.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao secrets enable \
  -path=secret \ <i class="conum" data-value="1"></i><b>(1)</b>
  -version=2 \ <i class="conum" data-value="2"></i><b>(2)</b>
  -description=&#34;Application secrets&#34; \
  kv <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>Path where the secrets will be stored</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Version of the engine in case of KV</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Name of the engine</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_storing_secrets">Storing Secrets</h3>
<div class="paragraph">
<p>With the enabled engine, we can now store secrets at the path:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Put a secret (KV v2)
bao kv put secret/myapp/database \ <i class="conum" data-value="1"></i><b>(1)</b>
  username=&#34;dbadmin&#34; \ <i class="conum" data-value="2"></i><b>(2)</b>
  password=&#34;supersecret123&#34; \
  host=&#34;db.example.com&#34; \
  port=&#34;5432&#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>Path where the secret will be stored</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Secret data</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Which will output something like:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">======= Secret Path =======
secret/data/myapp/database <i class="conum" data-value="1"></i><b>(1)</b>

======= Metadata =======
Key                Value
---                -----
created_time       2026-03-13T05:56:52.670296216Z
custom_metadata    &lt;nil&gt;
deletion_time      n/a
destroyed          false
version            1 <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>Path where the secret will be stored</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Version of the secret</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_reading_secrets">Reading Secrets</h3>
<div class="paragraph">
<p>To read the secret, we can use one of the following commands:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Read a secret
bao kv get secret/myapp/database</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which will output something like:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">======= Secret Path =======
secret/data/myapp/database <i class="conum" data-value="1"></i><b>(1)</b>

[... more metadata ...]

====== Data ====== <i class="conum" data-value="2"></i><b>(2)</b>
Key         Value
---         -----
host        db.example.com
password    supersecret123
port        5432
username    dbadmin</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Path where the secret will be stored</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Secret data</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>As an alternative, we can use the following command to get the secret as JSON:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Get as JSON
bao kv get -format=json secret/myapp/database</code></pre>
</div>
</div>
<div class="paragraph">
<p>We can also read a specific existing version of the secret by using the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Read specific version
bao kv get -version=2 secret/myapp/database</code></pre>
</div>
</div>
<div class="paragraph">
<p>Or simply, a specific field:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Get specific field
bao kv get -field=password secret/myapp/database</code></pre>
</div>
</div>
<div class="paragraph">
<p>If the UI is enabled, the same can be achieved via the browser:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part8_secretsengine_kv.png" alt="OpenBao Secret Retrieval"/>
</div>
<div class="title">Figure 1. OpenBao Secret Retrieval</div>
</div>
</div>
<div class="sect2">
<h3 id="_managing_versions">Managing Versions</h3>
<div class="paragraph">
<p>KV v2 keeps a version history. This is a big advantage over KV v1. To try version management, ensure the secret has at least two versions. Create a second version by writing to the same path again (e.g. with updated values):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao kv put secret/myapp/database username=dbadmin password=newpassword456 port=5432 <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>Updating an existing secret with a new password, which will create a new version in KV v2.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Now you can list versions, soft-delete, undelete, or destroy a specific version:</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 will only paste the output of the first command. The rest will be similar …​ you’ll get the idea.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># List all versions and metadata
bao kv metadata get secret/myapp/database</code></pre>
</div>
</div>
<div class="paragraph">
<p>Which will output something like:</p>
</div>
<div class="listingblock nocopy">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">====== Version 1 ====== <i class="conum" data-value="1"></i><b>(1)</b>
Key              Value
---              -----
created_time     2026-03-13T05:56:52.670296216Z
deletion_time    n/a
destroyed        false

====== Version 2 ====== <i class="conum" data-value="2"></i><b>(2)</b>
Key              Value
---              -----
created_time     2026-03-13T06:13:18.539285992Z
deletion_time    n/a
destroyed        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>Version 1</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Version 2</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Specific versions can now be (soft-) deleted, permanently destroyed etc.</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 last command of the list will completely delete all versions and metadata for a given path aka the secret is gone.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Delete specific version (soft delete)
bao kv delete -versions=2 secret/myapp/database

# Undelete a version
bao kv undelete -versions=2 secret/myapp/database

# Permanently destroy a version
bao kv destroy -versions=2 secret/myapp/database

# Delete all versions and metadata
bao kv metadata delete secret/myapp/database</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">
When you define a secret you can set the maximum number of versions to keep using the flag <strong>-max-versions=5</strong>. This is the number of versions that will be kept in the history.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_custom_metadata">Custom Metadata</h3>
<div class="paragraph">
<p>A secret’s key metadata can contain multiple custom metadata that can be used to describe the secret. The data will be stored as key-value pairs. Imagine them like labels in Kubernetes.</p>
</div>
<div class="paragraph">
<p>Let’s extend our secret with some custom metadata:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Add custom metadata to a secret
bao kv metadata put \
  -custom-metadata=&#34;owner=team-a&#34; \ <i class="conum" data-value="1"></i><b>(1)</b>
  -custom-metadata=&#34;environment=production&#34; \ <i class="conum" data-value="2"></i><b>(2)</b>
  secret/myapp/database</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tbody><tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>First custom metadata to set an owner label</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Second custom metadata to set an environment label</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_policies_for_kv_v2">Policies for KV v2</h3>
<div class="paragraph">
<p>OpenBao policies control which authenticated clients may access which paths and with what actions. For the KV v2 secrets engine, any read or write via the API is checked against the token’s policies; without a policy granting the right capabilities, requests return 403. This section shows example policy rules you can attach to roles (e.g. Kubernetes auth roles) or tokens so that applications and users have the minimum access they need.</p>
</div>
<div class="paragraph">
<p>KV v2 exposes two logical path trees under the mount path (here <code>secret/</code>):</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong><code>secret/data/&lt;path&gt;</code></strong> — Secret values. Use capabilities such as <code>read</code>, <code>create</code>, <code>update</code>, and <code>delete</code> for reading and writing secret data.</p>
</li>
<li>
<p><strong><code>secret/metadata/&lt;path&gt;</code></strong> — Version and metadata. Use <code>list</code> to enumerate keys, and <code>read</code>/<code>delete</code> for version metadata and destroying versions.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The following example grants read-only access to all secrets under <code>myapp/</code>, plus full read/write (including create, update, delete) for the single path <code>myapp/database</code>. Replace <code>myapp</code> with your application or team prefix as needed.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-hcl hljs" data-lang="hcl"># Note: KV v2 uses /data/ for values and /metadata/ for metadata

# Read secret values under myapp/
path &#34;secret/data/myapp/*&#34; {
  capabilities = [&#34;read&#34;]
}

# List secret keys under myapp/ (required for listing, e.g. bao kv list secret/myapp)
path &#34;secret/metadata/myapp/*&#34; {
  capabilities = [&#34;list&#34;]
}

# Full access to a specific secret (create, read, update, delete)
path &#34;secret/data/myapp/database&#34; {
  capabilities = [&#34;create&#34;, &#34;read&#34;, &#34;update&#34;, &#34;delete&#34;]
}

# Read and delete version metadata for this secret (e.g. destroy version)
path &#34;secret/metadata/myapp/database&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;, &#34;delete&#34;]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>After writing the policy to OpenBao (e.g. <code>bao policy write myapp-kv policy.hcl</code>), attach it to the appropriate auth method role or token so that clients receive a token with this policy. For token renewal, ensure the role or token also has <code>update</code> on <code>auth/token/renew-self</code> if you use renewable tokens.</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<a href="/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/">Part 7</a> of this series (Authentication Methods) explains the authentication methods and policies in more detail.
</td>
</tr>
</tbody></table>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This part focused on the <strong>KV</strong> secrets engine: enabling a mount, storing and reading secrets, version lifecycle (list, soft delete, destroy), custom metadata, and <strong>policies</strong> that distinguish KV v2’s <code>data/</code> and <code>metadata/</code> paths.</p>
</div>
<div class="paragraph">
<p>Key takeaways:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Prefer <strong>KV v2</strong> when you need <strong>versioning</strong>, <strong>check-and-set</strong>, <strong>soft delete</strong>, and richer <strong>metadata</strong>; use KV v1 only when you explicitly want the simpler, lower-overhead path.</p>
</li>
<li>
<p>Grant <strong><code>secret/data/…​</code></strong> for secret values and <strong><code>secret/metadata/…​</code></strong> for listing and version operations—policies must match how the CLI and API resolve KV v2 paths.</p>
</li>
<li>
<p>Attach policies to <strong>tokens or auth roles</strong> (for example Kubernetes auth) so applications receive <strong>least-privilege</strong> access; include <strong><code>auth/token/renew-self</code></strong> if tokens should be renewable.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The <strong>PKI</strong> secrets engine and integration with <strong>cert-manager</strong> are covered in the next article in this series.</p>
</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/secrets/kv/kv-v2" rel="noopener" target="_blank">KV Secrets Engine v2</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item><item><title>The Guide to OpenBao - Authentication Methods - Part 7</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-03-09-openbao-part-7-authentication-methods/</guid><pubDate>Mon, 09 Mar 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><description>Configuring authentication methods in OpenBao including Kubernetes auth, OIDC, LDAP, and AppRole for secure access control</description><content:encoded><![CDATA[<div class="paragraph">
<p>With OpenBao deployed and running, the next critical step is configuring authentication. Ultimately, you want to limit access to only authorised people. This article covers two common authentication methods: Kubernetes for pods and LDAP for enterprise directories (in a simplified example). There are many more methods, but we cannot cover them all in this article.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Authentication in OpenBao verifies the identity of clients before granting access to secrets. OpenBao supports multiple authentication methods, each suited for different use cases. Among others it supports:</p>
</div>
<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">Best For</th>
<th class="tableblock halign-left valign-top">Key Features</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Pods running in K8s/OpenShift</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Service account tokens, automatic</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">OIDC</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Human users, SSO</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenShift OAuth, Keycloak, Azure AD</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">LDAP</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Enterprise directories</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Active Directory, OpenLDAP</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">AppRole</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">CI/CD, automation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Role ID + Secret ID</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Token</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Direct access, bootstrap</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Simple but less secure</p></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">
The full documentation of the authentication methods and the list of available methods (for example Radius) can be found here: <a href="https://openbao.org/docs/auth/" rel="noopener" target="_blank">OpenBao Authentication Methods</a>.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_authentication_workflow">Authentication Workflow</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The authentication workflow in OpenBao from a user perspective is as follows:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>A client wants to authenticate to OpenBao and provides credentials.</p>
</li>
<li>
<p>OpenBao validates the credentials against the authentication method. For example: LDAP</p>
</li>
<li>
<p>If the authentication method (e.g. LDAP) is successful, it will return the required information about the client.</p>
</li>
<li>
<p>OpenBao maps this result to policies that are mapped to the authentication method.</p>
</li>
<li>
<p>OpenBao generates a token that is associated with the policies and returns it to the client.</p>
</li>
<li>
<p>The client can then use this token for further operations.</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites_for_authentication_methods">Prerequisites for Authentication Methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before configuring authentication:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenBao is deployed and unsealed (Parts 2-6)</p>
</li>
<li>
<p>You have admin access to OpenBao (root token)</p>
</li>
<li>
<p>Access to the required authentication backend:</p>
<div class="ulist">
<ul>
<li>
<p>For Kubernetes auth: Access to the OpenShift cluster</p>
</li>
<li>
<p>For LDAP: Access to the LDAP server</p>
</li>
<li>
<p>etc.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>Set up your environment:</p>
</div>
<div class="paragraph">
<p>You can set up your environment by using either the <strong>CLI</strong> or the <strong>UI</strong>.</p>
</div>
<div class="sect2">
<h3 id="_using_the_cli">Using the CLI</h3>
<div class="paragraph">
<p>You can use the CLI to interact with OpenBao. In this example we will forward the port locally to the OpenBao server and set the environment variable <code>BAO_ADDR</code> to the local address. With <strong>boa login</strong> and the root token you can authenticate against OpenBao with full access.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Port forward (if needed)
oc port-forward svc/openbao 8200:8200 -n openbao &amp;

# Set environment
export BAO_ADDR=&#39;http://127.0.0.1:8200&#39;
# You may need the SSL CA too.
# export BAO_CACERT=&#34;$PWD/openbao-ca.crt&#34;

# Login with root token
bao login

# List all authentication methods
bao auth list</code></pre>
</div>
</div>
<div class="paragraph">
<p>The last command returns a list of the available authentication methods. Currently there is only one authentication method enabled: <strong>token</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">Path     Type     Accessor                 Description                      Version
----     ----     --------                 -----------                      -------
token/   token    auth_token_1020fa7b      token based credentials          n/a</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_using_the_ui">Using the UI</h3>
<div class="paragraph">
<p>The UI, if enabled, is accessible via the OpenShift Route (if running on OpenShift and if it was created in <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a>). The password/token is the <strong>root token</strong> from the initialisation.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part7_openbao_ui_login_form.png" alt="OpenBao UI Login Form"/>
</div>
<div class="title">Figure 1. OpenBao UI Login Form</div>
</div>
<div class="paragraph">
<p>The UI has the advantage that it offers more visibility into the configuration and possibilities.
For example, at the beginning there is one authentication method <strong>token</strong> enabled. This is required for the root token authentication.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part7_openbao_ui_authentication_methods.png?width=840px" alt="OpenBao UI Authentication Methods"/>
</div>
<div class="title">Figure 2. OpenBao UI Authentication Methods</div>
</div>
<div class="paragraph">
<p>We can enable the other authentication methods by clicking on the <strong>Enable new method</strong> link to see what options are available.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part7_openbao_ui_configuring_new_authentication_methods.png" alt="OpenBao UI Configuring New Authentication Method"/>
</div>
<div class="title">Figure 3. OpenBao UI Configuring New Authentication Method</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_understanding_policies">Understanding Policies</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Before you can actually use an authentication method, it is important to understand what <strong>policies</strong> do. A policy is a way to declaratively define what (which paths) authenticated users can access or not. All paths are <strong>denied by default</strong>. A policy is mapped to an authentication method. For example, when we look at LDAP, we could configure something like this:</p>
</div>
<div class="paragraph">
<p><em>Every member of group &#34;dev&#34; is mapped to a policy named &#34;dev-policy&#34;. The policy then allows the user to read the secrets under the path &#34;secret/data/dev/*&#34;.</em></p>
</div>
<div class="sect2">
<h3 id="_basic_policy_structure">Basic Policy Structure</h3>
<div class="paragraph">
<p>A policy is a set of <strong>path rules</strong>. Each rule says: “for this path (or path prefix), the bearer of this policy may use these <strong>capabilities</strong>.” Paths are tied to OpenBao’s internal API: for example, secrets in the KV v2 engine live under <code>secret/data/&lt;mount-path&gt;/&lt;key&gt;</code>, so a path like <code>secret/data/myapp/*</code> means “any key under the <code>myapp</code> prefix in the KV v2 store mounted at <code>secret/</code>.”</p>
</div>
<div class="paragraph">
<p>The example below does two things that are typical for an application policy:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Secrets access:</strong> It allows <strong>read</strong> and <strong>list</strong> on <code>secret/data/myapp/*</code>.</p>
<div class="ulist">
<ul>
<li>
<p><strong>read</strong> lets the client fetch the value of a secret at a path (e.g. <code>secret/data/myapp/database</code>).</p>
</li>
<li>
<p><strong>list</strong> is required to list keys under a path (e.g. to discover <code>myapp/database</code>, <code>myapp/api-key</code>); without it, the client would need to know every path in advance.</p>
</li>
</ul>
</div>
</li>
<li>
<p><strong>Token renewal:</strong> It allows <strong>update</strong> on <code>auth/token/renew-self</code>. Tokens often have a limited lifetime; this path lets the holder extend their own token without needing the root token or extra permissions. Including it avoids applications losing access when the token expires.</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">
Policies can be written in JSON or HCL.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-hcl hljs" data-lang="hcl"># Example policy: myapp-read-policy.hcl
# Allow reading secrets from specific path (KV v2 engine at mount &#34;secret/&#34;)
path &#34;secret/data/myapp/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}

# Allow renewing own token so the app can extend its token before expiry
path &#34;auth/token/renew-self&#34; {
  capabilities = [&#34;update&#34;]
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The path <code>secret/data/myapp/*</code> assumes you have a KV v2 secrets engine mounted at <code>secret/</code> and will store application secrets under keys like <code>myapp/database</code>, <code>myapp/api-key</code>, etc. Adjust the mount path and prefix to match your setup.</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 use of globs (*) may result in surprising or unexpected behaviour. Use them with caution.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_policy_capabilities">Policy Capabilities</h3>
<div class="paragraph">
<p>Each path defined in a policy must have at least one capability. This provides control over the allowed or denied operations a user may perform. There are several capabilities available:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>create</code> - Create new data at the given path</p>
</li>
<li>
<p><code>read</code> - Read data</p>
</li>
<li>
<p><code>update</code> - Update existing data</p>
</li>
<li>
<p><code>patch</code> - Patch existing data (Partial update)</p>
</li>
<li>
<p><code>delete</code> - Delete data</p>
</li>
<li>
<p><code>list</code> - List keys at a path</p>
</li>
<li>
<p><code>scan</code> - Scan or browse the path for keys</p>
</li>
<li>
<p><code>sudo</code> - Allows access to paths that are <strong>root-protected</strong>.</p>
</li>
<li>
<p><code>deny</code> - Explicitly deny (overrides other grants)</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_default_policies">Default Policies</h3>
<div class="paragraph">
<p>When OpenBao is deployed the first time, there are no additional authentication methods enabled, except for <strong>token</strong>. This is required for the root access itself. To allow the administrator to access using the root token, there is one default policy called <strong>root</strong>. This policy is somewhat of a catch-all policy; it allows the administrator to access everything.</p>
</div>
<div class="paragraph">
<p>In addition to the root policy, there is one other default policy called <strong>default</strong>. This policy is used for all authenticated users. It allows them, for example, to look up their own properties and to renew or revoke their own token.</p>
</div>
<div class="paragraph">
<p>Let’s look at the default policies in the CLI:</p>
</div>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
A quick reminder of how to log in to OpenBao using the CLI when running it against Kubernetes: first open a port-forward, set the variable <code>BAO_ADDR</code> to the local address; if you use HTTPS you may need to set the SSL CA certificate, then log in with the root token.
</td>
</tr>
</tbody></table>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>You need to have the CA certificate in the current directory, which you might fetch with:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d &gt; openbao-ca.crt</code></pre>
</div>
</div>
</li>
<li>
<p>Port forward, set the environment variables and login with the root token:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Port forward (if needed)
oc port-forward svc/openbao 8200:8200 -n openbao &amp;

# Set environment
export BAO_ADDR=&#39;https://127.0.0.1:8200&#39;

# You may need the SSL CA too.
export BAO_CACERT=&#34;$PWD/openbao-ca.crt&#34;

# Login with root token
bao login</code></pre>
</div>
</div>
</li>
<li>
<p>Now to list and fetch the current policies you can use the following commands:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># List policies
bao policy list
# Returns something like this:
#default
#root

# Read a policy
bao policy read default</code></pre>
</div>
</div>
</li>
<li>
<p>The second command returns the policy content:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Allow tokens to look up their own properties
path &#34;auth/token/lookup-self&#34; {
    capabilities = [&#34;read&#34;]
}

# Allow tokens to renew themselves
path &#34;auth/token/renew-self&#34; {
    capabilities = [&#34;update&#34;]
}

# Allow tokens to revoke themselves
path &#34;auth/token/revoke-self&#34; {
    capabilities = [&#34;update&#34;]
}

# Allow a token to look up its own capabilities on a path
path &#34;sys/capabilities-self&#34; {

[...]</code></pre>
</div>
</div>
</li>
</ol>
</div>
<div class="paragraph">
<p>Again you will see the same policies in the UI. You can also manage them or create new ones using the UI.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/openshift-platform/security/secrets-management/openbao/images/part7_openbao_ui_list_policies.png" alt="OpenBao UI List Policies"/>
</div>
<div class="title">Figure 4. OpenBao UI Listing Policies</div>
</div>
</div>
<div class="sect2">
<h3 id="_creating_policies_using_the_cli">Creating Policies using the CLI</h3>
<div class="paragraph">
<p>Creating a policy, for example using the CLI, is straightforward. You can create a policy from a file or inline. The syntax is either JSON or HCL.
The example below creates a policy called &#34;myapp-read&#34; from a file called &#34;myapp-read-policy.hcl&#34;. The policy allows reading and listing secrets under the path &#34;secret/data/myapp/*&#34;.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Create a policy from file
bao policy write myapp-read myapp-read-policy.hcl

# Or inline
bao policy write myapp-read - &lt;&lt;EOF
path &#34;secret/data/myapp/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}
EOF

# List policies
bao policy list

# Read a policy
bao policy read myapp-read</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_kubernetes_authentication_method">Kubernetes Authentication Method</h2>
<div class="sectionbody">
<div class="paragraph">
<p>As we work a lot with OpenShift/Kubernetes, this method of authentication will be the first to try.
The Kubernetes auth method can be used to authenticate against OpenBao using Kubernetes Service Account tokens.
It is essential for pods to access secrets.</p>
</div>
<div class="paragraph">
<p>Let us try a simple example.</p>
</div>
<div class="sect2">
<h3 id="_step_1_enable_kubernetes_auth">Step 1: Enable Kubernetes Auth</h3>
<div class="paragraph">
<p>Assuming you are still logged into OpenBao, you can enable the kubernetes auth method with the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao auth enable --description=&#34;Authentication method for Kubernetes/OpenShift cluster&#34; kubernetes</code></pre>
</div>
</div>
<div class="paragraph">
<p>This simply enabled the authentication method and set a description. However, we need to configure it further.</p>
</div>
</div>
<div class="sect2">
<h3 id="_step_2_configure_kubernetes_auth">Step 2: Configure Kubernetes Auth</h3>
<div class="paragraph">
<p>To configure the kubernetes auth method, you need to get the Kubernetes API server address. You can get it with the following command (assuming you are logged into the OpenShift 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">
The command <code>oc</code> can be replaced by <code>kubectl</code> if you are not using an OpenShift cluster.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Get the Kubernetes API server address
KUBERNETES_HOST=$(oc whoami --show-server) <i class="conum" data-value="1"></i><b>(1)</b>

# Configure the auth method
bao write auth/kubernetes/config \ <i class="conum" data-value="2"></i><b>(2)</b>
  kubernetes_host=&#34;$KUBERNETES_HOST&#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>Get the Kubernetes API server address. This will use something like <a class="bare" href="https://api.cluster.example.com:6443">https://api.cluster.example.com:6443</a></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Configure the auth method with the Kubernetes API server address.</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">
When running inside Kubernetes, OpenBao automatically uses the pod’s service account to communicate with the Kubernetes API.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_step_3_create_a_policy_for_the_application">Step 3: Create a Policy for the Application</h3>
<div class="paragraph">
<p>Now we need to associate a policy to the authentication method. We could also assign the default policy but we want to provide access to the path <strong>secret/data/expense/database</strong> and <strong>secret/metadata/expense/config</strong> for the application.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Create policy for an example application
bao policy write expense-app - &lt;&lt;EOF
# Read database credentials
path &#34;secret/data/expense/database&#34; {
  capabilities = [&#34;read&#34;]
}

# Read application config
path &#34;secret/data/expense/config&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}

# Allow token renewal
path &#34;auth/token/renew-self&#34; {
  capabilities = [&#34;update&#34;]
}
EOF</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_4_create_a_kubernetes_auth_role">Step 4: Create a Kubernetes Auth Role</h3>
<div class="paragraph">
<p>As the next step we map the policy to the authentication method. We will further limit the access to the namespace <strong>expense</strong> and the service account <strong>expense-app</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Create a role that maps Kubernetes service accounts to OpenBao policies
bao write auth/kubernetes/role/expense-app \
  bound_service_account_names=expense-app \ <i class="conum" data-value="1"></i><b>(1)</b>
  bound_service_account_namespaces=expense \ <i class="conum" data-value="2"></i><b>(2)</b>
  policies=expense-app \ <i class="conum" data-value="3"></i><b>(3)</b>
  ttl=1h \ <i class="conum" data-value="4"></i><b>(4)</b>
  max_ttl=24h <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><code>bound_service_account_names</code>: K8s service account name(s)</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td><code>bound_service_account_namespaces</code>: K8s namespace(s)</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>policies</code>: OpenBao policies to attach</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td><code>ttl</code>: Token time-to-live</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td><code>max_ttl</code>: Maximum token lifetime</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">
All of the configuration above, created using the CLI, can also be done using the UI of OpenBao.
</td>
</tr>
</tbody></table>
</div>
<div class="sect3">
<h4 id="_ensure_the_kv_v2_secrets_engine_is_mounted_at_secret">Ensure the KV v2 secrets engine is mounted at <code>secret/</code></h4>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
We will discuss secret engines in more detail in the next part of the guide.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>The policy and demo commands in this guide use the path <code>secret/data/expense/database</code>, which assumes a KV v2 secrets engine mounted at <code>secret/</code>. To check and enable it:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><strong>Check existing mounts:</strong> List enabled secrets engines and look for <code>secret/</code> with type <code>kv</code> (version 2):</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># List all secrets engine mounts (requires a token with read on sys/mounts)
bao secrets list</code></pre>
</div>
</div>
<div class="paragraph">
<p>Look for an entry like <code>secret/</code> with type <code>kv</code> or <code>kv-v2</code>. If you see <code>secret/</code> and it is KV v2, you can skip to Step 5.</p>
</div>
</li>
<li>
<p><strong>Enable KV v2 at <code>secret/</code> if missing:</strong> If <code>secret/</code> is not listed, or you want to use a fresh mount, enable the KV v2 engine at the path <code>secret</code>:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Enable KV v2 secrets engine at path &#34;secret&#34; (requires root or policy with sys/mounts capability)
bao secrets enable -path=secret -version=2 kv</code></pre>
</div>
</div>
<div class="paragraph">
<p>If <code>secret/</code> already exists as KV v1, you cannot change it in place to v2; use a different path (e.g. <code>secretv2/</code>) and update the policy and demo paths accordingly (<code>secretv2/data/expense/database</code>, etc.).</p>
</div>
</li>
</ol>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_5_store_the_database_secret_in_openbao_one_time">Step 5: Store the database secret in OpenBao (one-time)</h3>
<div class="paragraph">
<p>Before the application can read it, store the database password (and any other keys) at the path the policy allows. Run this once from a machine that has OpenBao access (e.g. <code>bao</code> CLI and a token).</p>
</div>
<div class="admonitionblock important">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
You must use a token that has <strong>create</strong> and <strong>update</strong> capability on the KV path. The <code>expense-app</code> policy is read-only (for the application). Use the <strong>root token</strong> from OpenBao initialisation, or log in with <code>bao login</code> and use a token that has a policy granting <code>create</code> and <code>update</code> on <code>secret/data/expense/*</code>. If you use a read-only token (e.g. one that only has the expense-app policy), you will get a 403 &#34;preflight capability check returned 403&#34;.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Store the database secret at secret/data/expense/database (KV v2 path)
bao kv put secret/expense/database password=&#34;my-super-secret-db-password&#34; username=&#34;expense_db_user&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>This creates (or overwrites) the secret at <code>secret/data/expense/database</code>. The policy grants the <code>expense-app</code> role <strong>read</strong> on this path only; the application cannot create or update it.</p>
</div>
</div>
<div class="sect2">
<h3 id="_step_6_create_the_expense_namespace_and_demo_application">Step 6: Create the expense namespace and demo application</h3>
<div class="paragraph">
<p>Apply the following manifests to create the namespace, service account, optional long-lived token (Kubernetes 1.24+), and a demo deployment that authenticates to OpenBao and fetches the database secret. Adjust the OpenBao URL if your OpenBao is in another namespace or uses HTTPS (e.g. <code><a class="bare" href="https://openbao.openbao.svc:8200">https://openbao.openbao.svc:8200</a></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">
Remember: We have created a policy that allows the service account with the name <strong>expense-app</strong> in the namespace <strong>expense</strong> to read the secret at <strong>secret/data/expense/database</strong>. If you want to use different paths or namespaces, you need to adjust the policy accordingly.
</td>
</tr>
</tbody></table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"># full-demo-expense-app.yaml
# 1. Namespace
apiVersion: v1
kind: Namespace <i class="conum" data-value="1"></i><b>(1)</b>
metadata:
  name: expense
---
# 2. Service account used by the demo app to authenticate to OpenBao
apiVersion: v1
kind: ServiceAccount <i class="conum" data-value="2"></i><b>(2)</b>
metadata:
  name: expense-app
  namespace: expense
---
# 3. Long-lived token for Kubernetes 1.24+ (optional; allows pods to use the SA token)
apiVersion: v1
kind: Secret <i class="conum" data-value="3"></i><b>(3)</b>
metadata:
  name: expense-app-token
  namespace: expense
  annotations:
    kubernetes.io/service-account.name: expense-app
type: kubernetes.io/service-account-token
---
# 4. Demo deployment: authenticates to OpenBao and fetches secret/data/expense/database
apiVersion: apps/v1
kind: Deployment
metadata:
  name: expense-demo
  namespace: expense
  labels:
    app: expense-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: expense-demo
  template:
    metadata:
      labels:
        app: expense-demo
    spec:
      serviceAccountName: expense-app
      containers:
        - name: demo
          image: registry.access.redhat.com/ubi9/ubi-minimal:latest
          command:
            - /bin/sh
            - -c
            - |
              echo &#34;=== Installing curl ===&#34;
              microdnf install -y curl 2&gt;/dev/null || true
              echo &#34;=== Fetching database secret from OpenBao ===&#34;

              JWT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)

              OPENBAO_URL=&#34;${OPENBAO_URL:-http://openbao.openbao:8200}&#34;

              RESP=$(curl -s -k -X POST -H &#34;Content-Type: application/json&#34; \ <i class="conum" data-value="4"></i><b>(4)</b>
                -d &#34;{\&#34;jwt\&#34;: \&#34;$JWT\&#34;, \&#34;role\&#34;: \&#34;expense-app\&#34;}&#34; \
                &#34;$OPENBAO_URL/v1/auth/kubernetes/login&#34;)

              TOKEN=$(echo &#34;$RESP&#34; | sed -n &#39;s/.*&#34;client_token&#34;:&#34;\([^&#34;]*\)&#34;.*/\1/p&#39;)
              if [ -z &#34;$TOKEN&#34; ]; then
                echo &#34;ERROR: Failed to get OpenBao token. Check OpenBao URL ($OPENBAO_URL), role expense-app, and network.&#34;
                echo &#34;Response: $RESP&#34;
                exit 1
              fi

              echo &#34;OpenBao token obtained. Reading secret/data/expense/database ...&#34;
              SECRET=$(curl -s -k -H &#34;X-Vault-Token: $TOKEN&#34; &#34;$OPENBAO_URL/v1/secret/data/expense/database&#34;) <i class="conum" data-value="5"></i><b>(5)</b>
              echo &#34;$SECRET&#34;

              PASSWORD=$(echo &#34;$SECRET&#34; | sed -n &#39;s/.*&#34;password&#34;:&#34;\([^&#34;]*\)&#34;.*/\1/p&#39;)
              echo &#34;Database password (data.data.password): ${PASSWORD:-&lt;not set&gt;}&#34;
              echo &#34;=== Demo complete. Pod stays running; exec in to run more curl commands. ===&#34;
              exec sleep infinity
          env:
            # Override if OpenBao is in another namespace or uses HTTPS
            - name: OPENBAO_URL
              value: &#34;https://openbao.openbao:8200&#34;
          resources:
            requests:
              memory: &#34;64Mi&#34;
              cpu: &#34;10m&#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>Create the namespace</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Create the service account</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Create the secret (long-lived token for Kubernetes 1.24+)</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Authenticate to OpenBao and get a client token (using the Kubernetes JWT)</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>Fetch the database secret</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">
The examples above use <strong>curl -k</strong> to bypass certificate verification. For production, you should adjust this and mount the CA certificate in the pod (see the note earlier in this section on using the <code>openbao-ca</code> Secret).
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Apply the manifests and wait for the pod to be ready:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc apply -f full-demo-expense-app.yaml

# Wait for the demo pod to be running
oc -n expense rollout status deployment/expense-demo

# View the log: you should see the OpenBao token response and the fetched secret (including the password)
oc -n expense logs -l app=expense-demo -f</code></pre>
</div>
</div>
<div class="paragraph">
<p>The log output shows the application authenticating with the Kubernetes JWT, receiving an OpenBao token, and reading the secret at <code>secret/data/expense/database</code>. The field <code>data.data.password</code> is the database password you stored in Step 5.</p>
</div>
</div>
<div class="sect2">
<h3 id="_step_7_test_kubernetes_authentication_manually">Step 7: Test Kubernetes authentication manually</h3>
<div class="paragraph">
<p>From any pod that uses the same service account (e.g. the demo pod above), you can run the same steps by hand:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># From within a pod using the service account (e.g. oc exec -it deployment/expense-demo -n expense -- /bin/sh)
JWT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)

# 1. Authenticate to OpenBao and get a client token (sed works on UBI minimal; use jq -r .auth.client_token if jq is available)
LOGIN=$(curl -s -k --request POST \
  --data &#34;{\&#34;jwt\&#34;: \&#34;$JWT\&#34;, \&#34;role\&#34;: \&#34;expense-app\&#34;}&#34; \
  https://openbao.openbao:8200/v1/auth/kubernetes/login)
TOKEN=$(echo &#34;$LOGIN&#34; | sed -n &#39;s/.*&#34;client_token&#34;:&#34;\([^&#34;]*\)&#34;.*/\1/p&#39;)

# 2. Fetch the database secret (same path the policy allows)
curl -s -k -H &#34;X-Vault-Token: $TOKEN&#34; https://openbao.openbao:8200/v1/secret/data/expense/database</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_summary_kubernetes_auth_method">Summary: Kubernetes auth method</h3>
<div class="paragraph">
<p>A lot of steps were involved to configure the Kubernetes auth method. Let us summarize them:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>In OpenBao:</strong> Enabled the Kubernetes auth method, configured it with the cluster API server address, created the <code>expense-app</code> policy (read on <code>secret/data/expense/database</code> and <code>secret/data/expense/config</code>, update on <code>auth/token/renew-self</code>), and created the <code>expense-app</code> role that binds the Kubernetes service account <code>expense-app</code> in namespace <code>expense</code> to that policy.</p>
</li>
<li>
<p><strong>Secrets engine:</strong> Ensured the KV v2 engine is mounted at <code>secret/</code> and stored the database secret at <code>secret/expense/database</code> (one-time, using the root token).</p>
</li>
<li>
<p><strong>In the cluster:</strong> Created the <code>expense</code> namespace, the <code>expense-app</code> service account, an optional long-lived token Secret (for Kubernetes 1.24+), and the <code>expense-demo</code> deployment that uses that service account to authenticate to OpenBao and fetch the secret. For HTTPS, created the <code>openbao-ca</code> Secret in <code>expense</code> with the OpenBao server CA.</p>
</li>
<li>
<p><strong>Verification:</strong> Applied the manifests, confirmed the demo pod starts and logs show a successful login and the fetched secret (including the database password). Optionally ran the same login and read steps manually via <code>oc exec</code> into the pod.</p>
</li>
</ul>
</div>
<hr/>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_ldap_authentication_method">LDAP Authentication Method</h2>
<div class="sectionbody">
<div class="paragraph">
<p>LDAP auth integrates with enterprise directories like Active Directory.</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 is a very simplified example. As a prerequisite you need to have an LDAP server and a service account with the necessary permissions to read the users and groups. This is not part of this guide.
</td>
</tr>
</tbody></table>
</div>
<div class="sect2">
<h3 id="_step_1_enable_ldap_auth">Step 1: Enable LDAP Auth</h3>
<div class="paragraph">
<p>To enable LDAP authentication, you need to use the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao auth enable ldap</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_2_configure_ldap_active_directory_example">Step 2: Configure LDAP (Active Directory Example)</h3>
<div class="paragraph">
<p>In this step you need to configure the LDAP server address, the user and group attributes, the bind DN and the bind password.
The example below configures the LDAP server address to <strong>ldaps://ad.example.com:636</strong>, the user attribute to <strong>sAMAccountName</strong>, the user DN to <strong>OU=Users,DC=example,DC=com</strong>, the group DN to <strong>OU=Groups,DC=example,DC=com</strong>, the group attribute to <strong>cn</strong>, the group filter to <strong>(&amp;(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))</strong>, the bind DN to <strong>CN=openbao-svc,OU=ServiceAccounts,DC=example,DC=com</strong> and the bind password to <strong>service-account-password</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">bao write auth/ldap/config \
  url=&#34;ldaps://ad.example.com:636&#34; \
  userattr=&#34;sAMAccountName&#34; \
  userdn=&#34;OU=Users,DC=example,DC=com&#34; \
  groupdn=&#34;OU=Groups,DC=example,DC=com&#34; \
  groupattr=&#34;cn&#34; \
  groupfilter=&#34;(&amp;(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))&#34; \
  binddn=&#34;CN=openbao-svc,OU=ServiceAccounts,DC=example,DC=com&#34; \
  bindpass=&#34;service-account-password&#34; \
  certificate=@/path/to/ldap-ca.pem \
  insecure_tls=false \
  starttls=false</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_3_create_the_policies_used_by_the_group_mapping">Step 3: Create the policies used by the group mapping</h3>
<div class="paragraph">
<p>Before mapping LDAP groups to policy names, create those policies. Below are example definitions: <strong>admin-policy</strong> grants read/list/update on secrets (e.g. for operators), and <strong>user-policy</strong> grants read-only access to a limited path.</p>
</div>
<div class="paragraph">
<p><strong>admin-policy</strong> — for members of <strong>openbao-admins</strong> (e.g. operators who may read and update secrets)</p>
</div>
<div class="paragraph">
<p><strong>user-policy</strong> — for members of <strong>openbao-users</strong> (e.g. developers with read-only access to a subset of secrets)</p>
</div>
<div class="paragraph">
<p>Create them with the CLI (run before the group mapping in Step 4):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Create admin-policy (e.g. from file admin-policy.hcl)
bao policy write admin-policy - &lt;&lt;EOF
path &#34;secret/data/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;, &#34;update&#34;, &#34;create&#34;, &#34;delete&#34;]
}
path &#34;secret/metadata/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}
path &#34;auth/token/renew-self&#34; {
  capabilities = [&#34;update&#34;]
}
EOF

# Create user-policy
bao policy write user-policy - &lt;&lt;EOF
path &#34;secret/data/myapp/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}
path &#34;auth/token/renew-self&#34; {
  capabilities = [&#34;update&#34;]
}
EOF</code></pre>
</div>
</div>
<div class="paragraph">
<p>Adjust paths (e.g. <code>secret/data/myapp/</code>) to match your KV v2 mount and the paths you want each role to access. The <strong>default</strong> policy is built-in and grants token lookup/renew/revoke-self. Attaching it in addition to <strong>admin-policy</strong> or <strong>user-policy</strong> is a typical pattern.</p>
</div>
</div>
<div class="sect2">
<h3 id="_step_4_map_ldap_groups_to_policies">Step 4: Map LDAP groups to policies</h3>
<div class="paragraph">
<p>Now map the LDAP groups to the policy names. The example below maps the LDAP group <strong>openbao-admins</strong> to the policies <strong>admin-policy</strong> and <strong>default</strong> and the LDAP group <strong>openbao-users</strong> to the policies <strong>user-policy</strong> and <strong>default</strong>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Map an LDAP group to policies
bao write auth/ldap/groups/openbao-admins \
  policies=&#34;admin-policy,default&#34;

bao write auth/ldap/groups/openbao-users \
  policies=&#34;user-policy,default&#34;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_step_5_test_ldap_authentication">Step 5: Test LDAP authentication</h3>
<div class="paragraph">
<p>Assuming you have a user <strong>jdoe</strong> in the LDAP group <strong>openbao-users</strong>, you can test the LDAP authentication with the following commands:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Login with LDAP credentials
bao login -method=ldap username=jdoe

# Or via API
curl --request POST \
  --data &#39;{&#34;password&#34;: &#34;user-password&#34;}&#39; \
  $BAO_ADDR/v1/auth/ldap/login/jdoe</code></pre>
</div>
</div>
<div class="sect3">
<h4 id="_what_jdoe_can_and_cannot_do_user_policy">What jdoe can and cannot do (user-policy)</h4>
<div class="paragraph">
<p>jdoe holds <strong>user-policy</strong> (and <strong>default</strong>), so their token has only the capabilities defined there.</p>
</div>
<div class="paragraph">
<p>What jdoe can do:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Get a secret under <code>secret/data/myapp/*</code>: after logging in, jdoe can read and list secrets in that path. For example:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># After bao login -method=ldap username=jdoe (and entering the password)
bao kv get secret/myapp/database
# Or via API (use the client_token from the login response)
curl -s -H &#34;X-Vault-Token: $TOKEN&#34; $BAO_ADDR/v1/secret/data/myapp/database</code></pre>
</div>
</div>
</li>
<li>
<p>List keys under <code>secret/data/myapp/</code> to discover available secrets.</p>
</li>
<li>
<p>Renew or revoke their own token (from the <strong>default</strong> policy) and look up their own token properties.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>What jdoe cannot do:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Read secrets outside <code>myapp</code> — e.g. <code>secret/data/expense/database</code> or <code>secret/data/other-app/*</code> returns permission denied.</p>
</li>
<li>
<p>Create, update, or delete any secret — <strong>user-policy</strong> grants only <code>read</code> and <code>list</code> on <code>secret/data/myapp/*</code>, so write operations are denied.</p>
</li>
<li>
<p>Access admin or system paths — no access to <code>sys/<strong></strong></code><strong>, other auth methods, or policies. Only the paths explicitly granted in *user-policy</strong> and <strong>default</strong> are allowed.</p>
</li>
</ul>
</div>
<hr/>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_common_practices_for_authentication">Common Practices for Authentication</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>Use the principle of least privilege</strong> - Do not grant more permissions than necessary.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-hcl hljs" data-lang="hcl"># Bad: Too broad
path &#34;secret/*&#34; {
  capabilities = [&#34;read&#34;, &#34;list&#34;]
}

# Good: Specific paths
path &#34;secret/data/myapp/database&#34; {
  capabilities = [&#34;read&#34;]
}</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Set Appropriate Token TTLs</strong> - Set the appropriate TTLs for different use cases.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Short-lived for automated systems
bao write auth/kubernetes/role/batch-job \
  ttl=5m \
  max_ttl=15m

# Longer for interactive users
bao write auth/oidc/role/human-user \
  ttl=8h \
  max_ttl=24h</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Enable Audit Logging</strong> - Enable audit logging to track authentication attempts and other activities.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Enable file audit
bao audit enable file file_path=/var/log/openbao/audit.log

# All authentication attempts are logged</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Regularly Rotate Credentials</strong> - Rotate the credentials periodically to reduce the risk of compromise.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Rotate AppRole Secret IDs periodically
bao write -f auth/approle/role/cicd-role/secret-id

# Revoke old tokens
bao token revoke &lt;old-token&gt;</code></pre>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_common_authentication_patterns">Common Authentication Patterns</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>Pattern 1: Application Pods</strong></p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">Pod → Service Account Token → Kubernetes Auth → Policy → Secret</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Pattern 2: Human Users</strong></p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">User → LDAP/OIDC Login → Group Mapping → Policy → Secret</code></pre>
</div>
</div>
</li>
<li>
<p><strong>Pattern 3: CI/CD Pipeline</strong></p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">Pipeline → AppRole (Role ID + Secret ID) → Policy → Secret</code></pre>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_is_coming_next">What is Coming Next?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In Part 8, we will explore secrets engines, like:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>KV (Key-Value) for static secrets</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In upcoming parts, I will try to cover common practices for OpenBao operation and maintenance. If there is time and an opportunity to test other authentication methods, I will do so.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_conclusion">Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Proper authentication configuration is crucial for OpenBao security. Key takeaways:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Use <strong>Kubernetes auth</strong> for pods</p>
</li>
<li>
<p>Use <strong>LDAP/OIDC</strong> for human users (SSO)</p>
</li>
<li>
<p>Use <strong>AppRole</strong> for automation</p>
</li>
<li>
<p>Create <strong>specific policies</strong> with least privilege</p>
</li>
<li>
<p>Set <strong>appropriate TTLs</strong> for different use cases</p>
</li>
<li>
<p><strong>Enable audit logging</strong> for compliance</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="https://openbao.org/docs/auth/kubernetes" rel="noopener" target="_blank">Kubernetes Auth Method</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/auth/jwt" rel="noopener" target="_blank">JWT/OIDC Auth Method</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/auth/ldap" rel="noopener" target="_blank">LDAP Auth Method</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/auth/approle" rel="noopener" target="_blank">AppRole Auth Method</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/concepts/policies" rel="noopener" target="_blank">Policies Documentation</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>Onboarding to Ansible Automation Platform with Configuration as Code</title><link>https://blog.stderr.at/ansible/2026/03/onboarding-to-ansible-automation-platform-with-configuration-as-code/</link><guid isPermaLink="true">https://blog.stderr.at/ansible/2026/03/onboarding-to-ansible-automation-platform-with-configuration-as-code/</guid><pubDate>Wed, 04 Mar 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Toni Schmidbauer</dc:creator><category>Ansible</category><description>Onboard application teams to Ansible Automation Platform with Configuration as Code—from our talk at the 2nd Ansible Anwendertreffen in Austria.</description><content:encoded><![CDATA[<div class="paragraph">
<p>We had the honor of presenting at the 2nd Ansible Anwendertreffen in
Austria. The topic was the onboarding of application teams to the
Ansible Automation Platform.</p>
</div>
<div class="paragraph">
<p>We created an extensive demo that:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Onboards a new tenant into an AAP organization.</p>
</li>
<li>
<p>Each tenant gets a configuration as code repository, <a href="https://github.com/tosmi-ansible/template-org-config" rel="noopener" target="_blank">cloned from a template</a>.</p>
</li>
<li>
<p>A push event to the config-as-code repository triggers an update of AAP objects.</p>
</li>
<li>
<p>Provides an <a href="https://github.com/tosmi-ansible/template-example-project" rel="noopener" target="_blank">example repository</a> for each tenant to get started.</p>
</li>
<li>
<p>The example repository provides a <a href="https://github.com/tosmi-ansible/template-org-config/blob/main/playbooks/devenv.yaml" rel="noopener" target="_blank">webhook</a> that creates an OpenShift Virtualization VM for testing code changes when a feature branch is created.</p>
</li>
<li>
<p>Contains a <a href="https://github.com/tosmi-ansible/template-org-config/blob/main/playbooks/cac-diff.yaml" rel="noopener" target="_blank">playbook</a> to display objects that are not currently managed by the tenant’s configuration-as-code repository.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The source code for the demo is available on <a href="https://github.com/tosmi-ansible/aap-onboarding" rel="noopener" target="_blank">GitHub</a>.</p>
</div>
<div class="paragraph">
<p>The <a href="https://github.com/tosmi-ansible/aap-onboarding/blob/main/README.md">README</a> contains more details about the implementation, and the slide deck is also <a href="https://github.com/tosmi-ansible/aap-onboarding/blob/main/docs/Ansible%20Anwender%20Treffen%20202602%20-%20Slides.pdf" rel="noopener" target="_blank">available on GitHub</a>.</p>
</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>The Guide to OpenBao - Enabling TLS on OpenShift - Part 4</title><link>https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls/</link><guid isPermaLink="true">https://blog.stderr.at/openshift-platform/security/secrets-management/openbao/2026-02-17-openbao-part-4-enabling-tls/</guid><pubDate>Tue, 17 Feb 2026 00:00:00 +0100</pubDate><dc:creator>Articles by Thomas Jungbauer</dc:creator><category>OpenShift</category><category>Security</category><description>Enable TLS for OpenBao and the Agent Injector on OpenShift using cert-manager for encryption in transit and production-ready secret management</description><content:encoded><![CDATA[<div class="paragraph">
<p>In <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a> we deployed OpenBao on OpenShift in HA mode with TLS disabled: the OpenShift Route terminates TLS at the edge, and traffic from the Route to the pods is plain HTTP. While this is ok for quick tests, for a production-ready deployment, you should consider TLS for the entire journey. This article explains why and how to enable TLS end-to-end using the cert-manager operator, what to consider, and the exact steps to achieve it.</p>
</div>
<div class="sect1">
<h2 id="_introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Part 3 uses <code>tls_disable = 1</code> in the OpenBao listener and relies on the OpenShift Route for TLS. That gives encryption between the client and the Route, but <strong>not</strong> between the Route and the OpenBao pods or between pods (e.g. Raft). Enabling TLS on OpenBao itself adds encryption in transit everywhere and aligns with defense-in-depth and compliance requirements. After all, we are talking about a secrets management system here and should not compromise security.</p>
</div>
<div class="paragraph">
<p>This part assumes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>OpenBao is already deployed as in <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a> (HA with Raft, Agent Injector enabled).</p>
</li>
<li>
<p>The <strong>cert-manager operator</strong> is installed and configured on your OpenShift 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">
The article <a href="https://your-blog/openshift-platform/security/certificates/ssl-certificate-management/">SSL Certificate Management for OpenShift</a> describes the setup and usage of the cert-manager operator as an example.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_why_enable_tls">Why Enable TLS?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Enabling TLS for OpenBao makes sense for several reasons:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>Encryption in transit</strong>: Traffic between the Route and the pods, and between OpenBao peers (Raft), is encrypted. Secrets and tokens are never sent in plain text on the cluster network.</p>
</li>
<li>
<p><strong>Defense in depth</strong>: Even if the Route or network is misconfigured, backend traffic remains protected.</p>
</li>
<li>
<p><strong>Compliance</strong>: Many standards (e.g. PCI-DSS, SOC 2) require encryption in transit for sensitive data; TLS to the application (OpenBao) helps satisfy this.</p>
</li>
<li>
<p><strong>Agent Injector</strong>: The injector webhook is called by the Kubernetes API server. Using TLS for the webhook (with a valid certificate) is required for production and when running multiple replicas.</p>
</li>
<li>
<p><strong>Consistency</strong>: Using HTTPS everywhere simplifies client configuration and avoids mixing HTTP/HTTPS in the same environment.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_what_must_be_considered">What Must Be Considered?</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><strong>Two TLS contexts</strong>: Each needs its own certificate and configuration.</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>OpenBao server (API and Raft)</p>
</li>
<li>
<p>Agent Injector (mutating webhook)</p>
</li>
</ol>
</div>
</li>
<li>
<p><strong>Certificate SANs</strong>: Server certificates must include <strong>all names</strong> used to reach OpenBao: Route host, internal service names (e.g. openbao.openbao.svc, openbao-0.openbao-internal.openbao.svc), 127.0.0.1 and ::1 for in-pod traffic, and any external DNS you use. The injector certificate must match the injector Service DNS name (e.g. openbao-agent-injector-svc.openbao.svc).</p>
</li>
<li>
<p><strong>cert-manager</strong>: Using cert-manager gives automatic issuance and renewal. You need a ClusterIssuer (or an Issuer) in the OpenBao namespace.</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 this example, we will use a self-signed CA for the OpenBao server and the Agent Injector. In a production environment, you should use a trusted CA.
</td>
</tr>
</tbody></table>
</div>
<div class="ulist">
<ul>
<li>
<p><strong>OpenShift Route</strong>: With backend TLS enabled, you can keep the Route in reencrypt mode: the Route terminates TLS from the client and opens a new TLS connection to the pod. Alternatively, use passthrough if you want end-to-end TLS without re-encryption at the Route.</p>
</li>
<li>
<p><strong>Raft join</strong>: After switching to TLS, retry_join and cluster addresses must use https:// and the correct hostnames. Existing unseal keys and root token are unchanged; only the transport is different.</p>
</li>
<li>
<p><strong>Clients</strong>: CLI and applications must use https:// for BAO_ADDR and, if you use a private CA, BAO_CACERT (or the system trust store) so that the client trusts the server certificate.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>OpenBao HA deployment from <a href="/openshift-platform/security/secrets-management/openbao/2026-02-13-openbao-part-3-openshift-deployment/">Part 3</a> (namespace <code>openbao</code>, Helm release <code>openbao</code>).</p>
</li>
<li>
<p>cert-manager operator installed on OpenShift.</p>
</li>
<li>
<p>Sufficient rights to create Issuers, Certificates, and Secrets in the <code>openbao</code> namespace.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_overview_of_steps">Overview of Steps</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Create a <strong>Certificate Authority (CA)</strong> in the <code>openbao</code> namespace (or use an existing ClusterIssuer).</p>
</li>
<li>
<p>Issue a <strong>Certificate for the OpenBao server</strong> (API + Raft) and store it in a Secret.</p>
</li>
<li>
<p>Issue a <strong>Certificate for the Agent Injector</strong> and reference it in the Helm values.</p>
</li>
<li>
<p>Update <strong>Helm values</strong> to mount the server cert and CA, and configure the listener and Raft for TLS.</p>
</li>
<li>
<p><strong>Upgrade</strong> the Helm release; initialize and unseal openbao-0 (new cluster) or re-unseal (existing).</p>
</li>
<li>
<p><strong>Verify</strong> access via HTTPS and configure clients (<code>BAO_ADDR</code>, <code>BAO_CACERT</code>).</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_1_certificate_authority_ca_for_openbao">Step 1: Certificate Authority (CA) for OpenBao</h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you already have a ClusterIssuer (e.g. Let’s Encrypt or an enterprise CA), you can use it for the server and injector certificates and skip this step. For a self-signed CA in the OpenBao namespace (typical for internal cluster TLS), create the following.</p>
</div>
<div class="admonitionblock warning">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
This self-signed CA is only for testing purposes. In a production environment, you should use a trusted CA, preferably your own.
</td>
</tr>
</tbody></table>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Create a self-signed CA Issuer in the openbao namespace:</p>
<div class="admonitionblock note">
<table>
<tbody><tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
You might have your own CA or a ClusterIssuer already. You can use them, instead of creating a new one.
</td>
</tr>
</tbody></table>
</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: Issuer
metadata:
  name: openbao-selfsigned
  namespace: openbao <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  selfSigned: {} <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 namespace where the OpenBao deployment is running.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The self-signed CA Issuer.</td>
</tr>
</tbody></table>
</div>
</li>
<li>
<p>Create a self-signed CA Certificate in the openbao namespace:</p>
<div class="paragraph">
<p>This will now actually request the CA certificate from the self-signed CA Issuer. This process is fully automated by cert-manager because everything is self-signed. The requested certificate will be stored in the secret openbao-ca-secret and is available immediately.</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: openbao-ca
  namespace: openbao <i class="conum" data-value="1"></i><b>(1)</b>
spec:
  isCA: true <i class="conum" data-value="2"></i><b>(2)</b>
  commonName: OpenBao CA
  secretName: openbao-ca-secret <i class="conum" data-value="3"></i><b>(3)</b>
  duration: 87660h <i class="conum" data-value="4"></i><b>(4)</b>
  privateKey: <i class="conum" data-value="5"></i><b>(5)</b>
    algorithm: ECDSA
    size: 256 <i class="conum" data-value="6"></i><b>(6)</b>
    rotationPolicy: Always <i class="conum" data-value="6"></i><b>(6)</b>
  issuerRef:
    name: openbao-selfsigned <i class="conum" data-value="7"></i><b>(7)</b>
    kind: Issuer <i class="conum" data-value="8"></i><b>(8)</b>
    group: cert-manager.io</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 OpenBao deployment is running.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The certificate is a CA certificate.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The name of the secret where the certificate and key will be stored.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The duration of the certificate. In this case 10 years.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The private key algorithm and size.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The rotation policy of the private key.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The issuer of the certificate.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The kind of the issuer. Can be Issuer or ClusterIssuer.</td>
</tr>
</tbody></table>
</div>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_2_create_an_issuer_for_the_openbao_server_and_agent_injector">Step 2: Create an Issuer for the OpenBao Server and Agent Injector</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Create an Issuer for the OpenBao Server and Agent Injector. This Issuer will reference the CA certificate and key stored in the secret openbao-ca-secret.</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: Issuer
metadata:
  name: openbao-ca-issuer
  namespace: openbao
spec:
  ca:
    secretName: openbao-ca-secret</code></pre>
</div>
</div>
<div class="paragraph">
<p>The name of the secret where the CA certificate and key are stored.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_3_certificate_for_the_openbao_server">Step 3: Certificate for the OpenBao Server</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Now it is time to create the certificate for the OpenBao server. The server certificate must include <strong>every hostname</strong> used to reach OpenBao: the Route host, the headless service, and each Raft member. Adjust the dnsNames and optional uris to match your cluster and Route.</p>
</div>
<div class="paragraph">
<p>Create the following Certificate object:</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: openbao-server-tls
  namespace: openbao
spec:
  secretName: openbao-server-tls <i class="conum" data-value="1"></i><b>(1)</b>
  duration: 8760h <i class="conum" data-value="2"></i><b>(2)</b>
  renewBefore: 720h  <i class="conum" data-value="3"></i><b>(3)</b>
  commonName: openbao.openbao.svc <i class="conum" data-value="4"></i><b>(4)</b>
  dnsNames:
    - openbao.apps.cluster.example.com # Route host (adjust to your domain) <i class="conum" data-value="5"></i><b>(5)</b>
    - openbao <i class="conum" data-value="6"></i><b>(6)</b>
    - 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: <i class="conum" data-value="7"></i><b>(7)</b>
    - 127.0.0.1
    - &#34;::1&#34;
  issuerRef:
    name: openbao-ca-issuer <i class="conum" data-value="8"></i><b>(8)</b>
    kind: Issuer
    group: cert-manager.io</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 secret where the certificate and key will be stored.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The duration of the certificate. In this case 1 year.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The duration before the certificate is renewed. In this case 30 days.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The common name of the certificate. This is the service name of the OpenBao server.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The Route host. Adjust to your domain.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The headless service names, all should be included.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>Required for in-pod traffic: Readiness/liveness probes and local bao commands (e.g. raft join, operator unseal) connect to 127.0.0.1:8200. Without these IP SANs you get &#34;tls: bad certificate&#34; or &#34;x509: cannot validate certificate for 127.0.0.1 because it doesn’t contain any IP SANs&#34;.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The issuer of the certificate, this time openbao-ca-issuer.</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>After a few moments the certificate will be ready and the secret will be created. The cert-manager will store the signed certificate and key in the Secret openbao-server-tls with keys tls.crt and tls.key. The Helm chart can mount this secret for the OpenBao listener.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_4_certificate_for_the_agent_injector">Step 4: Certificate for the Agent Injector</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Agent Injector runs as a webhook; the Kubernetes API server calls it over TLS. The certificate must match the Service DNS name of the injector. Create a Certificate that references the same CA Issuer. In this example we use a short-lived certificate valid for 24 hours, renewed when 10% of the validity period remains.</p>
</div>
<div class="paragraph">
<p>Save as openbao-injector-cert.yaml:</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: injector-certificate
  namespace: openbao
spec:
  secretName: injector-tls <i class="conum" data-value="1"></i><b>(1)</b>
  duration: 24h <i class="conum" data-value="2"></i><b>(2)</b>
  renewBefore: 144m
  commonName: Agent Inject Cert <i class="conum" data-value="3"></i><b>(3)</b>
  dnsNames:
    - openbao-agent-injector-svc <i class="conum" data-value="4"></i><b>(4)</b>
    - openbao-agent-injector-svc.openbao
    - openbao-agent-injector-svc.openbao.svc
    - openbao-agent-injector-svc.openbao.svc.cluster.local
  issuerRef:
    name: openbao-ca-issuer
    kind: Issuer
    group: cert-manager.io</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 secret where the certificate and key will be stored.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The duration of the certificate. In this case 24 hours. (renewal is done 10% before expiry)</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The injector service name.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The injector service name is defined by the Helm chart. If you override the injector service name, adjust dnsNames accordingly.</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_5_helm_values_for_server_tls">Step 5: Helm Values for Server TLS</h2>
<div class="sectionbody">
<div class="paragraph">
<p>With all the certificates created, we can update the Helm values so that OpenBao uses the server certificate and listens with TLS. You need to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Mount the Secret openbao-server-tls into the OpenBao pods.</p>
</li>
<li>
<p>Set the listener to use tls_cert_file and tls_key_file and disable tls_disable.</p>
</li>
<li>
<p>Switch Raft retry_join and cluster addresses to https://.</p>
</li>
<li>
<p>Add the environment variable BAO_CACERT to the OpenBao pods.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Before we start, we need to export the CA certificate from the secret openbao-ca-secret and save its value:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will return the certificate like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----</code></pre>
</div>
</div>
<div class="paragraph">
<p>Save this, you will need it in the next step.</p>
</div>
<div class="paragraph">
<p>Now we need to create the Helm values file. This time we will enable TLS. Refer to Part 3 of this series to see what the initial values file looks like.</p>
</div>
<div class="paragraph">
<p>Create or update openbao-ha-values-tls.yaml (building on your Part 3 values):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">global:
  # Enable OpenShift-specific settings
  openshift: true

  # 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 <i class="conum" data-value="1"></i><b>(1)</b>

server:
  extraEnvironmentVars:
    BAO_CACERT: /openbao/tls/openbao-server-tls/ca.crt <i class="conum" data-value="2"></i><b>(2)</b>

  # 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 <i class="conum" data-value="3"></i><b>(3)</b>
          address = &#34;[::]:8200&#34;
          cluster_address = &#34;[::]:8201&#34;
          tls_cert_file = &#34;/openbao/tls/openbao-server-tls/tls.crt&#34; <i class="conum" data-value="4"></i><b>(4)</b>
          tls_key_file  = &#34;/openbao/tls/openbao-server-tls/tls.key&#34; <i class="conum" data-value="5"></i><b>(5)</b>
          tls_min_version = &#34;tls12&#34; <i class="conum" data-value="6"></i><b>(6)</b>
          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; <i class="conum" data-value="7"></i><b>(7)</b>
            leader_tls_servername = &#34;openbao-0.openbao-internal&#34;
            leader_ca_cert_file = &#34;/openbao/tls/openbao-server-tls/ca.crt&#34; <i class="conum" data-value="8"></i><b>(8)</b>
          }
          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.cluster.example.com
    tls: <i class="conum" data-value="9"></i><b>(9)</b>
      # Route terminates client TLS; backend can use reencrypt or passthrough
      termination: reencrypt
      insecureEdgeTerminationPolicy: Redirect
      destinationCACertificate: | <i class="conum" data-value="10"></i><b>(10)</b>
        -----BEGIN CERTIFICATE-----
        # CA Certificate
        -----END CERTIFICATE-----

  extraVolumes: <i class="conum" data-value="11"></i><b>(11)</b>
    - type: secret
      name: openbao-server-tls
      path: /openbao/tls
      readOnly: true

  extraVolumeMounts: <i class="conum" data-value="12"></i><b>(12)</b>
    - 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: <i class="conum" data-value="13"></i><b>(13)</b>
    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;BASE64_ENCODED_CA_CERTIFICATE&#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><strong>global.tlsDisable</strong>: Set to false when the server listener uses TLS. This makes the chart use HTTPS for readiness/liveness probes and for the in-pod API_ADDR env var. If you leave it true (default), probes and local clients will use HTTP and you will see &#34;client sent an HTTP request to an HTTPS server&#34;.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The environment variable BAO_CACERT is set to the CA certificate file path. This is helpful to execute the boa command inside the container.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>The listener tls_disable is set to 0 to enable TLS.</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>The listener tls_cert_file is set to the certificate file path.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td>The listener tls_key_file is set to the key file path.</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td>The listener tls_min_version is set to tls12.</td>
</tr>
<tr>
<td><i class="conum" data-value="7"></i><b>7</b></td>
<td>The leader API address is set to the HTTPS address.</td>
</tr>
<tr>
<td><i class="conum" data-value="8"></i><b>8</b></td>
<td>The leader CA certificate file is set to the CA certificate file path.</td>
</tr>
<tr>
<td><i class="conum" data-value="9"></i><b>9</b></td>
<td>The Route tls termination is set to reencrypt.</td>
</tr>
<tr>
<td><i class="conum" data-value="10"></i><b>10</b></td>
<td>The destination CA certificate is set to the CA certificate. Be sure not to add any extra lines or spaces.</td>
</tr>
<tr>
<td><i class="conum" data-value="11"></i><b>11</b></td>
<td>The extra volumes are mounted at the /openbao/tls path.</td>
</tr>
<tr>
<td><i class="conum" data-value="12"></i><b>12</b></td>
<td>The extra volume mounts are mounted at the /openbao/tls path.</td>
</tr>
<tr>
<td><i class="conum" data-value="13"></i><b>13</b></td>
<td>The injector certs are set to the injector TLS secret name. The caBundle must be provided in base64 format.</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 secret key names must match what cert-manager writes: tls.crt and tls.key. The OpenBao Helm chart mounts each entry in extraVolumes at path + name (e.g. with path: /openbao/tls and name: openbao-server-tls the secret is mounted at /openbao/tls/openbao-server-tls/). The listener tls_cert_file and tls_key_file must use that full path.
</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">
Be sure to change the Route host in the Helm values to the one you are using. In addition, make sure that the CA certificate is added correctly to the Route. Do not add any extra lines or spaces and do not forget the | after destinationCACertificate: and the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines.
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_6_upgrade_the_helm_release">Step 6: Upgrade the Helm Release</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Perform a Helm upgrade so the new volumes and configuration are applied. Pods will restart and pick up TLS; Raft will use HTTPS for join and replication.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">helm upgrade openbao openbao/openbao \
  --namespace openbao \
  --values openbao-ha-values-tls.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p>Watch the rollout. The first pod (openbao-0) will log &#34;raft retry join initiated&#34; and stay 0/1 Ready until it is initialized and unsealed (new cluster) or until it forms quorum (existing cluster).</p>
</div>
<div class="sect2">
<h3 id="_new_cluster_initialize_and_unseal_openbao_0">New cluster: initialize and unseal openbao-0</h3>
<div class="paragraph">
<p>openbao-0 will not become Ready until it is initialized and unsealed. Fetch the certificate, use port-forward and talk to OpenBao over HTTPS with the CA:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># 1. Save the CA cert (for BAO_CACERT)
oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39; | base64 -d &gt; openbao-ca.crt

# 2. Port-forward to openbao-0 (background)
oc port-forward openbao-0 8200:8200 -n openbao &amp;

# 3. Use HTTPS and CA cert
export BAO_ADDR=&#39;https://127.0.0.1:8200&#39;
export BAO_CACERT=&#34;$PWD/openbao-ca.crt&#34;

# 4. Check status, then initialize (only once) and unseal 3 times
bao status
bao operator init -key-shares=5 -key-threshold=3 -format=json &gt; openbao-init.json
bao operator unseal
bao operator unseal
bao operator unseal
bao status</code></pre>
</div>
</div>
<div class="paragraph">
<p>After unsealing, openbao-0 becomes leader and goes 1/1 Ready. Then start openbao-1 and openbao-2 and join or unseal them as in Part 3 (use https://).</p>
</div>
<div class="paragraph">
<p>Perform the following steps for the other pods - join the raft cluster and unseal them (3 times):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc exec -ti openbao-1 -- bao operator raft join https://openbao-0.openbao-internal:8200

# 3 times with 3 different unseal keys
oc exec -ti openbao-1 -- bao operator unseal
Unseal Key (will be hidden):</code></pre>
</div>
</div>
<div class="paragraph">
<p>Repeat the same steps for openbao-2.</p>
</div>
</div>
<div class="sect2">
<h3 id="_existing_cluster_re_unseal_after_restart">Existing cluster: re-unseal after restart</h3>
<div class="paragraph">
<p>The existing cluster is already initialized. Re-unseal the pods (and re-join the raft cluster if necessary).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get pods -n openbao -w
oc exec -ti openbao-1 -- bao operator raft join https://openbao-0.openbao-internal:8200
oc exec -ti openbao-1 -- bao operator unseal  # three times; same for openbao-2</code></pre>
</div>
</div>
<div class="paragraph">
<p>Repeat the same steps for openbao-2.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_step_7_verify_and_use_https_from_clients">Step 7: Verify and Use HTTPS from Clients</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Verify server health over HTTPS (from inside the cluster):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl -k https://openbao.apps.cluster.example.com/v1/sys/health | jq</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">
Be sure to use the Route host in the Helm values.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>From your workstation, use the Route URL with HTTPS. If the Route host is signed by your internal CA, set BAO_CACERT to the CA file:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">export BAO_ADDR=&#39;https://openbao.apps.cluster.example.com&#39;
export BAO_CACERT=&#39;/path/to/openbao-ca.crt&#39;
bao status</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">
Be sure to use the Route host in the Helm values.
</td>
</tr>
</tbody></table>
</div>
<div class="paragraph">
<p>Agent Injector: New pods that use the injector should start without webhook certificate errors. Check injector logs if you see TLS or certificate errors:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc logs -n openbao -l app.kubernetes.io/name=openbao-agent-injector -f</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_troubleshooting">Troubleshooting</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_mutatingwebhookconfiguration_conflict_vault_k8s">MutatingWebhookConfiguration conflict (vault-k8s)</h3>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">conflict occurred while applying object ... MutatingWebhookConfiguration: Apply failed with 1 conflict: conflict with &#34;vault-k8s&#34; using ... .webhooks[name=&#34;vault.hashicorp.com&#34;].clientConfig.caBundle
this is a server-side apply (SSA) field ownership conflict. The OpenBao chart uses the same webhook name (vault.hashicorp.com) as the HashiCorp Vault agent injector for annotation compatibility. The clientConfig.caBundle field is still owned by a previous manager (e.g. a prior Vault Helm release or the Vault injector), so Helm cannot update it when you change the injector certificate.</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Fix option 1</strong> – Delete the webhook and re-upgrade (recommended)</p>
</div>
<div class="paragraph">
<p>Remove the MutatingWebhookConfiguration so Helm can recreate it and own all fields. There will be a short window where the injector webhook is missing (new pods requesting injection may fail until the upgrade completes).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Replace RELEASE_NAME with your Helm release name (e.g. openbao)
RELEASE_NAME=openbao
oc delete mutatingwebhookconfiguration ${RELEASE_NAME}-agent-injector-cfg

# Re-run the upgrade
helm upgrade ${RELEASE_NAME} openbao/openbao \
  --namespace openbao \
  --values openbao-ha-values-tls.yaml</code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Fix option 2</strong> – Force takeover of the conflicting field</p>
</div>
<div class="paragraph">
<p>If you cannot delete the webhook (e.g. in production), take over the caBundle field with server-side apply, then run the Helm upgrade again:</p>
</div>
<div class="paragraph">
<p>Export the MutatingWebhookConfiguration, set webhooks[0].clientConfig.caBundle to your injector CA (base64 PEM from openbao-ca-secret), then re-apply with --server-side --force-conflicts:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Get the current object and the new CA bundle
oc get mutatingwebhookconfiguration openbao-agent-injector-cfg -o yaml &gt; mwc.yaml
CA_BUNDLE=$(oc get secret openbao-ca-secret -n openbao -o jsonpath=&#39;{.data.ca\.crt}&#39;)

# Edit mwc.yaml: set .webhooks[0].clientConfig.caBundle to the value of CA_BUNDLE (no quotes in YAML).
# Then apply with force-conflicts so Helm can later manage it:
oc apply -f mwc.yaml --server-side --force-conflicts

# Re-run the Helm upgrade
helm upgrade openbao openbao/openbao --namespace openbao --values openbao-ha-values-tls.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">
If you still have HashiCorp Vault’s agent injector installed on the same cluster, ensure only one injector is active for a given namespace (e.g. use namespace selectors) or uninstall the Vault injector to avoid two webhooks with the same name in different resources.
</td>
</tr>
</tbody></table>
</div>
</div>
<div class="sect2">
<h3 id="_route_ui_tls_bad_record_mac">Route / UI – tls: bad record MAC</h3>
<div class="paragraph">
<p>Pod logs show <code>tls: bad record MAC</code> from the router IP. The Route is likely using <strong>edge</strong> termination (HTTP to pod). Fix: Use reencrypt and set <code>destinationCACertificate</code> (Step 5).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get route openbao -n openbao -o jsonpath=&#39;{.spec.tls.termination}&#39;</code></pre>
</div>
</div>
<div class="paragraph">
<p>If the OpenBao UI does not load and the pod logs show:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">http: TLS handshake error from 10.x.x.x:xxxxx: local error: tls: bad record MAC</code></pre>
</div>
</div>
<div class="paragraph">
<p>the traffic is coming from the OpenShift router (the IP is typically a cluster pod IP).</p>
</div>
<div class="paragraph">
<p><strong>Cause</strong>: The Route is likely using edge termination: the router terminates TLS at the edge and sends plain HTTP to the pod. The pod expects HTTPS, so the TLS layer receives non-TLS data and reports &#34;bad record MAC&#34;.</p>
</div>
<div class="paragraph">
<p><strong>Fix</strong>: Use reencrypt (or passthrough) and set destinationCACertificate so the router talks HTTPS to the pod. See Step 5 above. Quick check:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc get route openbao -n openbao -o jsonpath=&#39;{.spec.tls.termination}&#39;
# Must be &#34;reencrypt&#34; or &#34;passthrough&#34;, not &#34;edge&#34;</code></pre>
</div>
</div>
<div class="paragraph">
<p>If the output is edge, patch the Route to reencrypt and set spec.tls.destinationCACertificate to the CA PEM (Step 5).</p>
</div>
</div>
<div class="sect2">
<h3 id="_tls_handshake_127_0_0_1_certificate_errors">TLS handshake / 127.0.0.1 certificate errors</h3>
<div class="paragraph">
<p>If you see in the pod logs:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">remote error: tls: bad certificate (from 127.0.0.1)</code></pre>
</div>
</div>
<div class="paragraph">
<p>or when running:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">oc exec -ti openbao-0 — bao operator raft join https://…​;: x509: cannot validate certificate for 127.0.0.1 because it doesn’t contain any IP SANs</code></pre>
</div>
</div>
<div class="paragraph">
<p>The server certificate does not include 127.0.0.1 (and optionally ::1) as Subject Alternative Names. Readiness/liveness probes and in-pod bao commands connect to the listener on 127.0.0.1, so the certificate must include these IP SANs.</p>
</div>
<div class="paragraph">
<p><strong>Fix</strong>: Add ipAddresses to the OpenBao server Certificate and let cert-manager re-issue:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash"># Edit the Certificate (or re-apply the YAML from Step 3 with ipAddresses added)
oc edit certificate openbao-server-tls -n openbao
# Add under spec:
#   ipAddresses:
#     - 127.0.0.1
#     - &#34;::1&#34;

# cert-manager will issue a new cert; wait until the secret is updated
oc get certificate openbao-server-tls -n openbao
# Restart OpenBao pods so they load the new cert
oc rollout restart statefulset/openbao -n openbao</code></pre>
</div>
</div>
</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/platform/k8s/helm/configuration/" rel="noopener" target="_blank">OpenBao Helm configuration</a></p>
</li>
<li>
<p><a href="https://openbao.org/docs/platform/k8s/helm/examples/injector-tls-cert-manager/" rel="noopener" target="_blank">OpenBao Agent Injector TLS with cert-manager</a></p>
</li>
<li>
<p><a href="https://cert-manager.io/docs/" rel="noopener" target="_blank">cert-manager documentation</a></p>
</li>
</ul>
</div>
</div>
</div>]]></content:encoded></item></channel></rss>