By default, MinIO services are only accessible within the cluster. Use an OpsRequest to expose the S3 API or Web Console externally.
kubectl v1.21+ installed and configured with cluster accesshelm install minio kubeblocks/minio --version 1.1.0-alpha.0 -n kb-system
demo):
kubectl create ns demo
A LoadBalancer requires cloud provider support. On bare-metal or local clusters, use serviceType: NodePort instead and remove the annotations block.
Expose the S3 API port (9000) via NodePort:
kubectl apply -f - <<EOF
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: minio-expose-enable
namespace: demo
spec:
type: Expose
clusterName: minio-cluster
expose:
- componentName: minio
services:
- name: internet
serviceType: NodePort
roleSelector: readwrite
ports:
- name: api
port: 9000
targetPort: api
switch: Enable
EOF
Monitor progress:
kubectl get opsrequest minio-expose-enable -n demo -w
NAME TYPE CLUSTER STATUS PROGRESS AGE
minio-expose-enable Expose minio-cluster Succeed 1/1 15s
Get the external endpoint:
kubectl get service -n demo -l app.kubernetes.io/instance=minio-cluster
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
minio-cluster-minio ClusterIP 10.100.xx.xx <none> 9000/TCP,9001/TCP 5m
minio-cluster-minio-headless ClusterIP None <none> 9000/TCP,9001/TCP 5m
minio-cluster-minio-internet NodePort 10.100.yy.yy <none> 9000:3xxxx/TCP 15s
kubectl apply -f - <<EOF
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: minio-expose-disable
namespace: demo
spec:
type: Expose
clusterName: minio-cluster
expose:
- componentName: minio
services:
- name: internet
serviceType: NodePort
switch: Disable
EOF
kubectl delete opsrequest minio-expose-enable minio-expose-disable -n demo --ignore-not-found