MinIO Community Helm Chart - cniackz/public GitHub Wiki

Objective:

To document how to use the community helm chart.

Documentation:

Pre-Steps:

  1. You need a Healthy k8s Cluster ready with 4 nodes. You can use Kind in your laptop for this matter and for testing!. For example:
$ createcluster nodeport
 
####################
kind delete cluster:
####################
Deleting cluster "kind" ...
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.25.3) 🖼
 ✓ Preparing nodes 📦 📦 📦 📦 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
 ✓ Joining worker nodes 🚜 
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Have a nice day! 👋
node/kind-worker labeled
node/kind-worker2 labeled
node/kind-worker3 labeled
node/kind-worker4 labeled

Steps:

  1. Add the Helm Chart:
helm repo add minio https://charts.min.io/

You should see:

$ helm repo add minio https://charts.min.io/
"minio" has been added to your repositories
  1. Install the Helm Chart:
  • You will require the namespace minio to be created first:
k create namespace minio

You should see:

$ k create namespace minio
namespace/minio created
  • Then you install it:
helm install \
  --namespace minio \
  --set rootUser=rootuser,rootPassword=rootpass123 \
  --set replicas=4 \
  --set image.repository=quay.io/minio/minio \
  --set image.tag=RELEASE.2022-08-25T07-17-05Z \
  --generate-name minio/minio

After some minutes, you should see:

$ helm install \
>   --namespace minio \
>   --set rootUser=rootuser,rootPassword=rootpass123 \
>   --set replicas=4 \
>   --set image.repository=quay.io/minio/minio \
>   --set image.tag=RELEASE.2022-08-25T07-17-05Z \
>   --generate-name minio/minio
NAME: minio-1696427906
LAST DEPLOYED: Wed Oct  4 09:58:26 2023
NAMESPACE: minio
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
MinIO can be accessed via port 9000 on the following DNS name from within your cluster:
minio-1696427906.minio.svc.cluster.local

To access MinIO from localhost, run the below commands:

  1. export POD_NAME=$(kubectl get pods --namespace minio -l "release=minio-1696427906" -o jsonpath="{.items[0].metadata.name}")

  2. kubectl port-forward $POD_NAME 9000 --namespace minio

Read more about port forwarding here: http://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward/

You can now access MinIO server on http://localhost:9000. Follow the below steps to connect to MinIO server with mc client:

  1. Download the MinIO mc client - https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart

  2. export MC_HOST_minio-1696427906-local=http://$(kubectl get secret --namespace minio minio-1696427906 -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret --namespace minio minio-1696427906 -o jsonpath="{.data.rootPassword}" | base64 --decode)@localhost:9000

  3. mc ls minio-1696427906-local
  1. Access it:
$ kubectl port-forward <POD_NAME> 9000 --namespace minio
Forwarding from 127.0.0.1:9000 -> 9000
Forwarding from [::1]:9000 -> 9000
Handling connection for 9000
Handling connection for 9000
$ mc alias set myminio http://localhost:9000 rootuser rootpass123
Added `myminio` successfully.
$ mc admin info myminio
●  minio-1696427906-0.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 2 minutes 
   Version: 2022-08-25T07:17:05Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-1.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 2 minutes 
   Version: 2022-08-25T07:17:05Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-2.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 2 minutes 
   Version: 2022-08-25T07:17:05Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-3.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 2 minutes 
   Version: 2022-08-25T07:17:05Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

Pools:
   1st, Erasure sets: 1, Drives per erasure set: 4

4 drives online, 0 drives offline
  1. Upgrade it:
  • List to see the name: minio-1696427906
$ helm list -n minio
NAME            	NAMESPACE	REVISION	UPDATED                             	STATUS  	CHART       	APP VERSION                 
minio-1696427906	minio    	1       	2023-10-04 09:58:26.826228 -0400 EDT	deployed	minio-5.0.14	RELEASE.2023-09-30T07-02-29Z
  • Get its values:
$ helm get values minio-1696427906 -n minio > old_values.yaml
$ cat old_values.yaml
USER-SUPPLIED VALUES:
image:
  repository: quay.io/minio/minio
  tag: RELEASE.2022-08-25T07-17-05Z
replicas: 4
rootPassword: rootpass123
rootUser: rootuser
  • Then change the field image.tag in old_values.yaml file with MinIO image tag you want to use.
USER-SUPPLIED VALUES:
image:
  repository: quay.io/minio/minio
  tag: RELEASE.2023-09-30T07-02-29Z
replicas: 4
rootPassword: rootpass123
rootUser: rootuser
  • Now update the chart using
helm upgrade -f old_values.yaml minio-1696427906 minio/minio -n minio

You should see:

$ helm upgrade -f old_values.yaml minio-1696427906 minio/minio -n minio
Release "minio-1696427906" has been upgraded. Happy Helming!
NAME: minio-1696427906
LAST DEPLOYED: Wed Oct  4 10:07:30 2023
NAMESPACE: minio
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
MinIO can be accessed via port 9000 on the following DNS name from within your cluster:
minio-1696427906.minio.svc.cluster.local

To access MinIO from localhost, run the below commands:

  1. export POD_NAME=$(kubectl get pods --namespace minio -l "release=minio-1696427906" -o jsonpath="{.items[0].metadata.name}")

  2. kubectl port-forward $POD_NAME 9000 --namespace minio

Read more about port forwarding here: http://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward/

You can now access MinIO server on http://localhost:9000. Follow the below steps to connect to MinIO server with mc client:

  1. Download the MinIO mc client - https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart

  2. export MC_HOST_minio-1696427906-local=http://$(kubectl get secret --namespace minio minio-1696427906 -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret --namespace minio minio-1696427906 -o jsonpath="{.data.rootPassword}" | base64 --decode)@localhost:9000

  3. mc ls minio-1696427906-local
  1. Verify image in sts managed by helm:
k get sts minio-1696427906  -n minio -o yaml | k neat > sts.yaml
$ yq '.spec.template.spec.containers[0].image' sts.yaml
quay.io/minio/minio:RELEASE.2023-09-30T07-02-29Z
  1. Verify MinIO is healthy after the upgrade:
$ mc admin info myminio
●  minio-1696427906-0.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 3 minutes 
   Version: 2023-09-30T07:02:29Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-1.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 3 minutes 
   Version: 2023-09-30T07:02:29Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-2.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 3 minutes 
   Version: 2023-09-30T07:02:29Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

●  minio-1696427906-3.minio-1696427906-svc.minio.svc.cluster.local:9000
   Uptime: 4 minutes 
   Version: 2023-09-30T07:02:29Z
   Network: 4/4 OK 
   Drives: 1/1 OK 
   Pool: 1

Pools:
   1st, Erasure sets: 1, Drives per erasure set: 4

4 drives online, 0 drives offline
⚠️ **GitHub.com Fallback** ⚠️