Skip to content

Comments

operator: Include ClusterRole permission for redpanda controller#542

Merged
RafalKorepta merged 1 commit intomainfrom
rk/fix-integration-tests-in-main
Mar 20, 2025
Merged

operator: Include ClusterRole permission for redpanda controller#542
RafalKorepta merged 1 commit intomainfrom
rk/fix-integration-tests-in-main

Conversation

@RafalKorepta
Copy link
Contributor

In the redpanda package the kubebuilder comment does not have all possible variants of ClusterRole permissions neccessery to handle creation of all Redpanda helm chart resources. During integration test suite execution controller runtime complain about leases permissions missing.

error: deploying *v1.Role: \"rp-4bpw0i-sidecar-controllers\":
roles.rbac.authorization.k8s.io \"rp-4bpw0i-sidecar-controllers\" is forbidden:
user \"system:serviceaccount:testenv-wm758:testenv-pzy3ce\"
(groups=[\"system:serviceaccounts\" \"system:serviceaccounts:testenv-wm758\" \"system:authenticated\"])
is attempting to grant RBAC permissions not currently held:
{APIGroups:[\"coordination.k8s.io\"], Resources:[\"leases\"], Verbs:[\"create\" \"delete\" \"get\" \"list\" \"patch\" \"update\" \"watch\"]}"

The setup of integration test suite included only permissions defined in redpanda package. Kustomize and Operator helm chart includes those missing permissions.

The failure started from #521 PR

In the redpanda package the kubebuilder comment does not have all possible
variants of ClusterRole permissions neccessery to handle creation of all
Redpanda helm chart resources. During integration test suite execution
controller runtime complain about leases permissions missing.

```
error: deploying *v1.Role: \"rp-4bpw0i-sidecar-controllers\":
roles.rbac.authorization.k8s.io \"rp-4bpw0i-sidecar-controllers\" is forbidden:
user \"system:serviceaccount:testenv-wm758:testenv-pzy3ce\"
(groups=[\"system:serviceaccounts\" \"system:serviceaccounts:testenv-wm758\" \"system:authenticated\"])
is attempting to grant RBAC permissions not currently held:
{APIGroups:[\"coordination.k8s.io\"], Resources:[\"leases\"], Verbs:[\"create\" \"delete\" \"get\" \"list\" \"patch\" \"update\" \"watch\"]}"
```

The setup of integration test suite included only permissions defined in redpanda package.
Kustomize and Operator helm chart includes those missing permissions.
Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

LGTM as is but I wonder if it'd be better to disable the K8S API integrations of the sidecars when they're deployed from the operator.

@RafalKorepta
Copy link
Contributor Author

LGTM as is but I wonder if it'd be better to disable the K8S API integrations of the sidecars when they're deployed from the operator.

It's not possible to disable leases that needs to be created in order to deploy even single Redapnda Pod.

@RafalKorepta RafalKorepta merged commit c68d839 into main Mar 20, 2025
12 checks passed
@RafalKorepta RafalKorepta deleted the rk/fix-integration-tests-in-main branch March 28, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants