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

list listPodForAllNamespaces error #3390

Open
luca-ma opened this issue May 8, 2024 · 7 comments
Open

list listPodForAllNamespaces error #3390

luca-ma opened this issue May 8, 2024 · 7 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@luca-ma
Copy link

luca-ma commented May 8, 2024

Describe the bug
Hi,
I'm using your example
https://github.com/kubernetes-client/java/blob/master/examples/examples-release-18/src/main/java/io/kubernetes/client/examples/Example.java
to get all Pod in a K8s cluster.

CoreV1Api.listPodForAllNamespaces return a 401 response.

Could you suggest how to configure the client to correctly access the cluster?
thanks in advance
luca

Client Version
13.0.0

Kubernetes Version
1.29

Java Version
java 11

@brendandburns
Copy link
Contributor

401 indicates that you are not authorized. That's probably not an error in this client, depending on where you are running the code you may need to add permissions for a pod service account or ensure that you have a kubeconfig file in the right location.

@brendandburns
Copy link
Contributor

Also, client version 0.13.0 is_very_ old, please update to the latest client.

@luca-ma
Copy link
Author

luca-ma commented May 9, 2024 via email

@luca-ma
Copy link
Author

luca-ma commented May 9, 2024 via email

@brendandburns
Copy link
Contributor

That FAQ entry is for Pods running inside the cluster, but it sounds like you are accessing from outside the cluster.

In that case you need some way to authenticate and authorize your client. The easiest way to do that is to supply a Kubeconfig file, alternately you can set up the client programatically with a certificate/token for doing authentication, but that is definitely harder.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 7, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants