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

Added option to pass KES image while tenant create #1808

Merged
merged 1 commit into from
Oct 16, 2023
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
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