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

Rework kubectl minio init as kustomize based #548

Merged

Conversation

dvaldivia
Copy link
Collaborator

@dvaldivia dvaldivia commented Mar 24, 2021

This PR reworks kubectl minio init and kubectl minio delete to use kustomize to apply all the files located at /resources/, this solves two problems:

  1. No longer need to keep init in sync with new resources unless there's a new command argument to tweak stuff
  2. performing upgrades is now easy as everything is applied via kubectl apply compared as kubectl create as before, for newer versions kubectl minio init will always perform an upgrade of the Operator resources

Additionally this PR introduces 3 new environment variables for operator TENANT_MINIO_IMAGE, TENANT_CONSOLE_IMAGE and TENANT_KES_IMAGE to default the images that are used by kubectl tenant create so that the images don't need to be specified every time if in an airgap environment.

Copy link
Contributor

@nitisht nitisht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed some files in /resources/base/ and built the plugin but don't see the new changes getting applied. What am i missing?

@dvaldivia
Copy link
Collaborator Author

@nitisht what file are you changing? after you change it and recompile and run init again yo should change something like configured for example, I changed console-ui.yaml to have a new environment variable and then recompiled and re-run init and got this output

namespace/minio-operator unchanged
serviceaccount/minio-operator unchanged
clusterrole.rbac.authorization.k8s.io/minio-operator-role unchanged
clusterrolebinding.rbac.authorization.k8s.io/minio-operator-binding unchanged
customresourcedefinition.apiextensions.k8s.io/tenants.minio.min.io configured
service/operator unchanged
deployment.apps/minio-operator configured
serviceaccount/console-sa unchanged
clusterrole.rbac.authorization.k8s.io/console-sa-role unchanged
clusterrolebinding.rbac.authorization.k8s.io/console-sa-binding unchanged
configmap/console-env unchanged
service/console unchanged
deployment.apps/console configured
-----------------

To open Operator UI, start a port forward using this command:

kubectl minio proxy -n minio-operator 

-----------------

Where deployment.apps/console configured indicates that deployment was changed, upon inspection I can see my new environment variable

@dvaldivia dvaldivia force-pushed the move-kubectl-minio-init-kustomize branch from 3a9d632 to 4119ee1 Compare March 24, 2021 18:25
Copy link
Contributor

@Alevsk Alevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works fine

@harshavardhana harshavardhana merged commit a102719 into minio:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants