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

distributedstorage: Implementing rook installation using the fleet pl… #413

Merged
merged 3 commits into from
Oct 26, 2023
Merged

distributedstorage: Implementing rook installation using the fleet pl… #413

merged 3 commits into from
Oct 26, 2023

Conversation

LiZhenCheng9527
Copy link
Contributor

…ugin

What type of PR is this?
Distributed Storage Implementation

What this PR does / why we need it:
Implementing rook installation using the fleet plugin.

…ugin

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for kurator-dev canceled.

Name Link
🔨 Latest commit f42164d
🔍 Latest deploy log https://app.netlify.com/sites/kurator-dev/deploys/653a02098109020008e1d7a1


// After Rook operator are created, starts to install rook-ceph
if distributedStorageCfg.Storage == nil {
// reconcilePluginResources will delete all resources if plugin is nil
Copy link
Member

Choose a reason for hiding this comment

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

cc @Xieql

We donot support plugin uninstall now, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

we support uninstall plugin. see https://kurator.dev/docs/fleet-manager/backup/backup-plugin/

1. Cleanup the Backup Plugin
If you only need to remove the backup plugin, simply edit the current fleet and remove the corresponding description:

kubectl edit fleet.fleet.kurator.dev quickstart
To check the results of the deletion, you can observe that the Velero components have been removed:

kubectl get po -A --kubeconfig=/root/.kube/kurator-member1.config
kubectl get po -A --kubeconfig=/root/.kube/kurator-member2.config
If you wish to reinstall the components later, you can simply edit the fleet and add the necessary configurations.

2. Cleanup the Fleet
When the fleet is deleted, all associated plugins will also be removed:

kubectl delete fleet.fleet.kurator.dev quickstart

Copy link
Contributor

@Xieql Xieql Oct 24, 2023

Choose a reason for hiding this comment

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

IIRC, the uninstall is supported by FluxCD. If helmrelease is removed,the uninstall will be proformed

Copy link
Contributor

Choose a reason for hiding this comment

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

see

// reconcilePluginResources delete redundant HelmRelease and HelmRepository resources,
// for example, disable metric plugin will try to delete metric plugin resources.
func (f *FleetManager) reconcilePluginResources(ctx context.Context, fleet *fleetapi.Fleet, resources kube.ResourceList) (ctrl.Result, error) {

Copy link
Member

Choose a reason for hiding this comment

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

Thanks i find it

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
if monitorCfg.Annotations != nil {
_, ok := customValues["annotations"]
if !ok {
monitorMap := make(map[string]interface{})
Copy link
Member

Choose a reason for hiding this comment

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

This is not only monitor map, this annotationMap for all the components

monitorMap["mon"] = monitorCfg.Annotations
customValues["annotations"] = monitorMap
} else {
monitorMap := customValues["annotations"].(map[string]interface{})
Copy link
Member

Choose a reason for hiding this comment

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

nit: In L379, you already got the map

defaultValues := c.Values
// In the rook, the Labels, annotation and Placement of Monitor and manager are configured under the Labels, annotation and Placement fields.
// So it need to be rebuild customValues using user settings in distributedStorage.
customValues := make(map[string]interface{})
Copy link
Member

Choose a reason for hiding this comment

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

please abstract below values construction into a separate function

Signed-off-by: LiZhenCheng9527 <lizhencheng6@huawei.com>
Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/LGTM

@kurator-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

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

The pull request process is described 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

@kurator-bot kurator-bot merged commit 47f6266 into kurator-dev:main Oct 26, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants