Description
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