[ACTP] Extend PAR k8s RBAC in DCA for kubetray use cases#3222
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1107985 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acf7bc61ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Resources: []string{rbac.StatefulsetsResource}, | ||
| Verbs: []string{rbac.PatchVerb}, |
There was a problem hiding this comment.
Grant ControllerRevision reads for StatefulSet rollback
For the new StatefulSet rollback use case, patching statefulsets is not enough: the standard Kubernetes rollback path first lists apps/controllerrevisions owned by the StatefulSet and only then patches the StatefulSet. This remediation ClusterRole still omits controllerrevisions (repo-wide search only finds that resource in other feature RBAC), so PAR-in-DCA rollback attempts will continue to be forbidden unless another unrelated feature happens to grant that permission.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
👀 looking into it
There was a problem hiding this comment.
Legit but I think it depends on the implementation. I'd like the kubeactions implementation to confirm this first. And we might not need it https://github.com/DataDog/datadog-operator/pull/3099/changes#diff-212b7de7fc8880b2b8472458adefcf33da1ac04535df6dc55d5a4e053f90af4f
acf7bc6 to
76722a0
Compare
80ff10f to
c8cfed8
Compare
Add pod delete and statefulset patch permissions to the PAR-in-DCA remediation ClusterRole, as decided in ADRAP-43. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
c8cfed8 to
6f5b596
Compare

What does this PR do?
Extends the Kubernetes RBAC permissions for the Private Action Runner (PAR) running inside the Datadog Cluster Agent (DCA) to unblock kubetray use cases.
Motivation
Kubetray requires two operations not previously supported by PAR-in-DCA:
delete: needed for pod restart flows; safe because pods managed by a Deployment/StatefulSet are recreated automatically by their controller.patch: enables restart, rollback, and scale operations on StatefulSets (analogous to how Deployment restart/scale is already done via patch).Additional Notes
StatefulSet
get/list/watchwas already present in the read rule; this PR addspatchin a separate write rule, keeping read and write rules distinct. The permissions are within the maximum set the DCA itself can have when all features are enabled.Minimum Agent Versions
N/A — operator-side RBAC change only.
Describe your test plan
Deployed the operator on a local cluster and then ran
k get clusterrole datadog-private-action-runner -o yamland verified we have the new permissions.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel