Understanding the Default Configuration
The WordPress application is deployed using a Kubernetes Deployment resource. Its configuration is partly derived from the values set invalues.yaml. Below is a snippet from the values.yaml file indicating the default settings:
WORDPRESS_BLOG_NAME is set as follows:
The
WORDPRESS_BLOG_NAME environment variable is directly set using the value from values.yaml, meaning that the application will deploy with “User’s Blog!” as the default blog name unless it’s overridden.Overriding Default Values with Command-Line Parameters
When you install WordPress with Helm, the chart deploys using the default values from thevalues.yaml file. To override these defaults on the fly, you can use the --set option with the helm install command. For example, to change the blog name from “User’s Blog!” to “Helm Tut”, use the following command:
--set will take precedence over the defaults defined in the values.yaml file.
Using a Custom Values File
For numerous parameter overrides, maintaining a custom values file is more efficient than using multiple--set options. Follow these steps:
-
Create a file named
custom-values.yamlwith your custom configurations: -
Deploy the chart using the custom values file by running:
custom-values.yaml, thereby overriding the corresponding default values.
Modifying the Built-in values.yaml File
If you wish to modify the built-invalues.yaml within the chart itself, you can do so by following these steps:
-
Use
helm pullto download the chart in an archived (compressed) form: -
To automatically uncompress the chart into a directory, use the
--untaroption: -
List the directory to view the chart files, including
values.yaml: -
Open and edit the
values.yamlfile in your preferred text editor to set your custom configurations. -
Install the chart locally by referencing the modified chart path:
./ indicates the current directory, and Helm installs the chart using your modified files.
When modifying the built-in values.yaml file, ensure you maintain the correct file structure to avoid deployment issues.
This concludes our discussion on customizing chart parameters. You have learned how to override default values in a Bitnami WordPress Helm chart using command-line options with
--set, by employing a custom values file, or by directly modifying the chart’s source after pulling it locally. For more details on Helm and managing Kubernetes resources, explore the official Helm documentation and Kubernetes Basics.