diff --git a/addons/minio/disable b/addons/minio/disable index 6c33d30..85b4fcb 100755 --- a/addons/minio/disable +++ b/addons/minio/disable @@ -3,7 +3,13 @@ echo "Cleaning up MinIO tenants and operator" HELM="$SNAP/microk8s-helm3.wrapper" +KUBECTL="$SNAP/microk8s-kubectl.wrapper" NAMESPACE="minio-operator" + +# Delete the secret we created for the tenant. +tenant_name="$($HELM list -n $NAMESPACE --short | grep -v 'minio-operator')" +$KUBECTL delete -n $NAMESPACE secret "${tenant_name}-user-1" + $HELM list -n $NAMESPACE --short | xargs $HELM uninstall -n $NAMESPACE echo "Disabled minio addon." diff --git a/addons/minio/enable b/addons/minio/enable index 5cb0320..11820f1 100755 --- a/addons/minio/enable +++ b/addons/minio/enable @@ -88,6 +88,15 @@ if [ "x${CREATE_TENANT}" = "xyes" ]; then echo " Prometheus: ${PROMETHEUS}" echo "" + # Previously, kubectl-minio created an additional user. We will create here as well. + # This is done by creating a secret containing CONSOLE_ACCESS_KEY and CONSOLE_SECRET_KEY + # and referencing it in the helm chart below. + KUBECTL="$SNAP/microk8s-kubectl.wrapper" + SECRET_NAME="${TENANT}-user-1" + $KUBECTL create -n minio-operator secret generic "${SECRET_NAME}" \ + --from-literal=CONSOLE_ACCESS_KEY="$(tr -dc A-Za-z0-9