Skip to content

Java Client doesn't refresh client auth exec-based credentials #2438

Closed as not planned
@micahhausler

Description

@micahhausler

Describe the bug

Kubernetes supports executing an external process to get API server credentials, and the Java K8s client does too.

For processes that run longer than a credential's lifetime, client-go consumes the .Status.ExpirationTimestamp, caches the credential and will refresh when the credential expires.

Today, the Java client ignores the .Status.ExpirationTimestamp and only gets the exec-based credential once at process start, and will not refresh.

Amazon EKS's tokens (using kubernetes-sigs/aws-iam-authenticator) use this exec-based format, and return an expiration timestamp 15 minutes in the future (same for the AWS CLI implementation). This causes long-running Java clients (such as a Spark job) to fail authentication after 15 minutes.

Client Version

All versions

Kubernetes Version

All versions

Java Version
N/A

To Reproduce
N/A

Expected behavior

The Java client should cache the returned exec-based credential, and refresh automatically

KubeConfig
N/A

Server (please complete the following information):

  • OS: [e.g. Linux]
  • Environment [e.g. container]
  • Cloud [e.g. Azure]

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions