Improving the Guestbook Helm chart
The chart created in the previous section was able to successfully deploy the Guestbook application. However, as is the case with any type of software, the Helm chart can always be improved. In this section, we will focus on the following two features that will improve the guestbook
chart:
- Life cycle hooks to back up and restore the Redis database
- Input validation to ensure only valid values are provided
Let's focus first on adding life cycle hooks.
Creating pre-upgrade and pre-rollback life cycle hooks
In this section, we will create two life cycle hooks, as follows:
- The first hook will occur in the
pre-upgrade
life cycle phase. This phase takes place immediately after thehelm upgrade
command is run, but before any Kubernetes resources become modified. This hook will be used to take a data snapshot of the Redis database before performing the upgrade, ensuring that the database is backed up in case the upgrade...