You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe
When using IAM authentication with AWS EKS, AWS generates a kubeconfig that includes exec credentials that are generated by calling aws eks get-token. The token returned includes an expirationTimestamp, and the credentials themselves expire after 15 minutes:
The result is that if you load a config once and use a client for more than 15 minutes (e.g., waiting for a long-running Job to finish), it will start to fail to authenticate after the credentials expired.
Describe the solution you'd like
The Client should store the command used to generate the credentials and the credential expiration time; when the credentials are close to expiring, they should attempt to be automatically renewed.
Describe alternatives you've considered
To work around this, I have to have some ugly-ish code which tracks how long a given client has been in existence and throw it away and create a new one when the expiration time approaches.
Additional context
The most similar issue I've seen is #2112 but that seems to be more specific to the GKE use case, rather than using ExecCredentials. There's also a TODO in the code to store the expirationTimestamp:
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
Proactive or failure refreshing of the credential regardless of the source has been added to both refresh interceptors. This will hopefully be formalized a bit more with the work being done under #4951
Is your enhancement related to a problem? Please describe
When using IAM authentication with AWS EKS, AWS generates a kubeconfig that includes exec credentials that are generated by calling
aws eks get-token
. The token returned includes anexpirationTimestamp
, and the credentials themselves expire after 15 minutes:However, the current code execs the command once and only once, and discards the
expirationTimestamp
:kubernetes-client/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java
Lines 701 to 705 in 655f4de
The result is that if you load a config once and use a client for more than 15 minutes (e.g., waiting for a long-running Job to finish), it will start to fail to authenticate after the credentials expired.
Describe the solution you'd like
The Client should store the command used to generate the credentials and the credential expiration time; when the credentials are close to expiring, they should attempt to be automatically renewed.
Describe alternatives you've considered
To work around this, I have to have some ugly-ish code which tracks how long a given client has been in existence and throw it away and create a new one when the expiration time approaches.
Additional context
The most similar issue I've seen is #2112 but that seems to be more specific to the GKE use case, rather than using ExecCredentials. There's also a TODO in the code to store the
expirationTimestamp
:kubernetes-client/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java
Lines 814 to 818 in 655f4de
The text was updated successfully, but these errors were encountered: