Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always renew sk-api token creation credentials #330

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pascal-meunier
Copy link
Collaborator

With the Deployer option to use an initContainer to obtain vault token creation credentials for sk-api, you would expect those credentials to be renewed whenever sk-api is restarted by Kubernetes, but that doesn't always happen due to the way Kubernetes works (this is a known design decision discussed elsewhere). This patch levers the new Kubernetes 1.28 option for init containers to have a restart policy. The init container will always restart, and the renewal script will loop until it gets credentials from the vault, ensuring that sk-api is always able to function if the vault is running and unsealed.

Take advantage of the new Kubernetes feature for setting restartPolicy for initContainers, so  renew-sk-secret-script will run more reliably
Added an infinite loop to retry getting credentials, and error-checking. This avoids sk-api getting into an infinite loop of its own, from which it can't recover, when sk-secret is bad. The result is more robustness when sk-api starts before the vault or while the vault is sealed.
The export statements for KUBE_TOKEN and KUBE_NAMESPACE were deleted by mistake, this restores them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant