How to install MinIO Operator - cniackz/public GitHub Wiki

Objective: Install MinIO Operator and one tenant

  1. Delete any previous cluster
kind delete cluster

You should see:

$ kind delete cluster
Deleting cluster "kind" ...
  1. Create a new cluster:
  • kind-config.yaml
# four node (two workers) cluster config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
  - role: worker
  - role: worker
kind create cluster --config ~/kind-config.yaml

You should see:

$ kind create cluster --config ~/kind-config.yaml
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.24.0) đŸ–ŧ 
 ✓ 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

Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
  1. Install Operator on Top of the cluster:
kubectl apply -k github.com/minio/operator/resources

You should see:

$ kubectl apply -k github.com/minio/operator/resources
namespace/minio-operator created
customresourcedefinition.apiextensions.k8s.io/tenants.minio.min.io created
serviceaccount/console-sa created
serviceaccount/minio-operator created
clusterrole.rbac.authorization.k8s.io/console-sa-role created
clusterrole.rbac.authorization.k8s.io/minio-operator-role created
clusterrolebinding.rbac.authorization.k8s.io/console-sa-binding created
clusterrolebinding.rbac.authorization.k8s.io/minio-operator-binding created
configmap/console-env created
secret/console-sa-secret created
service/console created
service/operator created
deployment.apps/console created
deployment.apps/minio-operator created
  1. Verify pods are running:
kubectl get pods -n minio-operator

You should see:

$ kubectl get pods -n minio-operator
NAME                             READY   STATUS    RESTARTS   AGE
console-7956df67c6-rbq7n         1/1     Running   0          65s
minio-operator-f8f874647-hnbjn   1/1     Running   0          65s
minio-operator-f8f874647-ntkcw   1/1     Running   0          65s
  1. Look for the logs:
kubectl logs minio-operator-f8f874647-ntkcw -n minio-operator

You should see:

$ kubectl logs minio-operator-f8f874647-ntkcw -n minio-operator
I0711 14:23:28.844217       1 main.go:70] Starting MinIO Operator
I0711 14:23:29.100255       1 main.go:169] caBundle on CRD updated
I0711 14:23:29.101716       1 main-controller.go:240] Setting up event handlers
I0711 14:23:29.101870       1 leaderelection.go:243] attempting to acquire leader lease minio-operator/minio-operator-lock...
I0711 14:23:29.134963       1 leaderelection.go:253] successfully acquired lease minio-operator/minio-operator-lock
I0711 14:23:29.135212       1 main-controller.go:466] minio-operator-f8f874647-ntkcw: I've become the leader
I0711 14:23:29.135411       1 main-controller.go:378] Waiting for API to start
I0711 14:23:29.135455       1 main-controller.go:370] Starting HTTP Upgrade Tenant Image server
I0711 14:23:29.174167       1 main-controller.go:347] Using Kubernetes CSR Version: v1
I0711 14:23:29.182170       1 operator.go:90] operator TLS secret not found: secrets "operator-tls" not found
I0711 14:23:29.216151       1 csr.go:183] Start polling for certificate of csr/operator-minio-operator-csr, every 5s, timeout after 20m0s
I0711 14:23:34.262462       1 csr.go:209] Certificate successfully fetched, creating secret with Private key and Certificate
I0711 14:23:34.264658       1 operator.go:92] Waiting for the operator certificates to be issued waiting for Operator cert
I0711 14:23:44.268782       1 main-controller.go:351] Starting HTTPS API server
I0711 14:23:44.268908       1 main-controller.go:381] Waiting for Upgrade Server to start
I0711 14:23:44.268911       1 main-controller.go:385] Starting Tenant controller
I0711 14:23:44.268913       1 main-controller.go:388] Waiting for informer caches to sync
I0711 14:23:44.268917       1 main-controller.go:393] Starting workers
  1. Now, proceed to install the tenant:
kubectl apply -k github.com/minio/operator/examples/kustomization/tenant-lite

You should see:

$ kubectl apply -k github.com/minio/operator/examples/kustomization/tenant-lite
namespace/tenant-lite created
secret/storage-configuration created
secret/storage-creds-secret created
secret/storage-user created
tenant.minio.min.io/storage-lite created
  1. Wait for pods to be ready:
kubectl get pods -n tenant-lite

You should see:

$ kubectl get pods -n tenant-lite
NAME                                          READY   STATUS    RESTARTS        AGE
storage-lite-log-0                            1/1     Running   0               3m42s
storage-lite-log-search-api-d6576b4bc-rktjv   1/1     Running   4 (2m17s ago)   3m41s
storage-lite-pool-0-0                         1/1     Running   0               3m44s
storage-lite-pool-0-1                         1/1     Running   0               3m44s
storage-lite-pool-0-2                         1/1     Running   0               3m44s
storage-lite-pool-0-3                         1/1     Running   0               3m44s
storage-lite-prometheus-0                     2/2     Running   0               43s
  1. Now, let's access to Console for you to add a bucket and a file on it.
kubectl port-forward storage-lite-pool-0-0 9443 -n tenant-lite

You should see:

$ kubectl port-forward storage-lite-pool-0-0 9443 -n tenant-lite
Forwarding from 127.0.0.1:9443 -> 9443
Forwarding from [::1]:9443 -> 9443
Handling connection for 9443
  1. Now open the web page: https://localhost:9443/ if using Chrome click Advanced then Proceed to localhost

  2. Now put user and password and log-in:

  • User: minio
  • Password: minio123
  1. Click Create Bucket
  1. Once Bucket is created upload one file:
  1. That's it, you are ready to go and do more things with this amazing tool that is MinIO!!! đŸĨŗ