Questions tagged [kubernetes-helm]

Helm is a tool for managing packages (i.e. charts) of templated Kubernetes resources.

Helm simplifies deploying a set of related Kubernetes resources by defining a standard directory structure to hold a set of YAML files, by adding a templating system to produce the actual Kubernetes resources, and by allowing prepackaged applications or components to be directly imported or installed.

The Go text/template engine allows values to be filled into Kubernetes YAML files. In a typical chart, templates/database_statefulset.yaml might contain the fragment:

containers:
  - name: mysql
    image: "{{ .Values.image }}:{{ .Values.tag }}"

values.yaml would provide default values for these settings:

image: mysql
tag: latest

When you install the chart, you can provide specific values for these settings.

helm install . --set tag=5.6

This tag is appropriate for most questions about Helm, including questions about the templating system and the command-line tool. It will frequently also be appropriate to tag questions as related, and many questions relate to the more general system. Do not tag questions as ; that is for a different tool.

External links

6042 questions
21
votes
1 answer

Using include inside range in Go templates (helm)

I have a template that get rendered several times with a range iteration and I can access variables external variables such as $.Release.Name without a problem. However, when I include templates I can't get it to work: {{ range $key, $val :=…
znat
  • 13,144
  • 17
  • 71
  • 106
21
votes
1 answer

How to debug Helm chart errors like "error converting YAML to JSON: yaml: mapping values are not allowed in this context"?

I'm using Helm 3 and microk8s. When I try a dry run: microk8s.helm install <...> --dry-run --debug I see errors like Error: YAML parse error on ./templates/deployment.yaml: error converting YAML to JSON: yaml: mapping values are not allowed in…
Yann
  • 2,426
  • 1
  • 16
  • 33
21
votes
2 answers

helm-template get value of the map by key

In the helm-template I'm trying to retrieve a value of the map by key. I've tried to use the index from the go-templates, as suggested here: Access a map value using a variable key in a Go template However it doesn't work for me (see later test).…
Peter Butkovic
  • 11,143
  • 10
  • 57
  • 81
21
votes
8 answers

helm: x509: certificate signed by unknown authority

I'm using Kubernetes and I recently updated my admin certs used in the kubeconfig. However, after I did that, all the helm commands fail thus: Error: Get…
21
votes
5 answers

Docker how to use boolean value on spec.container.env.value

Is there a way to pass a boolean value for spec.container.env.value ? I want to override, with helm, a boolean env variables in a docker parent image (https://github.com/APSL/docker-thumbor) : UPLOAD_ENABLED I made a simpler test If you try the…
Damien GOUYETTE
  • 467
  • 1
  • 3
  • 11
20
votes
4 answers

Cannot install kubernetes helm chart Error: cannot re-use a name that is still in use

Cannot install the helm chart but when I use raw file generated by helm, I am able to install via kubectl apply. Following error is displayed when i use helm install myChart . --debug Error: cannot re-use a name that is still in use helm.go:88:…
Encycode
  • 530
  • 2
  • 7
  • 18
20
votes
7 answers

List all the kubernetes resources related to a helm deployment or chart

I deployed a helm chart using helm install and after this I want to see if the pods/services/cms related to just this deployment have come up or failed. Is there a way to see this? Using kubectl get pods and greping for the name works but it does…
D. Rao
  • 423
  • 2
  • 6
  • 16
20
votes
4 answers

If clause in helm chart

How can I check if a variable is a boolean value "true" in helm chart? I have in Values.yaml a parameter set as: myParameter: true I don't understand well difference between: {{- if .Values.service.myParameter }} and {{- if eq…
Riccardo Califano
  • 1,317
  • 3
  • 10
  • 19
20
votes
3 answers

How to reference kubernetes secrets in helm chart?

I want to make some deployments in kubernetes using helm charts. Here is a sample override-values yaml that I use: imageRepository: "" ocbb: imagePullPolicy: IfNotPresent TZ: UTC logDir: /oms_logs tnsAdmin: /oms/ora_k8 …
Tians
  • 443
  • 1
  • 5
  • 14
20
votes
2 answers

Automatically use secret when pulling from private registry

Is it possible to globally (or at least per namespace), configure kubernetes to always use an image pull secret when connecting to a private repo? There are two use cases: when a user specifies a container in our private registry in a…
apr_1985
  • 1,764
  • 2
  • 14
  • 27
19
votes
3 answers

Is it possible to define variables use if/else condition in helm chart?

In my values.yaml I have: isLocal: false localEnv: url: abcd prodEnv: url: defg Then I have a service.yaml: {{- if .Values.isLocal }} {{- $env := .Values.localEnv }} {{- else}} {{- $env := .Values.prodEnv }} {{- end}} url: {{…
disccip
  • 573
  • 3
  • 5
  • 15
19
votes
2 answers

Kubernetes-Helm Charts pointing to a local docker image

I'm playing around wiht minikube and I have a config in my values.yaml defined like this image: repository: mydocker.jfrog.io/mysql I want it to point a to a local docker image that lives locally mysql/docker/dockerfile I'm not sure what the…
edmamerto
  • 7,605
  • 11
  • 42
  • 66
19
votes
3 answers

Deploying a kubernetes job via helm

I am new to helm and I have tried to deploy a few tutorial charts. Had a couple of queries: I have a Kubernetes job which I need to deploy. Is it possible to deploy a job via helm? Also, currently my kubernetes job is deployed from my custom…
codec
  • 7,978
  • 26
  • 71
  • 127
19
votes
1 answer

How do I use json variables in a yaml file (Helm)

I have a HELM values file which looks like so: service: environment: dev spring_application_json: >- { "spring" : { "boot" : { "admin" : { "client" : { "enabled" : "false", …
Garreth
  • 1,057
  • 2
  • 9
  • 24
19
votes
1 answer

helm overriding Chart and Values yaml from a base template chart

I have defined a parent chart called base-microservice and is available at mycompany.github.com/pages/base-microservice Structure is as follows : base-microservice - templates - deployment.yaml - ingress.yaml …
hackmabrain
  • 457
  • 1
  • 6
  • 21