[英]traefik listens on port 80 and forwards the request to minio console(5000) 404
I deployed minio and the console in K8S, used ClusterIP to expose ports 9000 & 5000我在K8S部署了minio和console,使用ClusterIP暴露了9000&5000端口
Listening for port 80 and 5000 forwarding requests to minio.service(ClusterIP)监听端口 80 和 5000 转发请求到 minio.service(ClusterIP)
Request console all right through port 5000通过端口 5000 请求控制台就可以了
By requesting the console on port 80, you can see the console, but the request is 404 in the browser通过在80端口请求console,可以看到console,但是在浏览器中请求是404
enter image description here在此处输入图像描述
enter image description here在此处输入图像描述
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: minio-headless
labels:
app: minio-headless
spec:
type: ClusterIP
clusterIP: None
ports:
- name: server
port: 9000
targetPort: 9000
- name: console
port: 5000
targetPort: 5000
selector:
app: minio
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingress-route-minio
namespace: {{ .Release.Namespace }}
spec:
entryPoints:
- minio
- web
routes:
- kind: Rule
match: Host(`minio-console.{{ .Release.Namespace }}.k8s.zszc`)
priority: 10
services:
- kind: Service
name: minio-headless
namespace: {{ .Release.Namespace }}
port: 5000
responseForwarding:
flushInterval: 1ms
scheme: http
strategy: RoundRobin
weight: 10
traefik access log traefik 访问日志
{
"ClientAddr": "192.168.4.250:55485",
"ClientHost": "192.168.4.250",
"ClientPort": "55485",
"ClientUsername": "-",
"DownstreamContentSize": 19,
"DownstreamStatus": 404,
"Duration": 688075,
"OriginContentSize": 19,
"OriginDuration": 169976,
"OriginStatus": 404,
"Overhead": 518099,
"RequestAddr": "minio-console.etb-0-0-1.k8s.zszc",
"RequestContentSize": 0,
"RequestCount": 1018,
"RequestHost": "minio-console.etb-0-0-1.k8s.zszc",
"RequestMethod": "GET",
"RequestPath": "/api/v1/login",
"RequestPort": "-",
"RequestProtocol": "HTTP/1.1",
"RequestScheme": "http",
"RetryAttempts": 0,
"RouterName": "traefik-traefik-dashboard-6e26dcbaf28841493448@kubernetescrd",
"StartLocal": "2023-01-27T13:20:06.337540015Z",
"StartUTC": "2023-01-27T13:20:06.337540015Z",
"entryPointName": "web",
"level": "info",
"msg": "",
"time": "2023-01-27T13:20:06Z"
}
It looks to me like the request for /api
is conflicting with rules for the Traefik dashboard.在我看来,对
/api
的请求与 Traefik 仪表板的规则冲突。 If you look at the access log in your question, we see:如果您查看问题中的访问日志,我们会看到:
"RouterName": "traefik-traefik-dashboard-6e26dcbaf28841493448@kubernetescrd",
If you have installed Traefik from the Helm chart, it installs an IngressRoute
with the following rules:如果您从 Helm chart 安装了
IngressRoute
,它会安装一个具有以下规则的 IngressRoute:
- kind: Rule
match: PathPrefix(`/dashboard`) || PathPrefix(`/api`)
services:
- kind: TraefikService
name: api@internal
In theory those are bound only to the traefik
entrypoint, but it looks like you may have customized your entrypoint configuration.从理论上讲,它们只绑定到
traefik
入口点,但看起来您可能已经自定义了入口点配置。
Take a look at the IngressRoute resource for your Traefik dashboard and ensure that it's not sharing an entrypoint with minio.查看 Traefik 仪表板的 IngressRoute 资源,确保它没有与 minio 共享入口点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.