gpt4 book ai didi

nginx - 仪表板的入口配置

转载 作者:行者123 更新时间:2023-12-04 00:18:53 25 4
gpt4 key购买 nike

我从 github 做了 nginx 入口 Controller 教程和
暴露的 Kubernetes 仪表板

kubernetes-dashboard   NodePort    10.233.53.77    <none>        443:31925/TCP   20d

创建入口
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-passthrough: "true"
nginx.org/ssl-backends: "kubernetes-dashboard"
kubernetes.io/ingress.allow-http: "false"
name: dashboard-ingress
namespace: kube-system
spec:
tls:
- hosts:
- serverdnsname
secretName: kubernetes-dashboard-certs
rules:
- host: serverdnsname
http:
paths:
- path: /dashboard
backend:
serviceName: kubernetes-dashboard
servicePort: 443
ingress-nginx   ingress-nginx          NodePort    10.233.21.200   <none>        80:30827/TCP,443:32536/TCP   5h

https://serverdnsname:32536/dashboard
但仪表板抛出错误
2018/01/18 14:42:51 http: TLS handshake error from ipWhichEndsWith.77:52686: tls: first record does not look like a TLS handshake

和入口 Controller 日志
2018/01/18 14:42:51 [error] 864#864: *37 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 10.233.82.1, server: serverdnsname, request: "GET /dashboard HTTP/2.0", upstream: "http://ipWhichEndsWith.249:8443/dashboard", host: "serverdnsname:32536"
10.233.82.1 - [10.233.82.1] - - [18/Jan/2018:14:42:51 +0000] "GET /dashboard HTTP/2.0" 009 7 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 OPR/49.0.2725.64" 25 0.001 [kube-system-kubernetes-dashboard-443] ipWhichEndsWith.249:8443 7 0.001 200

在我看来,这与 nginx 重定向到上游有关:“ http://ipWhichEndsWith.249:8443/dashboard”。
尝试将 Controller 镜像版本更新为 0.9.0-beta.19 - 没有帮助

感谢您的任何帮助。

最佳答案

这是适用于我的仪表板的入口。

api版本:networking.k8s.io/v1
种类:入口
元数据:
名称:kubernetes-dashboard
命名空间:kube 系统
注释:
nginx.ingress.kubernetes.io/backend-protocol:“HTTPS”
nginx.ingress.kubernetes.io/rewrite-target:/$2
nginx.ingress.kubernetes.io/configuration-snippet: |
重写 ^(/dashboard)$ $1/重定向;
规范:
ingressClassName: nginx
tls:
- 主机:
- yourdomain.com
secret 名称:kubernetes-dashboard-tls
规则:
- 主机:yourdomain.com
网址:
路径:
- 路径:/dashboard(/|$)(.*)
路径类型:前缀
后端:
服务:
名称:kubernetes-dashboard
港口:
数量:443

关于nginx - 仪表板的入口配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48324760/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com