Skip to content

Commit

Permalink
expose services (#1374)
Browse files Browse the repository at this point in the history
add option to krew plugin command `kubectl minio tenant create` to enable expose services as LB
  • Loading branch information
pjuarezd committed Dec 19, 2022
1 parent 6977fbd commit c8b5c7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kubectl-minio/cmd/resources/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type TenantOptions struct {
ImagePullSecret string
DisableAntiAffinity bool
EnableAuditLogs bool
ExposeMinioService bool
ExposeConsoleService bool
AuditLogsDiskSpace int32
AuditLogsImage string
AuditLogsPGImage string
Expand Down Expand Up @@ -132,6 +134,10 @@ func NewTenant(opts *TenantOptions, userSecret *v1.Secret) (*miniov2.Tenant, err
Configuration: &v1.LocalObjectReference{
Name: opts.ConfigurationSecretName,
},
ExposeServices: &miniov2.ExposeServices{
Console: opts.ExposeConsoleService,
MinIO: opts.ExposeMinioService,
},
Pools: []miniov2.Pool{Pool(opts, volumesPerServer, *capacityPerVolume)},
RequestAutoCert: &autoCert,
Mountpath: helpers.MinIOMountPath,
Expand Down
4 changes: 4 additions & 0 deletions kubectl-minio/cmd/tenant-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ func newTenantCreateCmd(out io.Writer, errOut io.Writer) *cobra.Command {
f.StringVar(&c.tenantOpts.PrometheusStorageClass, "prometheus-storage-class", "", "(Only used when enable-prometheus is on) Storage class for prometheus")
f.BoolVarP(&c.output, "output", "o", false, "generate tenant yaml for 'kubectl apply -f tenant.yaml'")
f.BoolVar(&c.tenantOpts.Interactive, "interactive", false, "Create tenant in interactive mode")
f.BoolVar(&c.tenantOpts.ExposeMinioService, "expose-minio-service", false, "Enable/Disable expose the Minio Service")
f.BoolVar(&c.tenantOpts.ExposeConsoleService, "expose-console-service", false, "Enable/Disable expose the Console service")
return cmd
}

Expand Down Expand Up @@ -205,6 +207,8 @@ func (c *createCmd) populateInteractiveTenant() error {
if c.tenantOpts.EnablePrometheus {
c.populatePrometheus()
}
c.tenantOpts.ExposeMinioService = helpers.Ask("Expose Minio Service")
c.tenantOpts.ExposeConsoleService = helpers.Ask("Expose Console Service")
return nil
}

Expand Down

0 comments on commit c8b5c7b

Please sign in to comment.