【发布时间】:2020-07-17 13:13:50
【问题描述】:
我正在使用 traefik 2.2 在 kubernetes v1.18 集群中公开 kubernetes 仪表板。这是我机器中的 traefik IngressRoute 配置:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: kubernetes-dashboard-route
namespace: default
spec:
entryPoints:
- websecure
routes:
- match: Host(`kubernete.dolphin.com`)
kind: Rule
services:
- name: kubernetes-dashboard
port: 443
traefik 使用hostNetwork:true 配置并监听主机的 8000 和 8443 端口。当我在集群中使用服务 ip 访问 kubernetes 仪表板时,它显示如下:
[root@k8smaster ~]# curl -k https://10.20.57.188:443
<!--
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kubernetes Dashboard</title>
<link rel="icon"
type="image/png"
href="assets/images/kubernetes-logo.png" />
<meta name="viewport"
content="width=device-width">
<link rel="stylesheet" href="styles.988f26601cdcb14da469.css"></head>
<body>
<kd-root></kd-root>
<script src="runtime.ddfec48137b0abfd678a.js" defer></script><script src="polyfills-es5.d57fe778f4588e63cc5c.js" nomodule defer></script><script src="polyfills.49104fe38e0ae7955ebb.js" defer></script><script src="scripts.391d299173602e261418.js" defer></script><script src="main.b94e335c0d02b12e3a7b.js" defer></script></body>
</html>
它告诉我 kubernetes 仪表板工作正常。但是当我从本地机器访问 kubernetes 仪表板时:
[root@k8smaster ~]# curl -k --header 'Host:kubernete.dolphin.com' https://192.168.31.30:8443
404 page not found
我应该怎么做才能让它成功?我正在使用此命令安装 traefik:
helm install traefik traefik/traefik
没有错误日志:
【问题讨论】:
-
分享来自 traefik pod 的日志
-
没有来自 traefik pod@ArghyaSadhu 的日志
标签: kubernetes traefik