From the course: Kubernetes: Package Management with Helm

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Dynamically render a value with a Helm conditional statement

Dynamically render a value with a Helm conditional statement

From the course: Kubernetes: Package Management with Helm

Start my 1-month free trial

Dynamically render a value with a Helm conditional statement

- [Instructor] Like Programming Languages. The Helm templating engine has conditionals, if/else statements that allow you to render values dynamically, whether or not a condition you set is true or false. Let's go back to our ConfigMap where we have a key called Allow Testing and the value is set as true. Imagine that you have two different environments. Staging is a place where developers can push commits and trigger a set of automated tests to see if the application still works with their changes. And production, where your workloads are handling actual traffic from your users. And therefore doesn't need tests to run because the change has already gotten the thumbs up from your CICT system. In this scenario, we want the value of Allow Testing to be true when the environment is staging and false when the environment is production. The if/else statement is a Helm directive and each part of the statement, the If, the…

Contents