如何部署入口以将Minio群集暴露在外面

发布于 2025-01-22 14:37:40 字数 2667 浏览 3 评论 0 原文

我在Kubernetes(K3S)中设置了Minio - 一个节点实现。

服务

apiVersion: v1
kind: Service
metadata:
  name: minio
  namespace: minio
  labels:
    app: minio
spec:
  clusterIP: None
  selector:
    app: minio
  ports:
  - port: 9011
    name: minio
---
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

sateful set

      [. . .]
      containers:
      - name: ches
        image: minio/minio
        args:
        - server
        - /data
        [. . .]
        - containerPort: 9000
          hostPort: 9011
        [. . .]

命令 kubectl logs minio -0 -n minio 返回以下内容:

我正在尝试设置入口。接下来的步骤是:

设置入口控制器

从这里:

helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace

创建一个内部服务

apiVersion: v1
kind: Service
metadata:
  name: minio-service-ingress
  namespace: minio
  labels:
    app: minio
spec:
  selector:
    app: minio
  ports:
  - port: 9011
    name: minio

在执行时创建Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minio-ingress
  namespace: minio
spec:
  rules:
  - host: minio.com
    http:
      paths:
      - backend:
          service:
            name: minio-service-ingress
            port:
              number: 9011
        path: /
        pathType: Prefix

kubectl获取-n minio :

NAME            CLASS    HOSTS           ADDRESS        PORTS   AGE
minio-ingress   <none>   minio.com       192.168.1.14   80      43m

在/etc/hosts中,我添加了条目:

192.168.1.14 minio.com

但是,当我尝试输入 http://minio.com/ 时,我会得到:

坏网关

我在这里错过了什么吗?

I have setup MinIO in kubernetes (k3s) - one node implementation.

Services

apiVersion: v1
kind: Service
metadata:
  name: minio
  namespace: minio
  labels:
    app: minio
spec:
  clusterIP: None
  selector:
    app: minio
  ports:
  - port: 9011
    name: minio
---
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

Sateful Set

      [. . .]
      containers:
      - name: ches
        image: minio/minio
        args:
        - server
        - /data
        [. . .]
        - containerPort: 9000
          hostPort: 9011
        [. . .]

Command kubectl logs minio-0 -n minio returns the following:

I am trying to setup Ingress. The steps that followed are:

Setup an Ingress Controller

From here: https://kubernetes.github.io/ingress-nginx/deploy/

helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace

Create an Internal Service

apiVersion: v1
kind: Service
metadata:
  name: minio-service-ingress
  namespace: minio
  labels:
    app: minio
spec:
  selector:
    app: minio
  ports:
  - port: 9011
    name: minio

Create Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minio-ingress
  namespace: minio
spec:
  rules:
  - host: minio.com
    http:
      paths:
      - backend:
          service:
            name: minio-service-ingress
            port:
              number: 9011
        path: /
        pathType: Prefix

When executing kubectl get ing -n minio:

NAME            CLASS    HOSTS           ADDRESS        PORTS   AGE
minio-ingress   <none>   minio.com       192.168.1.14   80      43m

In /etc/hosts I added the entry:

192.168.1.14 minio.com

However, when I am trying to enter http://minio.com/ in browser I get:

Bad Gateway

Am I missing something here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文