kubernetes Kubectl“管道破裂”和“发生超时”问题与minIO部署有关

ykejflvf  于 2023-01-29  发布在  Kubernetes
关注(0)|答案(1)|浏览(318)

每次我尝试通过带有端口转发的浏览器访问我的minIO控制台时,连接将短暂工作,并显示以下多条连接消息:

Handling connection for 9000
Handling connection for 42935
Handling connection for 42935
Handling connection for 42935
Handling connection for 42935
Handling connection for 42935
Handling connection for 42935
...

过了一会儿,这个错误信息
E0128 18:22:01.801739 40952 portforward.go:378] error copying from remote stream to local connection: readfrom tcp6 [::1]:42935->[::1]:50796: write tcp6 [::1]:42935->[::1]:50796: write: broken pipe
在它最终发送多条垃圾邮件之前:

E0128 18:22:31.738313   40952 portforward.go:346] error creating error stream for port 42935 -> 42935: Timeout occurred
Handling connection for 42935
E0128 18:22:32.120930   40952 portforward.go:346] error creating error stream for port 42935 -> 42935: write tcp 192.168.0.16:50776->34.133.9.102:443: write: broken pipe
Handling connection for 42935
E0128 18:22:32.574837   40952 portforward.go:346] error creating error stream for port 42935 -> 42935: write tcp 192.168.0.16:50776->34.133.9.102:443: write: broken pipe
...

下面是我的部署文件:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio-deployment
  namespace: minio-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: minio
  template:
    metadata:
      labels:
        app: minio
    spec:
      containers:
        - name: minio
          image: minio/minio
          args:
            - server
            - /data
            - --console-address
            - ":42935"
          volumeMounts:
            - name: minio-pv-storage
              mountPath: /data
      volumes:
        - name: minio-pv-storage
          persistentVolumeClaim:
            claimName: minio-pv-claim
---
apiVersion: v1
kind: Service
metadata:
  name: minio-service
  namespace: minio-ns
spec:
  selector:
    app: minio
  ports:
    - name: minio
      port: 9000
      targetPort: 9000
    - name: minio-console
      port: 42935
      targetPort: 42935
  type: LoadBalancer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: minio-pv-claim
  namespace: minio-ns
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

我将minio-service类型更改为LoadBalancer(来自ClusterIP),以便通过浏览器访问控制台,沿着添加--console-address标志并公开必要的端口。这使得minIO控制台即使处于持续加载状态也能显示。如果我尝试登录,它将一直刷新,直到崩溃/超时

相关问题