Skip to content

Add support to define pool name during tenant creation/expansion #1322

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
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kubectl-minio/cmd/resources/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func tenantStorage(q resource.Quantity) corev1.ResourceList {
// Pool returns a Pool object from given values
func Pool(opts *TenantOptions, volumes int32, q resource.Quantity) miniov2.Pool {
p := miniov2.Pool{
Name: opts.PoolName,
Servers: opts.Servers,
VolumesPerServer: volumes,
VolumeClaimTemplate: &corev1.PersistentVolumeClaim{
Expand Down
1 change: 1 addition & 0 deletions kubectl-minio/cmd/resources/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
// TenantOptions encapsulates the CLI options for a MinIO Tenant
type TenantOptions struct {
Name string
PoolName string
ConfigurationSecretName string
Servers int32
Volumes int32
Expand Down
3 changes: 2 additions & 1 deletion kubectl-minio/cmd/tenant-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func newTenantCreateCmd(out io.Writer, errOut io.Writer) *cobra.Command {
c := &createCmd{out: out, errOut: errOut}

cmd := &cobra.Command{
Use: "create <TENANTNAME> --servers <NSERVERS> --volumes <NVOLUMES> --capacity <SIZE> --namespace <TENANTNS>",
Use: "create <TENANTNAME> --pool <POOLNAME> --servers <NSERVERS> --volumes <NVOLUMES> --capacity <SIZE> --namespace <TENANTNS>",
Short: "Create a MinIO tenant",
Long: createDesc,
Example: createExample,
Expand All @@ -77,6 +77,7 @@ func newTenantCreateCmd(out io.Writer, errOut io.Writer) *cobra.Command {
}
cmd = helpers.DisableHelp(cmd)
f := cmd.Flags()
f.StringVarP(&c.tenantOpts.PoolName, "pool", "p", "", "name for this pool")
f.Int32Var(&c.tenantOpts.Servers, "servers", 0, "total number of pods in MinIO tenant")
f.Int32Var(&c.tenantOpts.Volumes, "volumes", 0, "total number of volumes in the MinIO tenant")
f.StringVar(&c.tenantOpts.Capacity, "capacity", "", "total raw capacity of MinIO tenant in this pool, e.g. 16Ti")
Expand Down
3 changes: 2 additions & 1 deletion kubectl-minio/cmd/tenant-expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func newTenantExpandCmd(out io.Writer, errOut io.Writer) *cobra.Command {
v := &expandCmd{out: out, errOut: errOut}

cmd := &cobra.Command{
Use: "expand <TENANTNAME> --servers <NSERVERS> --volumes <NVOLUMES> --capacity <SIZE>",
Use: "expand <TENANTNAME> --pool <POOLNAME> --servers <NSERVERS> --volumes <NVOLUMES> --capacity <SIZE> --namespace <TENANTNS>",
Short: "Add capacity to existing tenant",
Long: expandDesc,
Example: expandExample,
Expand All @@ -70,6 +70,7 @@ func newTenantExpandCmd(out io.Writer, errOut io.Writer) *cobra.Command {
cmd = helpers.DisableHelp(cmd)
f := cmd.Flags()
f.StringVarP(&v.tenantOpts.NS, "namespace", "n", "", "k8s namespace for this MinIO tenant")
f.StringVarP(&v.tenantOpts.PoolName, "pool", "p", "", "name for this pool expansion")
f.Int32Var(&v.tenantOpts.Servers, "servers", 0, "total number of pods to add to tenant")
f.Int32Var(&v.tenantOpts.Volumes, "volumes", 0, "total number of volumes to add to tenant")
f.StringVar(&v.tenantOpts.Capacity, "capacity", "", "total raw capacity to add to tenant, e.g. 16Ti")
Expand Down