kubernetes dashboard不支持https - K8s版本- v1.19.6

q43xntqr  于 2023-04-05  发布在  Kubernetes
关注(0)|答案(2)|浏览(248)

我使用命令部署了Kubernetes Dashboard:

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml

我已经将Service编辑为Nodeport,并相应地配置了Ingress对象。我可以使用http登录 Jmeter 板,但使用https登录相同的URL时出现问题:

"TLS handshake error from 10.244.0.0:44950: remote error: tls: unknown certificate" .

当我用ssl配置入口规则时,它给出错误:

"Client sent an HTTP request to an HTTPS server."

我有Jenkins应用程序运行在同一集群与真实的的证书,我可以能够登录Jenkins网址与https。
群集信息:
k8s群集运行于(Linux Server 7.9版)
kubernetes版本(v1.19.6)
请您确认是否有任何建议来解决这个问题

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: kube-system-ingress
  namespace: kubernetes-dashboard
  annotations:
    kubernetes.io/ingress.class: "haproxy"
    ingress.kubernetes.io/ssl-passthrough: "false"
spec:
  tls:
  - hosts:
    - console.qa.test.com
    secretName: qa-pss-dashboard
  rules:
  - host: console.qa.test.com
    http:
      paths:
      - path: /
        backend:
          serviceName: kubernetes-dashboard
          servicePort: 8443
5sxhfpxr

5sxhfpxr1#

我认为你必须添加注解ingress.kubernetes.io/backend-protocol:“HTTPS”
请注意,kubernetes dashboard服务暴露在443端口,而不是与部署相关的8443(pod端口)。
因此:

backend:
      service:
        name: kubernetes-dashboard
        port:
          number: 443
nhaq1z21

nhaq1z212#

您需要ingress.kubernetes.io/server-ssl: "true"注解而不是ssl-passthrough: "false"。请参阅文档

相关问题