Skip to content

How to use NodePort in MinIO Service

Cesar Celis Hernandez edited this page Sep 17, 2022 · 14 revisions

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:
image
  1. Wait for Tenant to be ready:
Screen Shot 2022-09-16 at 11 24 52 PM
  1. Then, change the service to become NodePort:
image
  1. Match the port of the service with the port available in your host:
image
  1. Then you can access the UI via https://localhost:30080/login:
Screen Shot 2022-09-16 at 11 29 47 PM
Clone this wiki locally