Skip to content

frontend: ClusterTable: Add delete cluster functionality #3339

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

userAdityaa
Copy link
Contributor

@userAdityaa userAdityaa commented May 23, 2025

PR Description

Overview

This PR introduces new features to enhance cluster management in the Kubernetes dashboard. It modifies ClusterContextMenu.tsx to allow single cluster deletion for all cluster types (previously limited to plugin-based clusters) and adds bulk delete functionality in ClusterTable.tsx. Additionally, it improves the toolbar button layout for a more polished UI.

Why This Change?

Previously, cluster deletion was restricted to plugin-based (dynamic_cluster) clusters, which limited the ability to manage other cluster types, such as those sourced from kubeconfig or in_cluster. Expanding single delete to all cluster types provides greater flexibility for users to manage their clusters. Additionally, introducing bulk delete functionality enables users to remove multiple clusters at once, streamlining workflows and improving efficiency in cluster management.

Screenshots of the changes

  1. Single Removal of Cluster
Screenshot 2025-05-23 at 11 46 32 PM
  1. Confirmation dialog for single cluster
Screenshot 2025-05-23 at 11 47 00 PM
  1. Bulk Delete of Clusters
Screenshot 2025-05-23 at 11 47 45 PM
  1. Confirmation Dialog for bulk removal
Screenshot 2025-05-23 at 11 47 57 PM
  1. Successful removal Snackbar
Screenshot 2025-05-23 at 11 25 32 PM
  1. Failure removal Snackbar
Screenshot 2025-05-23 at 11 28 05 PM

Fixes #3053

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 23, 2025
@k8s-ci-robot k8s-ci-robot requested review from illume and skoeva May 23, 2025 13:57
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: userAdityaa
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the 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

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 23, 2025
@illume
Copy link
Contributor

illume commented May 23, 2025

Very cool. Thanks.

By the way... I think we have a confusion. To me deleting a cluster means deleting it. If delete just removes it from the kubeconfig... I was wondering if we should call it "remove"? With a tooltip "Remove cluster context from kube/.config" or so? I think we need to somehow make it more clear what it does. Just reading delete or remove doesn't really make clear what's going to happen.

btw. We also have delete in the minikube plugin for clusters. And that ones deletes them. Stop on the other hand stops them, and removes the entry from the kube/.config.

@userAdityaa
Copy link
Contributor Author

Very cool. Thanks.

By the way... I think we have a confusion. To me deleting a cluster means deleting it. If delete just removes it from the kubeconfig... I was wondering if we should call it "remove"? With a tooltip "Remove cluster context from kube/.config" or so? I think we need to somehow make it more clear what it does. Just reading delete or remove doesn't really make clear what's going to happen.

btw. We also have delete in the minikube plugin for clusters. And that ones deletes them. Stop on the other hand stops them, and removes the entry from the kube/.config.

Yes, that makes sense. I've gone ahead and updated it to Removal. For now, I've only implemented the Removal of the cluster, but I do have plans to integrate Permanent Deletion as well. I'll create a PR for that as soon as I get a chance.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 23, 2025
@userAdityaa userAdityaa marked this pull request as ready for review May 23, 2025 18:34
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 23, 2025
@k8s-ci-robot k8s-ci-robot requested a review from vyncent-t May 23, 2025 18:34
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Looking good.

Would you mind putting the locale changes into each commit where the change happens? This way each commit will pass tests and therefore be atomic commits.

@userAdityaa
Copy link
Contributor Author

Looking good.

Would you mind putting the locale changes into each commit where the change happens? This way each commit will pass tests and therefore be atomic commits.

I’ve now included the translations along with the changes in the same commit :)

@illume
Copy link
Contributor

illume commented May 23, 2025

Thanks for that!

I'll come back to test it tomorrow or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to delete cluster
3 participants