lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.48k stars 1.46k forks source link

Cannot connect to cluster sometimes #7759

Open danielschlegel opened 1 year ago

danielschlegel commented 1 year ago

Describe the bug When i try to access the cluster i get a timeout(connected to my wifi). it seams that lens is trying to use a proxy but i did not configure any proxy. if i connect to my phone hotspot the same works like it should. Sometimes it helps to restart lens when im on wifi but after some time it looses connection again and then i have to switch to hotspot again.

To Reproduce This is just on my local system.

Expected behavior Connection should not use proxy and should also work with my wifi.

Environment (please complete the following information):

Logs:

E0523 15:37:23.775412 6473 proxy_server.go:147] Error while proxying request: dial tcp: lookup myid.gr7.eu-west-1.eks.amazonaws.com on 192.168.1.167:53: read udp 192.168.1.2:51301->192.168.1.167:53: i/o timeout

Failed to get /version for clusterId=id: Internal Server Error

Kubeconfig:

apiVersion: v1
kind: Config
clusters: 
  - name: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
    cluster:
      server: https://id.yl4.eu-west-1.eks.amazonaws.com
      certificate-authority-data: data==
      insecure-skip-tls-verify: false 
users: 
  - name: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        args:
          - --region
          - eu-west-1
          - eks
          - get-token
          - --cluster-name
          - eks-non-prod-ie-cluster
          - --output
          - json
        command: aws
        env:
          - name: AWS_PROFILE
            value: non-prod 
contexts: 
  - name: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
    context:
      cluster: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
      name: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
      user: arn:aws:eks:eu-west-1:id:cluster/eks-non-prod-ie-cluster
algo7 commented 8 months ago

same issue on Ubuntu 22.04 LTS

DilshanWij commented 6 months ago

I had the same issue and tried everything on the internet but had no luck. However, opening the Lens via the launcher seems to have caused this issue, and I tried to run it from the terminal using open /Applications/Lens.app/ and it solved my problem.

Using a Mac with Iterm2.

anton-kim-getrev commented 3 months ago

same issue, after limiting ClusterRoleBinding system:public-info-viewer to only authenticated:

subjects:
  - kind: Group
    apiGroup: rbac.authorization.k8s.io
    name: system:authenticated

I get constant interruptions with this error: Error: Failed to get /version for clusterId=lol: Internal Server Error