ACM-37236: feat: onboard Thanos Operator into COO #1151
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->

<!-- review_stack_entry_end -->
<!-- This is an auto-generated comment: review paused by coderabbit.ai -->
[!NOTE]
## Reviews paused
> It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.> - Last reviewed commit: none yet
- Latest commit, not reviewed: 976f0ef8dbcb69f0fc6b8b3774deb44e403d66d7
> Use the following commands to manage reviews:
- @coderabbitai resume to resume automatic reviews.- @coderabbitai review to trigger a single review.> Use the checkboxes below for quick actions:
- [ ] <!-- {"checkboxId": "7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews
- [ ] <!-- {"checkboxId": "e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review
<!-- end of auto-generated comment: review paused by coderabbit.ai -->
<!-- walkthrough_start -->
<details>
<summary><strong>📝 Walkthrough</strong></summary>
<dl>
<dd>
Adds Thanos operator support through dependency and scheme registration, CRD generation, Kubernetes deployment and RBAC manifests, image configuration, and OLM packaging. The change adds five Thanos resource types, editor and viewer roles, manager permissions, leader-election permissions, and bundle metadata.
Estimated code review effort: 4 (Complex) | ~45 minutes
Suggested reviewers: simonpasquier, jgbernalp
</dd>
</dl>
</details>
<!-- walkthrough_end -->
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary><strong>🚥 Pre-merge checks | ✅ 4 | ❌ 1</strong></summary>
<dl>
<dd>
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
| :---------------- | :--------- | :----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
<details>
<summary><strong>✅ Passed checks (4 passed)</strong></summary>
<dl>
<dd>
| Check name | Status | Explanation |
| :------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------ |
| Description check | ✅ Passed | The description clearly explains the Thanos Operator onboarding changes, validation, and remaining deployment work. |
| Title check | ✅ Passed | The title clearly identifies the Thanos Operator onboarding into COO and includes the related issue key. |
| 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. |
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary><strong>✨ Finishing Touches</strong></summary>
<dl>
<dd>
<details>
<summary><strong>🧪 Generate unit tests (beta)</strong></summary>
<dl>
<dd>
feat/onboard-thanos-operator</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
_🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_
Replace :latest tag with a pinned version for the thanos-operator image.
Using :latest is mutable and breaks deployment reproducibility — the image content can change at any time. All other entries in defaultImages use specific version tags or Go constants. Pin to a specific version (e.g., quay.io/thanos/thanos-operator:v0.x.y) to ensure consistent deployments.
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cmd/operator/main.go` at line 62, The defaultImages entry for
"thanos-operator" is using a mutable :latest image tag, which should be replaced
with a pinned version to keep deployments reproducible. Update the
thanos-operator image in the defaultImages map in main.go to a specific version
tag consistent with the other pinned images, using the existing
"thanos-operator" key as the location to change.
</details>
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:80a32abfa8bcfe385dc5c058 -->
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commit 58fbb15
_🩺 Stability & Availability_ | _🔴 Critical_ | _⚡ Quick win_
Missing namespace on ServiceAccount subject — ClusterRoleBinding is non-functional.
For kind: ServiceAccount subjects in a ClusterRoleBinding, the namespace field is required. Without it, the binding does not resolve to any ServiceAccount, so the operator pod will lack all granted permissions and fail on every privileged API call. Kustomize's namespace transformer does not inject this field into ClusterRoleBinding subjects, so it must be set explicitly.
<details>
<summary>🔧 Proposed fix: add namespace to ServiceAccount subject</summary>
subjects:
- kind: ServiceAccount
name: thanos-operator
+ namespace: <operator-namespace>
</details>
If the namespace is dynamic, use a kustomize patch or variable substitution to inject it.
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deploy/thanos/thanos-operator-cluster-role-binding.yaml` around lines 13 -
14, The ClusterRoleBinding subject for the thanos-operator ServiceAccount is
missing the required namespace, so the binding cannot resolve correctly. Update
the ServiceAccount subject in the ClusterRoleBinding manifest to include an
explicit namespace, using the thanos-operator binding definition so the role
maps to the intended ServiceAccount. If the namespace must vary by environment,
apply it through a kustomize patch or variable substitution rather than relying
on namespace transformation.
</details>
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:afb6c19c0a9f95669dced05c -->
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commits f79810c to f4345ad
_🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_
Volume openshift-service-ca is defined but never mounted.
The pod declares a configmap volume for the OpenShift service CA certificate, but no container in the spec has a corresponding volumeMounts entry. Either the mount is missing (the operator cannot access the CA cert for TLS) or the volume is dead configuration that should be removed.
<details>
<summary>🔧 Proposed fix: add volumeMount to container</summary>
containers:
- name: thanos-operator
image: quay.io/thanos/thanos-operator:latest
args:
- --leader-elect
- --health-probe-bind-address=:8081
+ volumeMounts:
+ - name: openshift-service-ca
+ mountPath: /etc/service-ca
+ readOnly: true
securityContext:
If the volume is not needed, remove the entire volumes block instead.
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 56 - 63, The
`openshift-service-ca` volume is declared in the Thanos operator deployment but
never mounted, so either add a matching `volumeMounts` entry on the relevant
container that needs the CA cert or remove the unused volume block entirely. Use
the `volumes` definition and the container spec in
`thanos-operator-deployment.yaml` to keep the config consistent and ensure the
operator can actually access `service-ca.crt` if TLS support is required.
</details>
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:6df8de8136f01d1fa82e3c6b -->
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commits 37f24d0 to 176e144
Actionable comments posted: 3
<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>
<details>
<summary>deploy/thanos/thanos-operator-deployment.yaml (1)</summary><blockquote>
24-55: _🔒 Security & Privacy_ | _🔵 Trivial_ | _⚡ Quick win_
Add pod-level securityContext for defense-in-depth.
The container-level security context is good (allowPrivilegeEscalation: false, drop ALL capabilities). Adding a pod-level seccompProfile and runAsNonRoot strengthens the posture. Note: on OpenShift, the restricted SCC may already enforce runAsNonRoot, so verify before setting it explicitly.
<details>
<summary>🔒 Suggested pod securityContext</summary>
spec:
+ securityContext:
+ runAsNonRoot: true
+ seccompProfile:
+ type: RuntimeDefault
containers:
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 24 - 55, The
`thanos-operator` workload only defines a container-level `securityContext`; add
a pod-level `securityContext` on the `spec` for defense-in-depth. In
`thanos-operator-deployment.yaml`, update the `spec` for the `thanos-operator`
deployment to include a pod `seccompProfile` and, if compatible with your
cluster policy, `runAsNonRoot` alongside the existing `containers` block. Keep
the existing container `securityContext` as-is and ensure the new pod-level
settings are applied consistently with OpenShift/SCC behavior.
</details>
<!-- cr-comment:v1:22c01fc58ad927731e769622 -->
</blockquote></details>
</blockquote></details>
<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>
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 `@cmd/operator/main.go`:
- Line 62: The defaultImages entry for "thanos-operator" is using a mutable
:latest image tag, which should be replaced with a pinned version to keep
deployments reproducible. Update the thanos-operator image in the defaultImages
map in main.go to a specific version tag consistent with the other pinned
images, using the existing "thanos-operator" key as the location to change.
In `@deploy/thanos/thanos-operator-cluster-role-binding.yaml`:
- Around line 13-14: The ClusterRoleBinding subject for the thanos-operator
ServiceAccount is missing the required namespace, so the binding cannot resolve
correctly. Update the ServiceAccount subject in the ClusterRoleBinding manifest
to include an explicit namespace, using the thanos-operator binding definition
so the role maps to the intended ServiceAccount. If the namespace must vary by
environment, apply it through a kustomize patch or variable substitution rather
than relying on namespace transformation.
In `@deploy/thanos/thanos-operator-deployment.yaml`:
- Around line 56-63: The `openshift-service-ca` volume is declared in the Thanos
operator deployment but never mounted, so either add a matching `volumeMounts`
entry on the relevant container that needs the CA cert or remove the unused
volume block entirely. Use the `volumes` definition and the container spec in
`thanos-operator-deployment.yaml` to keep the config consistent and ensure the
operator can actually access `service-ca.crt` if TLS support is required.
---
Nitpick comments:
In `@deploy/thanos/thanos-operator-deployment.yaml`:
- Around line 24-55: The `thanos-operator` workload only defines a
container-level `securityContext`; add a pod-level `securityContext` on the
`spec` for defense-in-depth. In `thanos-operator-deployment.yaml`, update the
`spec` for the `thanos-operator` deployment to include a pod `seccompProfile`
and, if compatible with your cluster policy, `runAsNonRoot` alongside the
existing `containers` block. Keep the existing container `securityContext` as-is
and ensure the new pod-level settings are applied consistently with
OpenShift/SCC behavior.
</details>
<details>
<summary>🪄 Autofix (Beta)</summary>
Fix all unresolved CodeRabbit comments on this PR:
</details>
---
<details>
<summary>ℹ️ Review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: b5fd7423-dee8-4305-b2f3-a80cdfdc149a
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 8ee6eccfa5ea823644e65909bb0e587f06f38779 and 755fd62f31c2e558f967fc60f3ee73a7582fb441.
</details>
<details>
<summary>⛔ Files ignored due to path filters (1)</summary>
go.sum is excluded by !/.sum
</details>
<details>
<summary>📒 Files selected for processing (27)</summary>
Makefile
cmd/operator/main.go
deploy/olm/bases/observability-operator.clusterserviceversion.yaml
deploy/olm/kustomization.yaml
deploy/thanos/crds/kustomization.yaml
deploy/thanos/crds/monitoring.thanos.io_thanoscompacts.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosqueries.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosreceives.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosrulers.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosstores.yaml
deploy/thanos/kustomization.yaml
deploy/thanos/thanos-operator-cluster-role-binding.yaml
deploy/thanos/thanos-operator-cluster-role.yaml
deploy/thanos/thanos-operator-deployment.yaml
deploy/thanos/thanos-operator-service-account.yaml
deploy/thanos/thanoscompact_editor_role.yaml
deploy/thanos/thanoscompact_viewer_role.yaml
deploy/thanos/thanosquery_editor_role.yaml
deploy/thanos/thanosquery_viewer_role.yaml
deploy/thanos/thanosreceive_editor_role.yaml
deploy/thanos/thanosreceive_viewer_role.yaml
deploy/thanos/thanosruler_editor_role.yaml
deploy/thanos/thanosruler_viewer_role.yaml
deploy/thanos/thanosstore_editor_role.yaml
deploy/thanos/thanosstore_viewer_role.yaml
go.mod
pkg/operator/scheme.go</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit for review status -->
<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>
<details>
<summary>deploy/thanos/thanos-operator-deployment.yaml (1)</summary><blockquote>
56-63: _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_
Volume openshift-service-ca still declared but never mounted.
The previous review flagged this issue and it remains unresolved: the openshift-service-ca volume is defined but no container in the spec has a corresponding volumeMounts entry. Either add the mount so the operator can access the CA cert, or remove the unused volume block.
<details>
<summary>🔧 Proposed fix: add volumeMount to container</summary>
containers:
- name: thanos-operator
image: quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790
args:
- --leader-elect
- --health-probe-bind-address=:8081
+ volumeMounts:
+ - name: openshift-service-ca
+ mountPath: /etc/service-ca
+ readOnly: true
securityContext:
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 56 - 63, The
openshift-service-ca volume is declared in the deployment spec but never used by
any container. Update the Thanos operator pod spec so the relevant container
includes a matching volumeMount for openshift-service-ca, or remove the volume
block entirely if the CA cert is not needed. Use the existing
openshift-service-ca volume definition and the container spec in this deployment
manifest to make the fix consistent.
</details>
<!-- cr-comment:v1:69c37a0a1d37611c26279f04 -->
</blockquote></details>
</blockquote></details>
<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@deploy/thanos/thanos-operator-deployment.yaml`:
- Around line 56-63: The openshift-service-ca volume is declared in the
deployment spec but never used by any container. Update the Thanos operator pod
spec so the relevant container includes a matching volumeMount for
openshift-service-ca, or remove the volume block entirely if the CA cert is not
needed. Use the existing openshift-service-ca volume definition and the
container spec in this deployment manifest to make the fix consistent.
</details>
---
<details>
<summary>ℹ️ Review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 11cb96fe-f22d-4bb5-b0fd-15e52a08de8a
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 755fd62f31c2e558f967fc60f3ee73a7582fb441 and 58fbb1524f0b1465e31c8544e6369fb110be6ca5.
</details>
<details>
<summary>📒 Files selected for processing (2)</summary>
cmd/operator/main.go
deploy/thanos/thanos-operator-deployment.yaml
</details>
<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit for review status -->
_📐 Maintainability & Code Quality_ | _🟠 Major_ | _⚡ Quick win_
Placeholder operator description will ship to OperatorHub.
description: Observability Operator description. TODO. is a placeholder and becomes the user-facing description in OperatorHub/console. This bundle is generated from deploy/olm/bases/observability-operator.clusterserviceversion.yaml, so fix it there and regenerate.
Want me to open an issue to track providing real CSV metadata?
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bundle/manifests/observability-operator.clusterserviceversion.yaml` at line
129, The CSV still contains a placeholder user-facing description, so update the
operator description in the source CSV manifest used to generate this bundle and
regenerate the bundle afterward. Fix the `description` field in
`observability-operator.clusterserviceversion.yaml` under the OLM base manifest,
since that is what feeds OperatorHub/console metadata.
</details>
<!-- fingerprinting:phantom:medusa:capybara -->
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:153f203e16711e6d7d1ed003 -->
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commits 516d15d to 0cb4a65
_📐 Maintainability & Code Quality_ | _🟠 Major_ | _⚡ Quick win_
Placeholder maintainer/provider/links metadata in the shipped bundle.
your@email.com, Maintainer Name, Provider Name, https://your.domain, and https://observability-operator.domain are template defaults. Per the change summary this replaced the prior GitHub/Red Hat information, so this is a regression in the published CSV metadata. Restore the real values in the base CSV (deploy/olm/bases/observability-operator.clusterserviceversion.yaml) and regenerate the bundle.
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bundle/manifests/observability-operator.clusterserviceversion.yaml` around
lines 1356 - 1366, The shipped CSV metadata still contains template placeholders
for the maintainer, provider, and link fields. Update the source CSV in
deploy/olm/bases/observability-operator.clusterserviceversion.yaml to restore
the real maintainer/provider/link values, then regenerate the bundle so
observability-operator.clusterserviceversion.yaml picks up the correct metadata.
</details>
<!-- fingerprinting:phantom:medusa:capybara -->
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:fa52f3300dc7af8f9df099f8 -->
<!-- This is an auto-generated comment by CodeRabbit -->
✅ Addressed in commits 516d15d to 0cb4a65
Actionable comments posted: 2
<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>
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 `@bundle/manifests/observability-operator.clusterserviceversion.yaml`:
- Line 129: The CSV still contains a placeholder user-facing description, so
update the operator description in the source CSV manifest used to generate this
bundle and regenerate the bundle afterward. Fix the `description` field in
`observability-operator.clusterserviceversion.yaml` under the OLM base manifest,
since that is what feeds OperatorHub/console metadata.
- Around line 1356-1366: The shipped CSV metadata still contains template
placeholders for the maintainer, provider, and link fields. Update the source
CSV in deploy/olm/bases/observability-operator.clusterserviceversion.yaml to
restore the real maintainer/provider/link values, then regenerate the bundle so
observability-operator.clusterserviceversion.yaml picks up the correct metadata.
</details>
<details>
<summary>🪄 Autofix (Beta)</summary>
Fix all unresolved CodeRabbit comments on this PR:
</details>
---
<details>
<summary>ℹ️ Review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 766f27ad-7336-428f-9b4f-9c87ac0aeee9
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 58fbb1524f0b1465e31c8544e6369fb110be6ca5 and f3a68ea3e7350a7f232e8df410ca206363fc55b0.
</details>
<details>
<summary>📒 Files selected for processing (25)</summary>
Makefile
bundle.Dockerfile
bundle/manifests/monitoring.thanos.io_thanoscompacts.yaml
bundle/manifests/monitoring.thanos.io_thanosqueries.yaml
bundle/manifests/monitoring.thanos.io_thanosreceives.yaml
bundle/manifests/monitoring.thanos.io_thanosrulers.yaml
bundle/manifests/monitoring.thanos.io_thanosstores.yaml
bundle/manifests/observability-operator.clusterserviceversion.yaml
bundle/manifests/thanoscompact-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanoscompact-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosquery-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosquery-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosreceive-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosreceive-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosruler-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosruler-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosstore-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosstore-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/metadata/annotations.yaml
deploy/thanos/crds/monitoring.thanos.io_thanoscompacts.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosqueries.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosreceives.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosrulers.yaml
deploy/thanos/crds/monitoring.thanos.io_thanosstores.yaml
deploy/thanos/thanos-operator-deployment.yaml
</details>
<details>
<summary>💤 Files with no reviewable changes (1)</summary>
deploy/thanos/thanos-operator-deployment.yaml
</details>
<details>
<summary>✅ Files skipped from review due to trivial changes (3)</summary>
bundle/manifests/thanosstore-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/manifests/thanosruler-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
bundle/metadata/annotations.yaml
</details>
<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>
Makefile
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit for review status -->
@coleenquadros: This pull request references ACM-37236 which is a valid jira issue.
Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.
<details>
In response to this:
>## Summary
>Onboard the Thanos Operator into COO following the same pattern as the Perses operator onboarding.
>- Adddeploy/thanos/directory with 5 CRDs (monitoring.thanos.io/v1alpha1), operator deployment, RBAC, and user-facing editor/viewer roles
>- Wire into OLM bundle via
deploy/olm/kustomization.yaml>- Register Thanos CRDs as owned in the CSV
>- Add Go dependency on
github.com/thanos-community/thanos-operator and register types in scheme>- Add
generate-thanos-op-crds Makefile target>- Add default
thanos-operator image in cmd/operator/main.go>### CRDs added
>| Kind | API Group | Scope |
>|---|---|---|
>| ThanosQuery | monitoring.thanos.io | Namespaced |
>| ThanosReceive | monitoring.thanos.io | Namespaced |
>| ThanosCompact | monitoring.thanos.io | Namespaced |
>| ThanosStore | monitoring.thanos.io | Namespaced |
>| ThanosRuler | monitoring.thanos.io | Namespaced |
>API support level: TechPreviewNoUpgrade>### Pattern followed
>Same as Perses operator onboarding (commit 5ba0330):
>- Local CRD files with kustomize annotations
>- Dedicated deployment, service account, cluster role
>- User-facing editor/viewer ClusterRoles per CRD
>- Types registered in
pkg/operator/scheme.go under OpenShift feature gate>Jira: ACM-37236
>## Test plan
>- [x] go build ./... passes>- [x]
kustomize build deploy/olm/ renders all Thanos resources correctly>- [x]
go test ./... unit tests pass (e2e skipped — requires live cluster)>- [ ] Deploy to test cluster and verify CRDs are created
>🤖 Generated with Claude Code
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
</details>
github.com/thanos-community/thanos-operator is marked // indirect, but it's imported directly in pkg/operator/scheme.go (line 15). A go mod tidy should move it to the direct dependencies block.
The deployment passes --leader-elect (see thanos-operator-deployment.yaml:29), but this ClusterRole is missing permissions for coordination.k8s.io/leases. Since controller-runtime v0.19+ defaults to lease-based leader election, the operator pod may crash-loop with a forbidden error on startup.
Controllers need to emit Kubernetes events for status updates. The Perses ClusterRole includes events in the core API group. This one does not and I assume it's not inteded. Please let me know otherwise!. If not, the operator will log warnings or fail to record events at runtime.
I'd add events to the core API group resources, or as a separate rule:
main-2026-07-02-e6d1790 is a nightly build from main, not a release tag. This is fine for TechPreview, but we should track switching to a proper release tag before moving toward GA. Is there a released version of thanos-operator we can pin to already?
nit: Same dev tag note as on the deployment YAML.
Overall this LGTM, but I think that there may be a few issues. See inline comments. Thanks!
We have future work (https://redhat.atlassian.net/browse/COO-1969) to remove all second-level operators (e.g. Prometheus, Perses, ...) from the OLM CSV because it proved to be too inflexible. I suggest that we apply this decision to Thanos in advance.
Thanks for pointing it out. Totally missed the role and rolebinding for this from my POC PR
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: <a href="https://github.com/rhobs/observability-operator/pull/1151#" title="Author self-approved">coleenquadros</a>
Once this PR has been reviewed and has the lgtm label, please ask for approval from danielmellado. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
<details open>
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
</details>
<!-- META={"approvers":["danielmellado"]} -->
[!CAUTION]
Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.
> <details>
<summary>Error details</summary>
>> putComment timed out >
> </details>
thanos-community/thanos-operator has no tags or GitHub releases yet. Rhobs next points to nightly too I think @saswatamcode or @philipgough would be able to confirm
This is fine for upstream. Downstream we replace those image links anyway.
We have future work (https://redhat.atlassian.net/browse/COO-1969) to remove all second-level operators (e.g. Prometheus, Perses, ...) from the OLM CSV because it proved to be too inflexible. I suggest that we apply this decision to Thanos in advance.
I thought about the same, but I perhaps its better to not delay/block the thanos addition on that? We don't have a fix for all issues the bundle removal will cause and I doubt adding yet another operator to migrate adds significant overhead.
That is unless Coleen is interested in the work needed for COO-1969. I'd be happy to have this here, though I wouldn't want to block this on COO-1969.
Overall this lgtm, except for one nit:
Some RBAC releated resources specify namespace: default, but the operator deployment doesn't. Given that there might a leader election iiuc this could fail if someone deploys via the kustomization file. The operator deployment could end up in a different namespace then the SA and CRB allowing the leader election.
The easiest would be to set a namespace in kustomization.yaml
We do this for prometheus operator here:
https://github.com/rhobs/observability-operator/blob/27dfbb99c794941ece618dfae51516daf89b1438/deploy/dependencies/kustomization.yaml#L42
PR needs rebase.
<details>
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
</details>
danielmellado
coleenquadros
Summary
ACM-37236
Onboard the Thanos Operator into COO following the same pattern as the Perses operator onboarding.
deploy/thanos/directory with 5 CRDs (monitoring.thanos.io/v1alpha1), operator deployment, RBAC, and user-facing editor/viewer rolesdeploy/olm/kustomization.yamlgithub.com/thanos-community/thanos-operatorand register types in schemegenerate-thanos-op-crdsMakefile targetthanos-operatorimage incmd/operator/main.goCRDs added
| Kind | API Group | Scope |
|---|---|---|
| ThanosQuery | monitoring.thanos.io | Namespaced |
| ThanosReceive | monitoring.thanos.io | Namespaced |
| ThanosCompact | monitoring.thanos.io | Namespaced |
| ThanosStore | monitoring.thanos.io | Namespaced |
| ThanosRuler | monitoring.thanos.io | Namespaced |
API support level:
TechPreviewNoUpgradePattern followed
Same as Perses operator onboarding (commit 5ba0330):
pkg/operator/scheme.gounder OpenShift feature gateJira: ACM-37236
Test plan
go build ./...passeskustomize build deploy/olm/renders all Thanos resources correctlygo test ./...unit tests pass (e2e skipped — requires live cluster)🤖 Generated with Claude Code