Addon: MinIO

1.28
Compatibility: amd64 arm64
Source: See MinIO documentation

MinIO is a well-known and established project in the CNCF ecosystem that provides cloud-agnostic S3-compatible object storage. It is free, open-source and well-trusted by multiple organizations.

The minio addon can be used to deploy MinIO on a MicroK8s cluster using minio-operator. Optionally, this addon deploys a single MinIO tenant so that you can get started using it out of the box. The default tenant can be configured (storage capacity, number of volumes, security) using command-line arguments when enabling the addon (see below).

The MinIO addon can use the simple hostpath storage for single-node clusters, or any storage class you decide for multi-node clusters.

Enable

For single-node development clusters, enable the MinIO addon with a single command:

sudo microk8s enable minio

For a more advanced use-case (see sudo microk8s enable minio:-h for a list of all supported arguments), that deploys a MinIO tenant with 300GB storage capacity using the ceph-xfs storage class:

sudo microk8s enable minio -c 300Gi -s ceph-xfs

Alternatively, you can disable the creation of a default tenant and only deploy the MinIO operator with:

sudo microk8s enable minio -k

Access S3 endpoint and MinIO console

After deployment, you can access the MinIO console through a web browser, or through the MinIO client. You can access the MinIO endpoint through the svc/minio endpoint:

microk8s kubectl -n minio-operator get svc minio

The root user and password created for the MinIO tenant can be seen in the $TENANT_NAME-env-configuration secret:

TENANT_NAME="microk8s"
# The credentials are in the config.env field.
# They are in base64 and they need to be decoded.
microk8s kubectl get -n minio-operator secret $TENANT_NAME-env-configuration -o yaml

# Fetch and decode the credentials:
microk8s kubectl get -n minio-operator secret $TENANT_NAME-env-configuration -o jsonpath='{.data.config\.env}' | base64 -d
# Expected similar output:
# export MINIO_ROOT_USER="GYBCXGDRPSV1R08QX1DF"
# export MINIO_ROOT_PASSWORD="2n3MUksjHavRy2HmyvuE9JtnUsMI2YV2hxV4QF5X"

The Microk8s MinIO addon also creates a secondary user. You can get its credentials through the following:

TENANT_NAME="microk8s"
# The credentials are in the CONSOLE_ACCESS_KEY (user) and CONSOLE_SECRET_KEY (password) fields.
# They are in base64 and they need to be decoded.
microk8s kubectl get -n minio-operator secret $TENANT_NAME-user-1 -o yaml

Using the mc client

You can use the MinIO client to connect to the MinIO tenant. The same credentials described above can be used. Below is a script which creates an alias for the deployed MinIO tenant using the root user credentials:

# Get HOST and PORT.
HOST="$(microk8s kubectl get -n minio-operator service minio -o jsonpath='{.spec.clusterIP}')"
PORT="$(microk8s kubectl get -n minio-operator service minio -o jsonpath='{.spec.ports[0].port}')"

# Fetch, decode, and load the root user credentials into the environment:
TENANT_NAME="microk8s"
source <(microk8s kubectl get -n minio-operator secret $TENANT_NAME-env-configuration -o jsonpath='{.data.config\.env}' | base64 -d)
mc alias set $TENANT_NAME http://$HOST:$PORT $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD

Alternatively, you use the other MinIO registered user credentials:

TENANT_NAME="microk8s"
MINIO_USER="$(microk8s kubectl get -n minio-operator secret $TENANT_NAME-user-1 -o jsonpath='{.data.CONSOLE_ACCESS_KEY}' | base64 -d)"
MINIO_PASSWORD="$(microk8s kubectl get -n minio-operator secret $TENANT_NAME-user-1 -o jsonpath='{.data.CONSOLE_SECRET_KEY}' | base64 -d)"
mc alias set $TENANT_NAME-user-1 http://$HOST:$PORT $MINIO_USER $MINIO_PASSWORD

The MinIO client can be used for second-day operations, like managing replication, or rebalancing. For example, to list all registered MinIO tenants:

mc alias list

which produces output similar to:

microk8s
  URL       : http://10.152.183.201:80
  AccessKey : 9fFwFQq5xMIzW8wlPPeP
  SecretKey : DuZqdnfh1cKJahXwb5z9qy7F5Eo0sObWYvSW0ARh
  API       : s3v4
  Path      : auto
  Src       : /home/ubuntu/.mc/config.json

Details about the MinIO tenant can be retrieved through the following command:

mc admin info microk8s

which produces output similar to:

โ—  10.152.183.201
   Uptime: 23 minutes
   Version: 2024-08-03T04:33:23Z
   Network: 1/1 OK
   Drives: 1/1 OK
   Pool: 1

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Pool โ”‚ Drives Usage          โ”‚ Erasure stripe size โ”‚ Erasure sets โ”‚
โ”‚ 1st  โ”‚ 25.8% (total: 90 GiB) โ”‚ 1                   โ”‚ 1            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

1 drive online, 0 drives offline, EC:0
2 Likes

Nice summary for Minio activation!!!

Addon minio was not found in any repository. I worked with stable and edge and still didnโ€™t show up

shawn@forest:~$ sudo snap refresh microk8s --classic --channel=1.27/edge
microk8s (1.27/edge) v1.27.1 from Canonicalโœ“ refreshed

shawn@forest:~$ microk8s status
microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    community            # (core) The community addons repository
    dashboard            # (core) The Kubernetes dashboard
    dns                  # (core) CoreDNS
    ha-cluster           # (core) Configure high availability on the current node
    ingress              # (core) Ingress controller for external access
    metrics-server       # (core) K8s Metrics Server for API access to service metrics
  disabled:
    argocd               # (community) Argo CD is a declarative continuous deployment for Kubernetes.
    cilium               # (community) SDN, fast with full network policy
    dashboard-ingress    # (community) Ingress definition for Kubernetes dashboard
    fluentd              # (community) Elasticsearch-Fluentd-Kibana logging and monitoring
    inaccel              # (community) Simplifying FPGA management in Kubernetes
    istio                # (community) Core Istio service mesh services
    jaeger               # (community) Kubernetes Jaeger operator with its simple config
    kata                 # (community) Kata Containers is a secure runtime with lightweight VMS
    keda                 # (community) Kubernetes-based Event Driven Autoscaling
    knative              # (community) The Knative framework on Kubernetes.
    linkerd              # (community) Linkerd is a service mesh for Kubernetes and other frameworks
    multus               # (community) Multus CNI enables attaching multiple network interfaces to pods
    openebs              # (community) OpenEBS is the open-source storage solution for Kubernetes
    openfaas             # (community) OpenFaaS serverless framework
    portainer            # (community) Portainer UI for your Kubernetes cluster
    starboard            # (community) Kubernetes-native security toolkit
    traefik              # (community) traefik Ingress controller
    gpu                  # (core) Automatic enablement of Nvidia CUDA
    helm                 # (core) Helm 2 - the package manager for Kubernetes
    helm3                # (core) Helm 3 - Kubernetes package manager
    host-access          # (core) Allow Pods connecting to Host services smoothly
    hostpath-storage     # (core) Storage class; allocates storage from host directory
    mayastor             # (core) OpenEBS MayaStor
    metallb              # (core) Loadbalancer for your Kubernetes cluster
    prometheus           # (core) Prometheus operator for monitoring and logging
    rbac                 # (core) Role-Based Access Control for authorisation
    registry             # (core) Private image registry exposed on localhost:32000
    storage              # (core) Alias to hostpath-storage add-on, deprecated

shawn@forest:~$ microk8s enable minio
Addon minio was not found in any repository

Issues fixed. I had to

microk8s stop
sudo snap remove microk8s 
sudo snap install microk8s --classic --channel=1.27
microk8s start
microk8s minio

When upgrading from an older version to a new version the add-on list is not updatedโ€ฆ

1 Like

I am running microk8s v. 1.30.5

When I enable minio it saysโ€ฆ


You can manage minio tenants using the kubectl-minio plugin.

For more details, use

    microk8s kubectl-minio --help

but it looks it does not exist

'kubectl-minio' is not a valid MicroK8s subcommand.
Available subcommands are:
	add-node
	addons
	config
	ctr
	dashboard-proxy
	dbctl
	disable
	enable
	helm
	helm3
	images
	istioctl
	join
	kubectl
	leave
	linkerd
	refresh-certs
	remove-node
	reset
	start
	status
	stop
	version
	inspect