使用 Helm 安装 Kubernetes 仪表板
helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard -f values.yaml --create-namespace -n kubernetes-dashboard
ingress:
enabled: true
paths:
- /
hosts:
- kubedash.labs.example.com
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
tls:
- secretName: ca-wildcard-example-cert-secret
hosts:
- kubedash.labs.example.com
metricsScraper:
enabled: true
metrics-server:
enabled: true
protocolHttp: true
## Additional container arguments
##
extraArgs:
# - --enable-skip-login
- --enable-insecure-login
# - --system-banner="Welcome to Kubernetes"
Kuberetes 仪表板入口返回
curl -I https://kubedash.labs.example.com
HTTP/1.1 400 Bad Request
Server: nginx/1.21.6
Date: Wed, 03 Aug 2022 18:39:17 GMT
Connection: keep-alive
通过 Helm 安装 Nginx ingress 版本 2.3.0。
任何帮助将非常感激。
答案1
添加后,--enable-insecure-login
可以通过 ingress 在 HTTPS 上工作,虽然有点不安全,但可以解决问题
整体配置:
ingress:
enabled: true
paths:
- /
hosts:
- kubedash.labs.example.com
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
tls:
- secretName: ca-wildcard-example-cert-secret
hosts:
- kubedash.labs.example.com
metricsScraper:
enabled: true
metrics-server:
enabled: true
protocolHttp: true
## Additional container arguments
##
extraArgs:
# - --enable-skip-login
- --enable-insecure-login
# - --system-banner="Welcome to Kubernetes"