当前位置: 首页 > 知识库问答 >
问题:

如何通过Nodeport启用kubernetes仪表板?

丁安宜
2023-03-14
    null

申请后:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

仪表板可以通过库贝代理访问。所以我把service命名为Nodeport:

kubectl edit services kubernetes-dashboard -n kube-system

然后我尝试通过https Nodeport访问仪表板。它失败了。当我试图访问192.168.100.31或192.168.100.32时,比如:

https://192.168.100.31:32443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default
This site can’t be reached
The webpage at https://192.168.100.33:32443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE
apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"creationTimestamp":null,"labels":{"k8s-app":"kubernetes-dashboard"},"name":"kubernetes-dashboard","namespace":"kube-system","selfLink":"/api/v1/namespaces/kube-system/services/kubernetes-dashboard"},"spec":{"ports":[{"nodePort":32443,"port":443,"protocol":"TCP","targetPort":8443}],"selector":{"k8s-app":"kubernetes-dashboard"},"sessionAffinity":"None","type":"NodePort"},"status":{"loadBalancer":{}}}
  creationTimestamp: null
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  selfLink: /api/v1/namespaces/kube-system/services/kubernetes-dashboard
spec:
  externalTrafficPolicy: Cluster
  ports:
  - port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    k8s-app: kubernetes-dashboard
  sessionAffinity: None
  type: NodePort
status:
  loadBalancer: {}
NAME                   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard   NodePort   10.96.174.242   <none>        443:32443/TCP   52m
Name:                     kubernetes-dashboard
Namespace:                kube-system
Labels:                   k8s-app=kubernetes-dashboard
Annotations:              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"creationTimestamp":null,"labels":{"k8s-app":"kubernetes-dashboard"},"name":"kubernete...
Selector:                 k8s-app=kubernetes-dashboard
Type:                     NodePort
IP:                       10.96.174.242
Port:                     <unset>  443/TCP
TargetPort:               8443/TCP
NodePort:                 <unset>  32443/TCP
Endpoints:                192.0.2.2:8443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

共有1个答案

祁绪
2023-03-14

在通过NodePort服务直接访问Dashboard服务时,您似乎正在使用APIServer类型的请求。

您是否可以在浏览器中检查以下链接以访问Kubernetes仪表板:

https://192.168.100.31:32433/

 类似资料:
  • 我已经配置了istio ingress,使用了lets加密证书。我可以通过使用网关和VirtualService访问https上运行在不同端口上不同服务。 但是kubernetes-dashboard运行在kube-system名称空间中的443端口上,并且具有自己的证书,我如何通过istio网关和VirtualService来公开它。 我已经为dashboard定义了子域,创建了网关,virtu

  • 我刚刚将kubeadm和kubelet升级到了V1.8.0。并按照官方文档安装仪表板。 之后,我通过运行 幸运的是,我能够通过http://192.168.0.101:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard://proxy/访问仪表板 我试图将作为kubeconfig上传,但失败了。然后,我尝试使

  • 有人能帮我走台阶吗...(我在互联网的帮助下尝试了多种方法...不知道我错过了什么?) 注意:根据讨论论坛,我在ingress YAML的部署部分中添加了“hostnetwork:true”来解决“没有主机参数不能工作”,并注释了“type:nodeport”。 更新信息: kubectl描述了更新后的入口路由:在这里,我有ngnix--它工作得很好(我猜ingress和nginx都在相同的命名空

  • 但是在我的群集上没有服务/部署: 谢谢你的帮助

  • > Kubectl apply-f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recomended.yaml kubectl代理--address=“192.168.56.12”-p 8001-accept-hosts='^*$' [root@k8s-master~]#kubectl

  • 我使用此处的说明在 VirtualBox 上创建了一个 3 节点 kubernetes 集群(1 个主 2 个工作线程)。我正在使用法兰绒作为覆盖网络。 我在安装过程中在主服务器上设置了< code > sysctl-w net . bridge . bridge-nf-call-iptables = 1 和< code > sysctl-w net . bridge . bridge-nf-ca