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

No namespaces list with EKS #298

Closed
pascencio opened this issue Sep 5, 2024 · 12 comments
Closed

No namespaces list with EKS #298

pascencio opened this issue Sep 5, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@pascencio
Copy link

Describe the bug
When I try to add a new port forward the namespace list is empty when I select an AWS EKS context.

To Reproduce
Steps to reproduce the behavior:

  1. Start ktray
  2. Add new port forward
  3. Select a Context
  4. Select a Namespace

Expected behavior
Get a list of namespaces of my EKS cluster.

Screenshots
image

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Browser Google Chrome
  • Version v0.13.3

Additional context
I downloaded the binary version

@hcavarsan
Copy link
Owner

Hey @pascencio, could you provide me with more details so I can investigate the issue? steps:

  1. Right-click and then click on "Inspect" to open the browser console within kftray. Run the process again, and an error should appear when trying to fetch the namespaces.

  2. To enable debug logs, try running the AppImage via the terminal, but first export the environment variables:

RUST_LOG="trace" 
KFTRAY_DEBUG="true" 

After that, just open the application and simulate the error again. The debug log of the app will be in $HOME/.kftray/app.log.

With this information, I will be able to understand what is happening and can help you. Can you check this?

Thank you.

@hcavarsan hcavarsan self-assigned this Sep 7, 2024
@artem-bondarenko
Copy link

artem-bondarenko commented Sep 11, 2024

@hcavarsan, I was faced with the same issue while context from OpenShift cluster is used. Here is the part of the log file with records that raised when I was trying to get a list of namespaces (OpenShift cluster API server's domain name and IP address are changed):

[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Using default kubeconfig paths.
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Attempting to read kubeconfig from path: "/Users/artem.o.bondarenko/.kube/config"
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Successfully read kubeconfig from "/Users/artem.o.bondarenko/.kube/config"
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Available contexts in "/Users/artem.o.bondarenko/.kube/config": ["istio-ingress/awesome.openshift.cluster.example.com:6443/artem", "kind-istio"]
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Creating configuration for context: istio-ingress/awesome.openshift.cluster.example.com:6443/artem
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Successfully created configuration for context: istio-ingress/awesome.openshift.cluster.example.com:6443/artem
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Attempting to create client with OpenSSL HTTPS connector.
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Successfully configured client with OpenSSL.
[2024-09-11T09:42:49Z INFO  kftray_portforward::client] Successfully created client for context: istio-ingress/awesome.openshift.cluster.example.com:6443/artem
[2024-09-11T09:42:49Z TRACE tower::buffer::service] sending request to buffer worker
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] worker polling for next message
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] processing new request
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] resumed=false message=worker received request; waiting for service readiness
[2024-09-11T09:42:49Z DEBUG tower::buffer::worker] service.ready=true message=processing request
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] returning response future
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] worker polling for next message
[2024-09-11T09:42:49Z TRACE hyper_util::client::legacy::pool] checkout waiting for idle connection: ("https", awesome.openshift.cluster.example.com:6443)
[2024-09-11T09:42:49Z TRACE hyper_util::client::legacy::connect::http] Http::connect; scheme=Some("https"), host=Some("awesome.openshift.cluster.example.com"), port=Some(Port(6443))
[2024-09-11T09:42:49Z DEBUG hyper_util::client::legacy::connect::dns] resolving host="awesome.openshift.cluster.example.com"
[2024-09-11T09:42:49Z DEBUG hyper_util::client::legacy::connect::http] connecting to 192.0.2.173:6443
[2024-09-11T09:42:49Z DEBUG hyper_util::client::legacy::connect::http] connected to 192.0.2.173:6443
[2024-09-11T09:42:49Z DEBUG sqlx::query] summary="SELECT id, config_id, is_running …" db.statement="\n\nSELECT\n  id,\n  config_id,\n  is_running\nFROM\n  config_state\n" rows_affected=0 rows_returned=0 elapsed=114.042µs elapsed_secs=0.000114042
[2024-09-11T09:42:49Z DEBUG sqlx::query] summary="SELECT id, data FROM …" db.statement="\n\nSELECT\n  id,\n  data\nFROM\n  configs\n" rows_affected=0 rows_returned=0 elapsed=41.25µs elapsed_secs=4.125e-5
[2024-09-11T09:42:49Z TRACE hyper_util::client::legacy::pool] checkout dropped for ("https", awesome.openshift.cluster.example.com:6443)
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] worker polling for next message
[2024-09-11T09:42:49Z TRACE tower::buffer::worker] buffer already closed

Here is my ~/.kube/config:

apiVersion: v1
clusters:
- cluster:
    server: https://awesome.openshift.cluster.example.com:6443
  name: awesome.openshift.cluster.example.com:6443
