How to create API key with no expiration

Hi forum, I need to access my rancher server (v2.8.2) from a custom, not interactive, process.
I need to generate an API key which doesn’t expire, or alternatively find a way to automatically renew it before the expiration.
In past releases I was able to choose ttl=0, but this option seems to be disabled now.

2 Likes

Maybe dirty, but the API key never Exipires anymore

kubectl patch tokens token-testxx–type=‘json’ -p=‘[{“op”: “replace”, “path”: “/ttl”, “value”: 0}]’
kubectl patch tokens token-testxx --type=‘json’ -p=‘[{“op”: “remove”, “path”: “/expiresAt”}]’

1 Like