Skip to content

Commit

Permalink
Added option to pass KES image while tenant create (#1808)
Browse files Browse the repository at this point in the history
Use option `--kes-image` to provide custom KES image URL

Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
  • Loading branch information
shtripat committed Oct 16, 2023
1 parent d4c1641 commit 47106d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kubectl-minio/cmd/resources/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type TenantOptions struct {
Capacity string
NS string
Image string
KesImage string
StorageClass string
KmsSecret string
ConsoleSecret string
Expand Down Expand Up @@ -79,11 +80,11 @@ func tenantKESLabels(name string) map[string]string {
return m
}

func tenantKESConfig(tenant, secret string) *miniov2.KESConfig {
func tenantKESConfig(tenant, secret, kesImage string) *miniov2.KESConfig {
if secret != "" {
return &miniov2.KESConfig{
Replicas: helpers.KESReplicas,
Image: helpers.DefaultKESImage,
Image: kesImage,
Configuration: &v1.LocalObjectReference{
Name: secret,
},
Expand Down Expand Up @@ -130,7 +131,7 @@ func NewTenant(opts *TenantOptions, userSecret *v1.Secret) (*miniov2.Tenant, err
Pools: []miniov2.Pool{Pool(opts, volumesPerServer, *capacityPerVolume)},
RequestAutoCert: &autoCert,
Mountpath: helpers.MinIOMountPath,
KES: tenantKESConfig(opts.Name, opts.KmsSecret),
KES: tenantKESConfig(opts.Name, opts.KmsSecret, opts.KesImage),
ImagePullSecret: v1.LocalObjectReference{Name: opts.ImagePullSecret},
Users: []*v1.LocalObjectReference{
{
Expand Down
1 change: 1 addition & 0 deletions kubectl-minio/cmd/tenant-create.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func newTenantCreateCmd(out io.Writer, errOut io.Writer) *cobra.Command {
f.StringVarP(&c.tenantOpts.NS, "namespace", "n", "", "k8s namespace for this MinIO tenant")
f.StringVarP(&c.tenantOpts.StorageClass, "storage-class", "s", helpers.DefaultStorageclass, "storage class for this MinIO tenant")
f.StringVarP(&c.tenantOpts.Image, "image", "i", helpers.DefaultTenantImage, "custom MinIO image for this tenant")
f.StringVarP(&c.tenantOpts.KesImage, "kes-image", "", helpers.DefaultKESImage, "custom KES image for this tenant")
f.StringVarP(&c.tenantOpts.ImagePullSecret, "image-pull-secret", "", "", "image pull secret to be used for pulling MinIO")
f.BoolVar(&c.tenantOpts.DisableAntiAffinity, "enable-host-sharing", false, "[TESTING-ONLY] disable anti-affinity to allow pods to be co-located on a single node (unsupported in production environment)")
f.StringVar(&c.tenantOpts.KmsSecret, "kes-config", "", "name of secret for KES KMS setup, refer https://github.com/minio/operator/blob/master/examples/kes-secret.yaml")
Expand Down

0 comments on commit 47106d6

Please sign in to comment.