Kubernetes - MinIO 无法使用浏览器连接到控制台

Kubernetes - MinIO Failed to connect to console using browser

根据官方 MinIO 指南 (https://docs.min.io/docs/minio-quickstart-guide.html):

For example, consider a MinIO deployment behind a proxy https://minio.example.net, https://console.minio.example.net with rules for forwarding traffic on port :9000 and :9001 to MinIO and the MinIO Console respectively on the internal network. Set MINIO_BROWSER_REDIRECT_URL to https://console.minio.example.net to ensure the browser receives a valid reachable URL.

我已经使用 k3s 和 Load Balancer 服务设置了分布式 minio。

$ kubectl describe services minio-service -n minio

Name:                     minio-service
Namespace:                minio
Labels:                   app=minio
Annotations:              <none>
Selector:                 app=minio
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.43.168.142
IPs:                      10.43.168.142
LoadBalancer Ingress:     192.168.10.119, 192.168.10.120, 192.168.10.70
Port:                     <unset>  9012/TCP
TargetPort:               9011/TCP
NodePort:                 <unset>  31423/TCP
Endpoints:                10.42.1.13:9011,10.42.2.12:9011
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

如果我尝试 curl -vf http://192.168.10.70:9012 我得到

curl: (7) Failed to connect to 192.168.1.70 port 9012: Connection timed out

因此,我使用了export MINIO_BROWSER_REDIRECT_URL=http://192.168.10.70:9012,但它不起作用。我在重定向方面做错了什么吗?有谁知道如何解决这个问题?

我设法使用 port-forward 使其工作。

选项:

kubectl port-forward minio-0 9000 -n minio

Forwarding from 127.0.0.1:9000 -> 9000

kubectl port-forward --address 192.168.10.70 pod/minio-0 9000 -n minio

Forwarding from 192.168.10.70:9000 -> 9000

kubectl port-forward --address 192.168.10.70 svc/minio-service 9012 -n minio

Forwarding from 192.168.10.70:9012 -> 9011

注意第三个选项中,minio-service是一个Load Balancer Service

apiVersion: v1
kind: Service
metadata:
  name: minio-service
  namespace: minio
  labels:
    app: minio
spec:
  type: LoadBalancer
  selector:
    app: minio
  ports:
  - port: 9012
    targetPort: 9011
    protocol: TCP

在状态集中:

containers:
  ports:
  - containerPort: 9000
    hostPort: 9011