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

Storage proposal #385

Merged
merged 1 commit into from
Oct 8, 2023
Merged

Storage proposal #385

merged 1 commit into from
Oct 8, 2023

Conversation

LiZhenCheng9527
Copy link
Contributor

What type of PR is this?

/kind design
/kind documentation

What this PR does / why we need it:
add proposal aimed to enhance Kurator by introducing unified distributed storage capabilities.
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


add proposal for unified distributed storage

@kurator-bot
Copy link
Collaborator

@LiZhenCheng9527: The label(s) kind/design cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind design
/kind documentation

What this PR does / why we need it:
add proposal aimed to enhance Kurator by introducing unified distributed storage capabilities.
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


add proposal for unified distributed storage

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@netlify
Copy link

netlify bot commented Sep 15, 2023

Deploy Preview for kurator-dev ready!

Name Link
🔨 Latest commit 8c8ffcd
🔍 Latest deploy log https://app.netlify.com/sites/kurator-dev/deploys/65221542e4869f0008ea1950
😎 Deploy Preview https://deploy-preview-385--kurator-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved

// ClusterSpec indicates the state that the cluster wants to be in
// +optional
ClusterSpec StorageClusterSpec `json:"spec"`
Copy link
Contributor

@Xieql Xieql Sep 18, 2023

Choose a reason for hiding this comment

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

what if multiple clusters use the same StorageClusterSpec?
Is there a potential for duplicate StorageClusterSpec definitions if multiple clusters use the same spec?
you can consider fleet cluster, see

func buildFleetClusters(ctx context.Context, client client.Client, fleet *fleetapi.Fleet) (map[ClusterKey]*fleetCluster, error) {
log := ctrl.LoggerFrom(ctx)
res := make(map[ClusterKey]*fleetCluster, len(fleet.Spec.Clusters))
for _, cluster := range fleet.Spec.Clusters {
clusterKey := types.NamespacedName{Namespace: fleet.Namespace, Name: cluster.Name}
clusterInterface, err := getFleetClusterInterface(ctx, client, cluster.Kind, clusterKey)
// TODO: should we make it work
if err != nil {
return nil, err
}
if !clusterInterface.IsReady() {
log.V(4).Info("cluster is not ready", "cluster", clusterKey)
continue
}
kclient, err := clientForCluster(client, fleet.Namespace, clusterInterface)
if err != nil {
return nil, err
}
res[ClusterKey{Kind: cluster.Kind, Name: cluster.Name}] = &fleetCluster{
Secret: clusterInterface.GetSecretName(),
SecretKey: clusterInterface.GetSecretKey(),
client: kclient,
}
}
return res, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously I thought fleet was able to filter managed clusters by label, but fleet doesn't support it. It will allow users to directly specify which clusters use the same ClusterSpec to avoid having multiple identical ClusterSpecs.

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.

This is not user friendly.

Keep in mind, when design an api, it is a user-faced one, we should put UX as the highest priority.

For this target, we should expose only necessary settings with explicitly readable fields.

docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
- **unified distributed cloud storage**
- Supports three types of storage: Block storage, Filesystem storage and Object storage.
- Support for scoping different storage types by name, label, and Annotation.
- Support for applying these policies to multiple clusters or a single cluster.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what policies you mean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

policy means storage type policies on nodes. To make the description clearer, third bullet point will be modified to Support for applying storage type policies on nodes to multiple clusters.

And The second bullet will be modified to Support for specifying different storage types at different nodes by name, label and annotation.

docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved

- **unified distributed cloud storage**
- Supports three types of storage: Block storage, Filesystem storage and Object storage.
- Support for scoping different storage types by name, label, and Annotation.
Copy link
Member

Choose a reason for hiding this comment

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

what does scoping mean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scoping means delimit the use of a storage type.

It is not clearly expressed here and will be modified to Support for specifying different storage types at different nodes by name, label and annotation.

and make progress.
-->

- **support for another distributed storage system** Rook only supports ceph distributed storage system, so it does not support other distributed storage systems.
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 an implementation detail.

NON-goals should be like this, do not support XXX storage, do not support storage backup/snapshot

docs/proposals/distributedstorage/distributedstorage.md Outdated Show resolved Hide resolved
// The annotations-related configuration to add/set on each Pod related object.
// +nullable
// +optional
Annotations rookv1.AnnotationsSpec `json:"annotations,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

What are these annotations for? It it a must?

// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// +optional
Labels rookv1.LabelsSpec `json:"labels,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

same questions as annotations

Comment on lines 215 to 221
Mon MonSpec `json:"mon,omitempty"`

// mgr is responsible for connect between the node and operator
// A spec for mgr related options
// +optional
// +nullable
Mgr MgrSpec `json:"mgr,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

As a user, i cannot understand these two fields at all

// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// +optional
Placement PlacementSpec `json:"placement,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

place what?

// e.g. /var/lib/rook
// +kubebuilder:validation:Pattern=`^/(\S+)`
// +optional
DataDirHostPath string `json:"dataDirHostPath,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

which component uses this config

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.

I think it is still lack of the usage info, please put it under the plugins

-->
Kurator, as an open-source distributed cloud-native platform, has been pivotal in aiding users to construct their distributed cloud-native infrastructure, thereby facilitating enterprise digital transformation.

In order to further enhance its functionality, this proposal introduces a unified solution for distributed storage across multiple clsuters in `Fleet` through a seamless one-click operation.
Copy link
Member

Choose a reason for hiding this comment

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

clsuters typo

// +optional
DataDirHostPath string `json:"dataDirHostPath,omitempty"`

// Monitor is the daemon for the state of ceph cluster.
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 a sentence, can you complete it

```console
// DistributedStorageSpec is the schema for the DistributedStorage's API.
// Note: partly copied from https://github.com/rook/rook/blob/release-1.10/pkg/apis/ceph.rook.io/v1/types.go
type DistributedStorageSpec struct {
Copy link
Member

Choose a reason for hiding this comment

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

Please donot call xxxSpec, unless it is a separate CRD

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.

Generally LGTM

// +optional
Chart *ChartConfig `json:"chart,omitempty"`

// Storage provides details on where the backup data should be stored.
Copy link
Member

Choose a reason for hiding this comment

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

remove on

Copy link
Member

Choose a reason for hiding this comment

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

why should you mention backup?

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

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