kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

any ways to refresh sa token mount by secret rather than use token request api ?

Open H1115372943 opened this issue 5 months ago • 0 comments

Hi team:

problems: currently when we are using the k8s - client, we have encountered an issue with the expiration of the sa token, which has led to the API not being able to be called normally.

versions fabric8io:5.6 k8s:1.21.7

others After the pod has been running for a while, an error "token has expired" occurs. By checking the k8s changelog, we found that starting from version 1.21, due to the BoundServiceAccountTokenVolume feature, the token has an expiration time.

The official also recommends using the token through TokenRequest. However, since it is not easy for us to upgrade fabric8io to 6.8, is the only option currently to manually create a long - term token and mount it at /var/run/secrets/kubernetes.io/serviceaccount/token?

H1115372943 avatar May 29 '25 06:05 H1115372943