- cluster:
    certificate-authority-data: {{REMOVED_DATA}}
    server: https://127.0.0.1:55961
  name: kind-istio
 contexts:
- context:
    cluster: awesome.openshift.cluster.example.com:6443
    namespace: istio-ingress
    user: artem/awesome.openshift.cluster.example.com:6443
  name: istio-ingress/awesome.openshift.cluster.example.com:6443/artem
 - context:
    cluster: kind-istio
    user: kind-istio
  name: kind-istio
current-context: istio-ingress/awesome.openshift.cluster.example.com:6443/artem
kind: Config
preferences: {}
users:
- name: kind-istio
  user:
    client-certificate-data: {{REMOVED_DATA}}
    client-key-data: {{REMOVED_DATA}}
- name: artem/awesome.openshift.cluster.example.com:6443
  user:
    token: sha256~{{REMOVED_DATA}}

I hope this helps. Also, I think it's worth mentioning that kftray works great with the kind-istio context of the local Kind cluster.

@pascencio
Copy link
Author

Hey @pascencio, could you provide me with more details so I can investigate the issue? steps:

  1. Right-click and then click on "Inspect" to open the browser console within kftray. Run the process again, and an error should appear when trying to fetch the namespaces.
  2. To enable debug logs, try running the AppImage via the terminal, but first export the environment variables:
RUST_LOG="trace" 
KFTRAY_DEBUG="true" 

After that, just open the application and simulate the error again. The debug log of the app will be in $HOME/.kftray/app.log.

With this information, I will be able to understand what is happening and can help you. Can you check this?

Thank you.

Hi @hcavarsan. Sorry for the delay, I've been really busy these past few days.
Here some clues:
image
app.log

@hcavarsan
Copy link
Owner

@pascencio @artem-bondarenko can you try to see if its ok now? i made some fixes and improvements in this flow

https://github.com/hcavarsan/kftray/releases/tag/v0.14.1

@pascencio
Copy link
Author

@hcavarsan I will try this tonigth

@artem-bondarenko
Copy link

@pascencio I'm thrilled to say it's fixed! I was able to get Namespaces, Services, Ports, etc.
It works like a charm! Thanks a bunch!

@hcavarsan
Copy link
Owner

nice, thx @artem-bondarenko

@pascencio
Copy link
Author

@pascencio I'm thrilled to say it's fixed! I was able to get Namespaces, Services, Ports, etc.
It works like a charm! Thanks a bunch!

Sorry I forget it. I hope to test the new version today.

@pascencio
Copy link
Author

@pascencio @artem-bondarenko can you try to see if its ok now? i made some fixes and improvements in this flow

https://github.com/hcavarsan/kftray/releases/tag/v0.14.1

@hcavarsan same error here:
image
I saw some warnings in the app.log file.
app.log

I hope this can help you!

@hcavarsan
Copy link
Owner

hcavarsan commented Sep 18, 2024

@pascencio thanks, that helped a lot!

i was able to simulate the problem locally on my linux and after some research, i found a similar issue:
aptakube/aptakube#101 (comment) (nice catch @goenning )

it's a very specific problem with the appimage bundle and an enforcement of environment variables that pkg2appimage does. you could resolve this by installing awscli via apt-get instead of pip install, as apt-get installs a bundle of awscli via pyinstaller with all dependencies included in the downloaded binary. however, i know many people install via pip and could face the same issue.

so, i managed to fix the issue in this version of kftray: https://github.com/hcavarsan/kftray/releases/tag/v0.14.2. it should work now without you having to make any changes to your local environment :)

can you test it and confirm if it's working now?

@hcavarsan hcavarsan added the bug Something isn't working label Sep 19, 2024
@pascencio
Copy link
Author

pascencio commented Sep 26, 2024

@pascencio thanks, that helped a lot!

i was able to simulate the problem locally on my linux and after some research, i found a similar issue: aptakube/aptakube#101 (comment) (nice catch @goenning )

it's a very specific problem with the appimage bundle and an enforcement of environment variables that pkg2appimage does. you could resolve this by installing awscli via apt-get instead of pip install, as apt-get installs a bundle of awscli via pyinstaller with all dependencies included in the downloaded binary. however, i know many people install via pip and could face the same issue.

so, i managed to fix the issue in this version of kftray: https://github.com/hcavarsan/kftray/releases/tag/v0.14.2. it should work now without you having to make any changes to your local environment :)

can you test it and confirm if it's working now?

Hi @hcavarsan. Sorry for the delay, I had too much work this month. I tested the last versión and works perfectly!!
I will keep investigating the application to learn more about it.
Great work!

@hcavarsan
Copy link
Owner

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants