Mic*_*ael 8 kubernetes-dashboard traefik-ingress k3s
我正在使用 k3s 的默认安装(版本 v1.17.0+k3s.1)并验证它在我的 Raspberry Pi 集群上正常工作。
使用推荐的说明(https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/)安装 kubernetes-dashboard后,我确认这是有效的,在我使用 k3s 将它暴露在集群之外之后基于 traefik 的负载均衡器。
但是,当我尝试使用 traefik 入口控制器公开它时,我无法连接到 kubernetes 仪表板,浏览器显示 HTTP 500 错误,即内部服务器错误。下面是我的入口 yaml 和 kubernetes-dashboard pod 日志,显示了 TLS 证书错误。我相信证书错误是由于 traefik 不知道(和信任)kubernetes 仪表板使用的 TLS 证书。
一种。k8s-dashboard-Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/ssl-redirect: "true"
spec:
rules:
- host: k8s-services
http:
paths:
- path: /k8s-dashboard
backend:
serviceName: kubernetes-dashboard
servicePort: 443
Run Code Online (Sandbox Code Playgroud)
笔记。域“k8s-services”域在我的 pi 集群机器和浏览计算机主机文件中定义。
湾 Kubernetes 仪表板 pod 日志
...
2020/01/18 06:04:19 Auto-generating certificates
2020/01/18 06:04:19 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2020/01/18 06:04:19 Successfully created certificates
2020/01/18 06:04:19 Serving securely on HTTPS port: 8443
2020/01/18 06:04:49 Successful request to sidecar
2020/01/18 06:23:28 http: TLS handshake error from 10.42.0.113:52698: remote error: tls: bad certificate
2020/01/18 06:24:33 http: TLS handshake error from 10.42.0.113:52886: remote error: tls: bad certificate
2020/01/18 06:24:41 http: TLS handshake error from 10.42.0.113:52908: remote error: tls: bad certificate
2020/01/18 06:24:47 http: TLS handshake error from 10.42.0.113:52926: remote error: tls: bad certificate
2020/01/18 06:24:53 http: TLS handshake error from 10.42.0.113:52948: remote error: tls: bad certificate
2020/01/18 06:25:37 http: TLS handshake error from 10.42.0.113:53076: remote error: tls: bad certificate
2020/01/18 06:25:41 http: TLS handshake error from 10.42.0.113:53090: remote error: tls: bad certificate
2020/01/18 06:25:44 http: TLS handshake error from 10.42.0.113:53102: remote error: tls: bad certificate
2020/01/18 06:31:22 http: TLS handshake error from 10.42.0.113:54144: remote error: tls: bad certificate
2020/01/18 06:31:29 http: TLS handshake error from 10.42.0.113:54158: remote error: tls: bad certificate
...
Run Code Online (Sandbox Code Playgroud)
我的问题似乎与以下 Stack Overflow 问题非常相似: 通过 Ingress 的 Kubernetes 仪表板
我第一次尝试解决这个问题是在 k3s 的 traefik.toml 文件中添加“ssl.insecureSkipVerify:'true'”。不幸的是,我找不到全局 traefik.toml 文件(而且 traefik 似乎是使用 Helm Chart 安装的)。
请让我知道在 traefik 或其他替代解决方案中更新“ssl.insecureSkipVerify”设置的方法。
HelmChartConfig您需要在其中创建一个/var/lib/rancher/k3s/server/manifests/traefik-config.yaml内容:
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
spec:
valuesContent: |-
ssl.insecureSkipVerify: true # <-- Add this line
Run Code Online (Sandbox Code Playgroud)
但我怀疑它能否解决问题。
| 归档时间: |
|
| 查看次数: |
2689 次 |
| 最近记录: |