diff --git a/docs/chart_template_guide/values_files.md b/docs/chart_template_guide/values_files.md index 626aca3db..31b34175a 100644 --- a/docs/chart_template_guide/values_files.md +++ b/docs/chart_template_guide/values_files.md @@ -98,4 +98,35 @@ data: While structuring data this way is possible, the recommendation is that you keep your values trees shallow, favoring flatness. When we look at assigning values to subcharts, we'll see how values are named using a tree structure. +## Deleting a default key + +If you need to delete a key from the default values, you may override the value of the key to be `null`, in which case Helm will remove the key from the overridden values merge. + +For example, the stable Drupal chart allows configuring the liveness probe, in case you configure a custom image. Here are the default values: +```yaml +livenessProbe: + httpGet: + path: /user/login + port: http + initialDelaySeconds: 120 +``` + +If you try to override the livenessProbe handler to `exec` instead of `httpGet` using `--set livenessProbe.exec.command=[cat,docroot/CHANGELOG.txt]`, Helm will coalesce the default and overridden keys together, resulting in the following YAML: +```yaml +livenessProbe: + httpGet: + path: /user/login + port: http + exec: + command: + - cat + - docroot/CHANGELOG.txt + initialDelaySeconds: 120 +``` + +However, Kubernetes would then fail because you can not declare more than one livenessProbe handler. To overcome this, you may instruct Helm to delete the `livenessProbe.httpGet` by setting it to null: +```sh +helm install stable/drupal --set image=my-registry/drupal:0.1.0 --set livenessProbe.exec.command=[cat,docroot/CHANGELOG.txt] --set livenessProbe.httpGet=null +``` + At this point, we've seen several built-in objects, and used them to inject information into a template. Now we will take a look at another aspect of the template engine: functions and pipelines.