Pet*_*zov 3 kubernetes kubernetes-dashboard
我使用此命令在远程主机上安装并启用 Kubernetes 仪表板:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.6.1/aio/deploy/recommended.yaml
kubectl proxy --address='192.168.1.132' --port=8001 --accept-hosts='^*$'
http://192.168.1.132:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
Run Code Online (Sandbox Code Playgroud)
但我得到:
Insecure access detected. Sign in will not be available. Access Dashboard securely over HTTPS or using localhost. Read more here .
Run Code Online (Sandbox Code Playgroud)
是否可以在 Kubernetes 主机上启用 SSL 连接,以便我可以在没有此警告消息的情况下访问它并启用登录?
小智 5
从服务定义来看
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
ports:
- port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
Run Code Online (Sandbox Code Playgroud)
它公开了端口 443(又名 https)。所以它已经预先配置好了。首先,在 URL 中使用 https 而不是 http。
那么,为什么kubectl proxy
不简单地执行 a ,而不是
kubectl port-forward -n kubernetes-dashboard services/kubernetes-dashboard 8001:443
Run Code Online (Sandbox Code Playgroud)
通过https://127.0.0.1:8001/#/login访问端点
现在它将给出典型的“证书未签名”,因为证书是自签名的(--auto-generate-certificates
部署定义中的arg)。只需使用浏览器跳过它即可。如果您需要配置签名证书,请参阅https://vmwire.com/2022/02/07/running-kubernetes-dashboard-with-signed-certificates/等文章。
归档时间: |
|
查看次数: |
1973 次 |
最近记录: |