Setting up Minio in K8s
Use the following to create a Mino S3 backed by rook-ceph storage
After this port-forward so that you can access Mino externally
kubectl port-forward minio-64b7c649f9-9xf5x --address 0.0.0.0 7000:9000 --namespace minio
Alternately if you have HAProxy IngressController installed in your K8s cluster you can create an Ingress and expose it
HOST=minio.10.131.232.223.nip.io
kubectl create -f - <<EOF
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: minio
namespace: minio
spec:
rules:
- host: $HOST
http:
paths:
- backend:
serviceName: minio-service
servicePort: 9000
path: /
EOF
Note:I edited the minio service from type LB to CluserIP and removed the NodePort. This may not be really needed
[root@green--1 ~]# kubectl -n minio describe service minio-service
Name: minio-service
Namespace: minio
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"minio-service","namespace":"minio"},"spec":{"ports":[{"port":9000...
Selector: app=minio
Type: LoadBalancer --> changed this to ClusterIP
IP: 10.97.9.200
Port: <unset> 9000/TCP
TargetPort: 9000/TCP
NodePort: <unset> 31675/TCP --> removed this
Endpoints: 10.244.2.21:9000
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
If you are using an Ingress Controller you can create an Ingress like below
# kubectl -n minio describe service minio-serviceName: minio-service Namespace: minio Labels: Annotations: kubectl.kubernetes.io/last-applied-configuration: {“apiVersion”:”v1",”kind”:”Service”,”metadata”:{“annotations”:{},”name”:”minio-service”,”namespace”:”minio”},”spec”:{“ports”:[{“port”:9000… Selector: app=minio Type: LoadBalancer → changed this to ClusterIP IP: 10.97.9.200 Port: 9000/TCP TargetPort: 9000/TCP NodePort: 31675/TCP → removed this Endpoints: 10.244.2.21:9000 Session Affinity: None External Traffic Policy: Cluster Events:
HOST=minio.10.131.232.223.nip.io kubectl create -f — << EOF
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: minio
namespace: minio
spec:
rules:
- host: $HOST
http:
paths:
- backend:
serviceName: minio-service
servicePort: 9000
status:
loadBalancer:
ingress:
- {}
EOF