Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What templating language does helm use?

I am new to kubernetes and helm. I started using helm and I have the follwoing snippet:

{{- $image := printf "%s/%s:%s" $.Values.global.repository $.Values.global.images.xxx.image $.Values.global.images.xxx.tag -}}
apiVersion: v1
kind: Pod
metadata:
  name: xxxx-test-ready
  labels:
    app: xxxxx-test
    app.kubernetes.io/name: xxxxx-test
    helm.sh/chart: authsvc
    release: {{ $.Release.Name }}
    app.kubernetes.io/instance: {{ $.Release.Name }}
    app.kubernetes.io/managed-by: {{ $.Release.Service }}

My issue is here:

  {{- $image := printf "%s/%s:%s" $.Values.global.repository $.Values.global.images.xxx.image $.Values.global.images.xxx.tag -}}

I think I understand what it does : basically it creates the image specification and add it to a var called image for later use case. however I do not feel comfortable with this templating language and I am not even sure if it is erlang or golang. What is the best starting point to get confident with this templating language? Should I learn golang?

like image 350
Learner Avatar asked Mar 09 '26 23:03

Learner


1 Answers

The best starting point is to read the official documentation: The Chart Template Developer’s Guide, which provides an introduction to Helm’s chart templates, with emphasis on the template language.

While we talk about “Helm template language” as if it is Helm-specific, it is actually a combination of the Go template language, some extra functions, and a variety of wrappers to expose certain objects to the templates. Many resources on Go templates may be helpful as you learn about templating.

Helm has over 60 available functions. Some of them are defined by the Go template language itself. Most of the others are part of the Sprig template library.

Dig into the above Sprig and Go Template documentation to enhance your knowledge about chart templates.

like image 87
Eduardo Baitello Avatar answered Mar 12 '26 13:03

Eduardo Baitello



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!