-
We have a pretty nice setup that configures dynamic database credentials using Hashicorp Vault for our Quarkus Kubernetes services. Quarkus authenticates against Vault using Kubernetes authentication and we also use Vault as config source. For the dynamic db credentials we pass the following environment variables to Quarkus:
(yes, we are aware of the fact that setting When the service starts up everything is working fine, from Vault Kubernetes authentication over reading config from Vault to database connection. But from time to time we get these errors in the logs:
We are aware of the fact that the credentials are short-lived and need to be re-acquired before they expire. We were under the impression that Quarkus takes care of doing that but it seems to fail on that from time to time. Is there any config parameter we can use to tweak Quarkus behavior or did we just encounter a simple bug? Maybe it's even an issue of timezones (we're located in UTC+1)? Thanks for helping out. :) |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
I have discovered that Quarkus has a 'grace period' setting of 1 hour (by default). I guess that with a token lifetime of 1 hour there is a small margin in which the token has actually expired, but the application didn't renew it yet. |
Beta Was this translation helpful? Give feedback.
-
The grace period setting mentioned above should fix any problems like this. Enable debug logging for |
Beta Was this translation helpful? Give feedback.
-
We finally solved our issue. When browsing the Quarkus Vault config options we stumbled up the following:
This is exactly what happened to us. We were under the impression that Quarkus will automatically keep the Vault token "fresh" at any time but our service (low traffic) does not constantly communicate with Vault so that the login token expired and with it the dynamic DB credential pair. We now added a |
Beta Was this translation helpful? Give feedback.
-
btw |
Beta Was this translation helpful? Give feedback.
-
With |
Beta Was this translation helpful? Give feedback.
We finally solved our issue. When browsing the Quarkus Vault config options we stumbled up the following:
This is exactly what happened to us. We were under the impression that Quarkus will automatically keep the Vault token "fresh" at any time but our service (low traffic) does not constantly communicate with Vault so that the login token expired and with i…