kdash-rs / kdash

A simple and fast dashboard for Kubernetes
https://kdash.cli.rs
MIT License
2.07k stars 78 forks source link

kdash doesn't respect HTTPS_PROXY environment variable #380

Open b3ndill opened 1 year ago

b3ndill commented 1 year ago

Describe the bug I have a cluster on a private network that I need to access via a bastion host. Under normal circumstances I can use kubectl by including a proxy-url parameter in the Kubernetes context and setting the HTTPS_PROXY environment variable. With kdash I get a timeout error: Failed to get namespaces. HyperError(hyper::Error(Connect, Custom { kind: TimedOut, error: Elapsed(()) }))

To Reproduce

  1. Set a proxy-url parameter for your private Kubernetes cluster
  2. Set up a port-forward connection via a jump host using SSH
  3. Export the forwarded port to HTTPS_PROXY variable.
  4. Launch kdash

Expected behavior kdash should utilize the HTTPS_PROXY environment variable, if it is set, when trying to connect to the Kubernetes cluster.

Desktop:

deepu105 commented 1 year ago

might be related to https://github.com/kube-rs/kube/issues/1013 need to dig in further

b3ndill commented 10 months ago

Just a heads-up, it seems like SOCKS5 support has been merged in https://github.com/kube-rs/kube/pull/1311. It should be available (behind a feature flag) in release 0.87.1.

deepu105 commented 10 months ago

Yes, the kuber version needs to be updated as soon as other dependencies (kubectl-view-allocations) also update to that version

Thanks & Regards, Deepu

On Thu, Nov 2, 2023 at 2:16 PM Grétar Hauksson @.***> wrote:

Just a heads-up, it seems like SOCKS5 support has been merged in kube-rs/kube#1311 https://github.com/kube-rs/kube/pull/1311. It should be available (behind a feature flag) in release 0.87.1 https://github.com/kube-rs/kube/releases/tag/0.87.1.

— Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/380#issuecomment-1790706812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF3HOUVQFEA4VSVCBA3YCOML5AVCNFSM6AAAAAA4NHF2PCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQG4YDMOBRGI . You are receiving this because you commented.Message ID: @.***>

deepu105 commented 7 months ago

I have enabled sock5 feature in version 0.6

deepu105 commented 7 months ago

can you test and confirm plz

b3ndill commented 7 months ago

can you test and confirm plz

I've updated kdash but I'm not getting any cluster information. It sees the correct context but isn't capable of connecting to the cluster. However, kubectl works fine from the same terminal session.

Let me know how I can test this further! 😉

deepu105 commented 7 months ago

Can you pass me your kube/config after removing private/sensitive info (I'm mainly interested in how the cluster authentication is structured)

Also what do you see if you run kdash --debug

b3ndill commented 7 months ago

Sorry for the late reply, here is the kube config:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <redacted>
    proxy-url: http://localhost:8888
    server: https://172.16.0.2
  name: gke_account_region_cluster
contexts:
- context:
    cluster: gke_account_region_cluster
    user: gke_account_region_cluster
  name: gke_account_region_cluster
current-context: gke_account_region_cluster
kind: Config
preferences: {}
users:
- name: gke_account_region_cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args: null
      command: gke-gcloud-auth-plugin
      env: null
      installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
        https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
      interactiveMode: IfAvailable
      provideClusterInfo: true

Running kdash --debug doesn't produce any meaningful results. I'm still getting the following error Failed to get namespaces. HyperError(hyper::Error(Connect, Custom { kind: TimedOut, error: Elapsed(()) })).