Skip to content

docs: add operator policy guide - #556

Merged
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
jan-law:10409-operator-policy
May 19, 2026
Merged

docs: add operator policy guide#556
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
jan-law:10409-operator-policy

Conversation

@jan-law

@jan-law jan-law commented May 4, 2026

Copy link
Copy Markdown
Contributor

ref: https://redhat.atlassian.net/browse/ACM-10409

  • Cursor+Claude 4.5 assisted for all hyperlinks, index.md paragraph, and the prerequisites section
  • Manually checked the hyperlinks were working via local hugo server

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Operator Policy documentation covering concept, prerequisites, enabling, verification, and related links.
    • Included a full sample walkthrough: create/verify policy, enable enforcement, deploy operator, and optional cleanup steps.
    • Updated the supported managed-cluster policy engines list to reference the new Operator Policy capability.
  • Bug Fixes
    • Corrected the example Clusteradm CLI command to use the proper subcommand syntax.

Review Change Stack

@netlify

netlify Bot commented May 4, 2026

Copy link
Copy Markdown

Deploy Preview for open-cluster-management ready!

Name Link
🔨 Latest commit be1fef3
🔍 Latest deploy log https://app.netlify.com/projects/open-cluster-management/deploys/6a04d401cc1e3100085b6180
😎 Deploy Preview https://deploy-preview-556--open-cluster-management.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@jan-law has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 22 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0775d6f7-6df3-408b-a3eb-9d08fdc1c433

📥 Commits

Reviewing files that changed from the base of the PR and between 5c65c6b and be1fef3.

📒 Files selected for processing (4)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/configuration-policy.md
  • content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md

Walkthrough

Adds Operator Policy documentation: index subsection, policy-kinds list entry, and a new operator-policy page with front matter, prerequisites, enablement, a worked example (inform→enforce), verification, and cleanup instructions.

Changes

Operator Policy Documentation

Layer / File(s) Summary
Overview & Policy Kind Introduction
content/en/docs/getting-started/integration/policy-controllers/_index.md, content/en/docs/getting-started/integration/policy-controllers/policy.md
Adds an "Operator policy" entry describing OperatorPolicy as an OCM-provided desired-state mechanism for OLM-managed operators and links to the Operator Policy docs.
Detailed Documentation & Walkthrough
content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
New page with front matter, purpose, prerequisites (kubectl, kustomize, Go optional, policy framework, OLM), enablement steps (controller disabled by default; enable via clusteradm/annotations and verify pod args), a full sample workflow deploying an external secrets operator (inform→enforce), verification steps, cleanup including removalBehavior and mustnothave example, and related links.
Clusteradm CLI example fix
content/en/docs/getting-started/integration/policy-controllers/configuration-policy.md
Corrects the clusteradm addon enable example by removing an extra addon token so the command matches expected subcommand syntax.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

lgtm

Suggested reviewers

  • mikeshng
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly aligns with the primary change: adding comprehensive documentation for the OperatorPolicy feature, including a new guide page, index reference, and policy.md mention.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jan-law
jan-law marked this pull request as ready for review May 5, 2026 15:25
@openshift-ci
openshift-ci Bot requested review from mikeshng and qiujian16 May 5, 2026 15:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`:
- Around line 228-253: The cleanup instructions are contradictory: the text says
the OperatorPolicy deletion runs only when spec.complianceType is set to
mustnothave AND spec.remediationAction is set to enforce, but the example YAML
shows remediationAction: inform; update the example policy YAML (the Policy
resource in the snippet) to set spec.remediationAction: enforce and ensure
spec.complianceType: mustnothave (and keep the removalBehavior block shown
earlier) so the example matches the described behavior for OperatorPolicy and
removalBehavior.
- Around line 38-39: The code blocks include shell prompts like "$ clusteradm
addon enable addon --names config-policy-controller --clusters <cluster_name>
--context ${CTX_HUB_CLUSTER}" which triggers markdownlint MD014; remove the
leading "$ " from these command lines (e.g., the clusteradm addon enable command
and the other similar blocks) so the fenced code blocks contain only the raw
command, ensuring consistent lint-clean markdown across the file.
- Around line 141-149: The ordered-step numbering in the example procedure is
incorrect (it jumps from Step 1 to Step 3); update the numbered list so the
kubectl apply command block is Step 2 and subsequent items are renumbered
sequentially (e.g., ensure the lines containing the kubectl apply command, the
ManagedClusterSetBinding instruction, and the Placement verification read Steps
2, 3, and 4 respectively), and verify references to ManagedClusterSetBinding and
Placement remain unchanged.
- Line 62: Replace the shell alias usage in the command snippet so it is
copy/paste-safe: change the example command that starts with "k describe pod
config-policy-controller-5888b6cbc5-lvwdj -n open-cluster-management-agent-addon
--context ${CTX_MANAGED_CLUSTER} | grep enable-operator-policy" to use the full
"kubectl" binary (i.e., "kubectl describe ...") so users without a "k" alias can
run the command successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3385cdd2-256e-41cb-a95b-16f09f2dbfb8

📥 Commits

Reviewing files that changed from the base of the PR and between a4c8ad9 and 424b8a3.

📒 Files selected for processing (3)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md

Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
@jan-law
jan-law force-pushed the 10409-operator-policy branch 2 times, most recently from 2d1a735 to c62b6b2 Compare May 5, 2026 19:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
content/en/docs/getting-started/integration/policy-controllers/operator-policy.md (1)

38-40: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove $ prompts from shell command blocks.

These fenced command blocks still use leading $, which triggers markdownlint MD014 and reduces copy/paste reliability in docs.

Also applies to: 45-48, 53-55, 60-66, 146-150, 157-163, 170-173, 178-188, 208-212, 217-220, 227-230, 273-277, 282-289, 294-296

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`
around lines 38 - 40, Remove the leading "$" prompts from all fenced shell
command blocks in
content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
so they pass markdownlint MD014 and copy/paste cleanly; locate the code fences
that contain commands such as "clusteradm addon enable addon --names
config-policy-controller --clusters <cluster_name> --context ${CTX_HUB_CLUSTER}"
and the other blocks noted (lines around the ranges in the review) and edit each
block to strip the leading "$ " from each command line while preserving the rest
of the content and fences.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`:
- Around line 81-140: The YAML examples have incorrect indentation causing
top-level keys (e.g., remediationAction, disabled, policy-templates,
placementRef, subjects, predicates) to be siblings of metadata instead of nested
under their parent spec blocks; update the Policy (metadata.name: policy-eso /
kind: Policy), OperatorPolicy objectDefinition (metadata.name: policy-eso /
kind: OperatorPolicy), PlacementBinding (name: binding-policy-eso / kind:
PlacementBinding) and Placement (name: placement-policy-eso / kind: Placement)
YAML so that each remediationAction, disabled, policy-templates, placementRef,
subjects and predicates are indented under the respective spec: block, and apply
the same indentation fix to the other listed snippets (lines ~195-205, ~251-270)
to ensure kubectl apply will accept the manifests.

---

Duplicate comments:
In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`:
- Around line 38-40: Remove the leading "$" prompts from all fenced shell
command blocks in
content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
so they pass markdownlint MD014 and copy/paste cleanly; locate the code fences
that contain commands such as "clusteradm addon enable addon --names
config-policy-controller --clusters <cluster_name> --context ${CTX_HUB_CLUSTER}"
and the other blocks noted (lines around the ranges in the review) and edit each
block to strip the leading "$ " from each command line while preserving the rest
of the content and fences.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 97958104-f056-43b3-8565-c2d8f84b4e3f

📥 Commits

Reviewing files that changed from the base of the PR and between 424b8a3 and c62b6b2.

📒 Files selected for processing (3)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md
✅ Files skipped from review due to trivial changes (2)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md

Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
@jan-law
jan-law force-pushed the 10409-operator-policy branch from c62b6b2 to d85873d Compare May 5, 2026 20:25

@JustinKuli JustinKuli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/hold

Looks good overall to me! Minor suggestions you can skip if you want.

Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated

@JustinKuli JustinKuli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/unhold

@JustinKuli

Copy link
Copy Markdown
Member

/cc @dhaiducek

@openshift-ci
openshift-ci Bot requested a review from dhaiducek May 11, 2026 14:14
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
@openshift-ci openshift-ci Bot removed the lgtm label May 11, 2026
@jan-law
jan-law force-pushed the 10409-operator-policy branch from 933673b to b33854a Compare May 13, 2026 15:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
content/en/docs/getting-started/integration/policy-controllers/operator-policy.md (1)

