Skip to content

CLOUDP-331496: Split operator roles into smaller templates #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

m1kola
Copy link
Contributor

@m1kola m1kola commented Jul 14, 2025

Summary

It becomes increasingly difficult to maintain operator roles in a single template. We recently fixed a series of issues (1, 2, 3) caused by this complexity. We are also looking into unifying installation experience for single cluster & multi cluster setups - having all roles in single template makes it hard to comprehend and re-use in this context.

This PR splits existing roles into multiple template files without changes to the roles. Instead of single operator-roles.yaml there are now the following templates:

  • operator-roles-base.yaml - main role for the operator. Roles in this template will likely be split further into smaller roles. We can derive PVC resize Role and Role binding from it, for example.
  • operator-roles-clustermongodbroles.yaml - Role giving permissions to clustermongodbroles resources.
  • operator-roles-telemetry.yaml - role defining permissions required for telemetry.
  • operator-roles-webhook.yaml - role defining permission for the operator to be able to register its own web hook.

Proof of Work

No functional changes. CI must be green.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you checked for release_note changes?

Reminder (Please remove this when merging)

  • Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible
  • Our Short Guide for PRs: Link
  • Remember the following Communication Standards - use comment prefixes for clarity:
    • blocking: Must be addressed before approval.
    • follow-up: Can be addressed in a later PR or ticket.
    • q: Clarifying question.
    • nit: Non-blocking suggestions.
    • note: Side-note, non-actionable. Example: Praise
    • --> no prefix is considered a question

@@ -0,0 +1,145 @@
{{ if .Values.operator.createOperatorServiceAccount }}
Copy link
Contributor Author

@m1kola m1kola Jul 14, 2025

Choose a reason for hiding this comment

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

This is used to be operator-roles.yaml. I moved telemetry, webhook and clustermongodbroles RBAC into separate templates. Rest of the file is unchanged.

@m1kola m1kola force-pushed the helm_smaller_templates branch from 80f9488 to 1ad4641 Compare July 14, 2025 15:29
@m1kola m1kola marked this pull request as ready for review July 14, 2025 15:29
@m1kola m1kola requested a review from a team as a code owner July 14, 2025 15:29
@m1kola m1kola changed the title Split operator roles into smaller templates CLOUDP-331496: Split operator roles into smaller templates Jul 15, 2025
Copy link
Member

@mircea-cosbuc mircea-cosbuc left a comment

Choose a reason for hiding this comment

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

LGTM!

@m1kola m1kola merged commit a14dcb7 into mongodb:master Jul 15, 2025
35 checks passed
@m1kola m1kola deleted the helm_smaller_templates branch July 15, 2025 10:36
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.

3 participants