Skip to content
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

add an overview of the nonadmin backup controller #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weshayutin
Copy link
Contributor

  • yes this was written by ai :)

Why the changes were made

A nice quick summary of the controller

How to test the changes made

read it

* yes this was written by ai :)

Signed-off-by: Wesley Hayutin <[email protected]>
Copy link

openshift-ci bot commented Sep 11, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: weshayutin
Once this PR has been reviewed and has the lgtm label, please assign shubham-pampattiwar for approval. For more information see the Kubernetes Code Review Process.

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

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


## Purpose

The primary goal of this controller is to allow users with limited permissions (non-admins) to trigger and manage Velero backups within their namespaces. It acts as an intermediary between the non-admin user and Velero, ensuring that backups are created and managed securely within the defined boundaries.
Copy link
Collaborator

Choose a reason for hiding this comment

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

?
Within the namespaces to which they have access to

Copy link
Collaborator

Choose a reason for hiding this comment

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

this sounds ai'ish, talk about everything and nothing:
ensuring that backups are created and managed securely within the defined boundaries.

### NonAdminBackup Custom Resource

* Represents a backup request initiated by a non-admin user.
* Contains a `BackupSpec` field, which mirrors the Velero `BackupSpec` and defines what to back up.
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the current discussion it doesn't mirror the Velero BackupSpec but it's used to create BackupSpec

### NonAdminBackupReconciler

* The core controller responsible for processing `NonAdminBackup` resources.
* Watches for changes to `NonAdminBackup` objects and triggers reconciliation loops.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It also watches changes to the Velero Backup and updaates the NonAdminBackup

* **ValidateSpec:** Ensures the provided `BackupSpec` is valid and adheres to security constraints.
* Rejects backups targeting namespaces outside the user's allowed scope.
* Sets appropriate conditions on the `NonAdminBackup` object to indicate success or failure.
* **UpdateSpecStatus:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Based on the comment from @shubham-pampattiwar this function will probably be changed to some other name.

1. **User Creates NonAdminBackup:** A non-admin user creates a `NonAdminBackup` object, specifying the resources to back up within their namespace.
2. **Controller Detects Creation:** The `NonAdminBackupReconciler` detects the new object and triggers a reconciliation loop.
3. **Validation and Creation:** The controller validates the `BackupSpec` and creates a corresponding `VeleroBackup` object in the designated OADP namespace.
4. **Status Synchronization:** The controller continuously monitors the `VeleroBackup` and updates the `NonAdminBackup` status, reflecting the progress and completion state.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice.

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