Skip to content

Commit c8b5c7b

Browse files
authored
expose services (minio#1374)
add option to krew plugin command `kubectl minio tenant create` to enable expose services as LB
1 parent 6977fbd commit c8b5c7b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

kubectl-minio/cmd/resources/tenant.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type TenantOptions struct {
4444
ImagePullSecret string
4545
DisableAntiAffinity bool
4646
EnableAuditLogs bool
47+
ExposeMinioService bool
48+
ExposeConsoleService bool
4749
AuditLogsDiskSpace int32
4850
AuditLogsImage string
4951
AuditLogsPGImage string
@@ -132,6 +134,10 @@ func NewTenant(opts *TenantOptions, userSecret *v1.Secret) (*miniov2.Tenant, err
132134
Configuration: &v1.LocalObjectReference{
133135
Name: opts.ConfigurationSecretName,
134136
},
137+
ExposeServices: &miniov2.ExposeServices{
138+
Console: opts.ExposeConsoleService,
139+
MinIO: opts.ExposeMinioService,
140+
},
135141
Pools: []miniov2.Pool{Pool(opts, volumesPerServer, *capacityPerVolume)},
136142
RequestAutoCert: &autoCert,
137143
Mountpath: helpers.MinIOMountPath,

kubectl-minio/cmd/tenant-create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ func newTenantCreateCmd(out io.Writer, errOut io.Writer) *cobra.Command {
102102
f.StringVar(&c.tenantOpts.PrometheusStorageClass, "prometheus-storage-class", "", "(Only used when enable-prometheus is on) Storage class for prometheus")
103103
f.BoolVarP(&c.output, "output", "o", false, "generate tenant yaml for 'kubectl apply -f tenant.yaml'")
104104
f.BoolVar(&c.tenantOpts.Interactive, "interactive", false, "Create tenant in interactive mode")
105+
f.BoolVar(&c.tenantOpts.ExposeMinioService, "expose-minio-service", false, "Enable/Disable expose the Minio Service")
106+
f.BoolVar(&c.tenantOpts.ExposeConsoleService, "expose-console-service", false, "Enable/Disable expose the Console service")
105107
return cmd
106108
}
107109

@@ -205,6 +207,8 @@ func (c *createCmd) populateInteractiveTenant() error {
205207
if c.tenantOpts.EnablePrometheus {
206208
c.populatePrometheus()
207209
}
210+
c.tenantOpts.ExposeMinioService = helpers.Ask("Expose Minio Service")
211+
c.tenantOpts.ExposeConsoleService = helpers.Ask("Expose Console Service")
208212
return nil
209213
}
210214

0 commit comments

Comments
 (0)