2
votes

I'm trying to enable dashboard via nodeport service. I have 3 VMs:

  • 192.168.100.31 - master
  • 192.168.100.32 - minion
  • 192.168.100.33 - minion (dashboard here)

After applying:

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

Dashboard became accessable via kube-proxy. So I've erited service to become NodePort:

kubectl edit services kubernetes-dashboard -n kube-system

Then I've tried to access the dashboard via https NodePort. And it fails. When I'm trying to visit 192.168.100.31 or 192.168.100.32 like:

https://192.168.100.31:32443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default

Browser hangs out & fired timeout error. Meanwhile the same URL for 192.168.100.33 allow me to add site to the browser exceptions cause of self signed cert and ... fail.

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

kubernetes version: v1.11.1

UPD:

kubectl get svc kubernetes-dashboard -n kube-system --export -o yaml

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: {}

kubectl get svc kubernetes-dashboard -n kube-system

NAME                   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard   NodePort   10.96.174.242   <none>        443:32443/TCP   52m

kubectl describe svc kubernetes-dashboard -n kube-system

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
can you check which port is being used with the command kubectl -n kube-system get service kubernetes-dashboard?Jose Armesto
Could you add to your question output of the command: < kubectl get svc kubernetes-dashboard -n kube-system --export -o yaml > and < kubectl get svc kubernetes-dashboard -n kube-system > and < kubectl describe svc kubernetes-dashboard -n kube-system >VASャ
I'm getting exactly the same issue as you. Is this a bug? Seems odd that exactly the same issue is surfacing and I can't find it anywhere else on the web (got here from a relatively fruitless google search)Sam Holmes
@SamHolmes my initial goal was to enable dashboard access for extraneous machines. So for now I've switched to token base access via API server. Found this article useful: www.joseluisgomez.com/containers/kubernetes-dashboard/Silk0vsky
Whoa what a great article, thank you @Silk0vsky!Sam Holmes

1 Answers

4
votes

Looks like you are using an apiserver type of request while accessing the dashboard service directly via NodePort Service.

Could you check the following links in your browser to access Kubernetes dashboard:

https://192.168.100.31:32433/

https://192.168.100.32:32433/

https://192.168.100.33:32433/