114-125: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

PlacementBinding example is missing spec, so the YAML shape is invalid.

placementRef and subjects must be nested under spec for PlacementBinding. As written, this manifest is not structurally correct.

Suggested doc fix
   apiVersion: policy.open-cluster-management.io/v1
   kind: PlacementBinding
   metadata:
     name: binding-policy-eso
-  placementRef:
-    name: placement-policy-eso
-    kind: Placement
-    apiGroup: cluster.open-cluster-management.io
-  subjects:
-    - name: policy-eso
-      kind: Policy
-      apiGroup: policy.open-cluster-management.io
+  spec:
+    placementRef:
+      name: placement-policy-eso
+      kind: Placement
+      apiGroup: cluster.open-cluster-management.io
+    subjects:
+      - name: policy-eso
+        kind: Policy
+        apiGroup: policy.open-cluster-management.io
In Open Cluster Management, what is the required schema for a PlacementBinding (policy.open-cluster-management.io/v1)? Specifically, are placementRef and subjects required under spec?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`
around lines 114 - 125, The PlacementBinding manifest is invalid because
placementRef and subjects are placed at top-level instead of under spec; update
the PlacementBinding resource (kind: PlacementBinding, apiVersion:
policy.open-cluster-management.io/v1) so that metadata remains top-level and add
a spec object containing placementRef and subjects (i.e., move the existing
placementRef and subjects keys into spec) to conform to the required
PlacementBinding schema.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`:
- Line 38: The command string mistakenly includes a duplicate token ("addon")
and omits the required --namespace flag; update the invocation that currently
uses "clusteradm addon enable addon --names config-policy-controller --clusters
<cluster_name> --context ${CTX_HUB_CLUSTER}" to use the proper syntax for
clusteradm addon enable (remove the extra "addon") and append the required
--namespace <namespace> parameter so the final call uses "clusteradm addon
enable --names config-policy-controller --clusters <cluster_name> --context
${CTX_HUB_CLUSTER} --namespace <namespace>" (fix the literal command string
containing clusteradm, addon enable, --names and --namespace).

---

Duplicate comments:
In
`@content/en/docs/getting-started/integration/policy-controllers/operator-policy.md`:
- Around line 114-125: The PlacementBinding manifest is invalid because
placementRef and subjects are placed at top-level instead of under spec; update
the PlacementBinding resource (kind: PlacementBinding, apiVersion:
policy.open-cluster-management.io/v1) so that metadata remains top-level and add
a spec object containing placementRef and subjects (i.e., move the existing
placementRef and subjects keys into spec) to conform to the required
PlacementBinding schema.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ea0a55e-f41d-454e-93aa-0507af158f92

📥 Commits

Reviewing files that changed from the base of the PR and between c62b6b2 and b33854a.

📒 Files selected for processing (3)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/operator-policy.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md
✅ Files skipped from review due to trivial changes (2)
  • content/en/docs/getting-started/integration/policy-controllers/_index.md
  • content/en/docs/getting-started/integration/policy-controllers/policy.md

Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
@jan-law

jan-law commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/hold operator policy will be enabled by default soon, after which I will update this guide

@jan-law
jan-law force-pushed the 10409-operator-policy branch from b33854a to 5c65c6b Compare May 13, 2026 19:18
Comment thread content/en/docs/getting-started/integration/policy-controllers/operator-policy.md Outdated
ref: https://redhat.atlassian.net/browse/ACM-10409

Signed-off-by: Janelle Law <jalaw@redhat.com>

Remove duplicate addon token

Signed-off-by: Janelle Law <jalaw@redhat.com>
@jan-law
jan-law force-pushed the 10409-operator-policy branch from 5c65c6b to be1fef3 Compare May 13, 2026 19:41
@jan-law

jan-law commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/unhold

@JustinKuli JustinKuli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@openshift-ci openshift-ci Bot added the lgtm label May 14, 2026
@jan-law
jan-law requested a review from dhaiducek May 14, 2026 15:01

@dhaiducek dhaiducek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@openshift-ci

openshift-ci Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, jan-law, JustinKuli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit b5cf3f2 into open-cluster-management-io:main May 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants