How to use NodePort in MinIO Service - cniackz/public GitHub Wiki

Inspired from:

Other relevant links:

Steps:

  1. Delete any previous cluster if any
kind delete cluster
  1. Create the configuration file for kind:
  • File name: kind-config-node-port.yaml

  • Content:

# I got this config from:
# https://github.com/kubernetes-sigs/kind/issues/1875
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  apiServerAddress: "127.0.0.1"
  apiServerPort: 6443
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 30080
    hostPort: 30080
    listenAddress: "127.0.0.1"
    protocol: TCP
  - containerPort: 30081
    hostPort: 30081
    listenAddress: "127.0.0.1"
    protocol: TCP    

$ kind create cluster --config=kind-config-node-port.yaml 
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.24.0) 🖼 
 ✓ Preparing nodes 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹️ 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
Set kubectl context to "kind-kind"
You can now use your cluster with:

kubectl cluster-info --context kind-kind

Thanks for using kind! 😊
  1. Install the operator:
kubectl apply -k github.com/minio/operator/
  1. Install the tenant:
kubectl apply -k ~/operator/examples/kustomization/tenant-lite
  1. Since we have one node only, remove one replica from operator so we have only one:
  1. Wait for Tenant to be ready:
  1. Then, change the service to become NodePort:
  1. Match the port of the service with the port available in your host:
  1. Then you can access the UI via https://localhost:30080/login: