Validate Auto Reload of your Application
Managing application deployments and keeping configurations up-to-date can be challenging. Changes to secrets or configmaps for instance, often require manual intervention to update the application and trigger a redeployment. This can lead to operational inefficiencies and potential downtime.
To address this challenge, Stakater has Reloader—a powerful tool that automates the process of reloading deployments when related resources, such as secrets or configmaps, change. In this tutorial, we will explore how to set up Reloader in your SAAP and configure it to automatically trigger the reload of a deployment whenever a secret changes.
- Enable Reloader to monitor changes in the secret and reload the deployment.
- Verify the changes in the secret triggers an automatic reload of the deployment.
- Test the automatic deployment reloading by updating the secret and observing the changes.
Let's take a look at the secret before any change.
The secret we created for our deployment earlier, notice the details and the value of
mongodb-password which is
Add this YAML to your
It should look like this:
The indentation should be application.deployment.reloadOnChange: true.
Save and run
tilt upat the root of your directory. Hit the space bar and the browser with
TILTlogs will be shown. If everything is green then the changes will be deployed on the cluster.
Now go to the
Deployments, and see if it has updated with the
Let's change one of the values of
Log in to
Vaultand got to
your-tenant/kv, click on the secret
review-mongodb-creds, then click on
create new version.
You can now edit the values of your secret which will be considered a new version of your external secret. Edit
mongodb-passwordand set the value to
Let's go to SAAP to see if the new version of the external secret has been deployed. Go to
review-mongodb-creds, and scroll down to see
Data. On the right corner you will see
Reveal values, hit on it and see the value for
Now let's go to
Podsand see if the pod of our
reviewapplication has reloaded. You will see the new pod
reviewis deploying and once it's in a
Ready 1/1, the older pod will be
To see more information related to Stakater's Reloader project, click here.
And voila! now you don't have to redeploy your application manually for each change, Reloader to the Rescue!
Let's move on to the next tutorial to know how to set up alerts for any downtime.