Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to the dashboard: connect: connection timed out #7042

Closed
kaykhancheckpoint opened this issue Apr 26, 2022 · 3 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@kaykhancheckpoint
Copy link

What happened?

I have provisioned a new k8s 1.22 cluster.

I have installed the kubernetes dashboard using the following guide:

https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/,
https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

However when i attempt to connect to the dashboard i receive the following error message.

{
kind: "Status",
apiVersion: "v1",
metadata: { },
status: "Failure",
message: "error trying to reach service: dial tcp 10.0.6.233:8443: connect: connection timed out",
reason: "ServiceUnavailable",
code: 503
}

What did you expect to happen?

I expect the kubernetes dashboard to load without 503 service unavailable.

How can we reproduce it (as minimally and precisely as possible)?

  1. Install the dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommended.yaml
  1. Run the proxy
kubectl proxy
  1. Navigate to the url in the browser
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

Anything else we need to know?

My K8s cluster is a new k8s cluster provisioned using terraform on aws (EKS) uisng the following module. https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/examples/eks_managed_node_group/main.tf

kubectl get all -n kubernetes-dashboard

NAME                                            READY   STATUS    RESTARTS   AGE
pod/dashboard-metrics-scraper-c45b7869d-gmkqm   1/1     Running   0          24m
pod/kubernetes-dashboard-764b4dd7-kmcdj         1/1     Running   0          24m

NAME                                TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
service/dashboard-metrics-scraper   ClusterIP   172.20.250.220   <none>        8000/TCP   24m
service/kubernetes-dashboard        ClusterIP   172.20.95.157    <none>        443/TCP    24m

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/dashboard-metrics-scraper   1/1     1            1           24m
deployment.apps/kubernetes-dashboard        1/1     1            1           24m

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/dashboard-metrics-scraper-c45b7869d   1         1         1       24m
replicaset.apps/kubernetes-dashboard-764b4dd7         1         1         1       24m

kubectl logs -f kubernetes-dashboard-764b4dd7-kmcdj -n kubernetes-dashboard

2022/04/26 09:09:52 Starting overwatch
2022/04/26 09:09:52 Using namespace: kubernetes-dashboard
2022/04/26 09:09:52 Using in-cluster config to connect to apiserver
2022/04/26 09:09:52 Using secret token for csrf signing
2022/04/26 09:09:52 Initializing csrf token from kubernetes-dashboard-csrf secret
2022/04/26 09:09:52 Empty token. Generating and storing in a secret kubernetes-dashboard-csrf
2022/04/26 09:09:52 Successful initial request to the apiserver, version: v1.22.6-eks-14c7a48
2022/04/26 09:09:52 Generating JWE encryption key
2022/04/26 09:09:52 New synchronizer has been registered: kubernetes-dashboard-key-holder-kubernetes-dashboard. Starting
2022/04/26 09:09:52 Starting secret synchronizer for kubernetes-dashboard-key-holder in namespace kubernetes-dashboard
2022/04/26 09:09:52 Initializing JWE encryption key from synchronized object
2022/04/26 09:09:52 Creating in-cluster Sidecar client
2022/04/26 09:09:52 Auto-generating certificates
2022/04/26 09:09:52 Successfully created certificates
2022/04/26 09:09:52 Serving securely on HTTPS port: 8443
2022/04/26 09:12:02 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:14:42 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:17:21 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:20:01 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:22:41 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:25:21 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2022/04/26 09:28:00 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.

What browsers are you seeing the problem on?

No response

Kubernetes Dashboard version

2.5.0

Kubernetes version

1.22

Go version

No response

Node.js version

No response

@kaykhancheckpoint kaykhancheckpoint added the kind/bug Categorizes issue or PR as related to a bug. label Apr 26, 2022
@bryantbiggs
Copy link

terraform-aws-modules/terraform-aws-eks#2041 (comment)

@kaykhancheckpoint you need to ensure the proper ports are open to establish a connection

@kaykhancheckpoint
Copy link
Author

terraform-aws-modules/terraform-aws-eks#2041 (comment)

@kaykhancheckpoint you need to ensure the proper ports are open to establish a connection

thank you, I was able to fix this by opening the port as suggested

@NeilJ12
Copy link

NeilJ12 commented Nov 3, 2022

hi, please i have the same issue, how did you figure it out ? How do you open port when you setup your eks ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants