java icon indicating copy to clipboard operation
java copied to clipboard

list listPodForAllNamespaces error

Open luca-ma opened this issue 1 year ago • 5 comments

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

luca-ma avatar May 08 '24 13:05 luca-ma

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 avatar May 08 '24 16:05 brendandburns

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

brendandburns avatar May 08 '24 16:05 brendandburns

Hi, I have to access a k8s cluster to perform a simple read from outside the cluster itself (I can't use a kuconfig file). Could it be that the problem is the one listed here https://github.com/kubernetes-client/java/wiki/7.-FAQ ? thanks in advance luca

Il giorno mer 8 mag 2024 alle ore 18:31 Brendan Burns < @.***> ha scritto:

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.

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-client/java/issues/3390#issuecomment-2100961973, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDNO6SPVJZKX7W5EDRL5RLZBJHM3AVCNFSM6AAAAABHM6QUOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQHE3DCOJXGM . You are receiving this because you authored the thread.Message ID: @.***>

luca-ma avatar May 09 '24 10:05 luca-ma

OK thank you I'll switch to the latest version (20.0.1) regards luca

Il giorno mer 8 mag 2024 alle ore 18:31 Brendan Burns < @.***> ha scritto:

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

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-client/java/issues/3390#issuecomment-2100962613, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDNO6WYC5PKNELBUWYI7X3ZBJHOHAVCNFSM6AAAAABHM6QUOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQHE3DENRRGM . You are receiving this because you authored the thread.Message ID: @.***>

luca-ma avatar May 09 '24 10:05 luca-ma

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.

brendandburns avatar May 09 '24 16:05 brendandburns

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-triage-robot avatar Aug 07 '24 17:08 k8s-triage-robot

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-triage-robot avatar Sep 06 '24 17:09 k8s-triage-robot

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

This bot triages 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:

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

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

/close not-planned

k8s-triage-robot avatar Oct 06 '24 17:10 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

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

This bot triages 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:

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

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

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Oct 06 '24 17:10 k8s-ci-robot