Understanding Kubernetes deployments with Helm

What is a Kubernetes object?

  • The spec is set when you create the object and describes what you want to happen in your cluster.
  • The status is the current state of the object which is continually updated by the Kubernetes system. Kubernetes ensures that the two states match.

What is Helm?

What are charts?

  • The templates folder has template files that are combined with the config values from the values.yaml file to create the Kubernetes manifests.
  • The Chart.yaml file includes data about the chart e.g. name and version and details of who is the maintainer.
  • The values.yaml file has default configuration values for the chart.

How does a release work?

Understanding YAML templates in Helm

  • The template files have template directives embedded in so you can use {{ …}} to inject in objects.
  • Template files can include {{ .Values.whatever.whateverelse }} which uses the values which you have added to your values.yaml file. There are other built-in objects which may be helpful — more detail here in the Helm Docs.
  • $ is used to define a variable and := is used to assign a value.
  • $ is also useful if you are looping in a range and you want to access a value outside of the range.
  • |- declares a multi-line string.
  • {{- … -}} will chomp the white space from left and right — needed if you have an if statement on its own line for example, otherwise a blank line will appear in the YAML file.
  • You can use if / else for conditional blocks and range for a “for each” loop. For example: {{- range $.Values.deployments -}} means go through each of the items in the deployments list in the values.yaml file.

Conclusion

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

First steps into Web Development: Where to begin?

E16 — Joe Apfelbaum / Ajax Union

Experiment to write 30 days daily- day 17

XDATA — Challenges we have to make our data streaming pipeline at XP inc.

Polling with Kotlin Channels & Flows

Web 3.0 vs. Metaverse a comparison and analysis on experty. io

Comparing Moodle Workplace and Totara Learn

Porsche NEXT OI Competition: DRIVING

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Genny Allcroft

Genny Allcroft

More from Medium

Sealed Secrets for Kubernetes

Increased developer productivity with Kubernetes virtual cluster

Migration to Kubernetes — the process, pitfalls, and success

Build Container Images with Jenkins and Podman