I have one kubernetes cluster with many pods that run the same symfony app. On this app, I make a request on HERE's api for geocoding. HERE sends me a JWT token available for 24h. I would like to save this token in kubernetes, in this way, all pods/app have the same token.
Is there a good practice, approved solution, to get a jwt token on external API and save it in kubernetes for provide it to my pods ?
You can use a kubernetes secret for storing the token. Mount the secret in the pod for using it to call external API.
Here is the guide on distributing credentials securely using secrets.
As a side note kubernetes itself uses secret to store service account credential which is a JWT token. So this approach is approved and mainstream.