CodeBlanks Logo Icon CodeBlanks

helm install

Learn to install a chart with helm install.

helm install

helm install RELEASE CHART renders the templates with the values and applies the resulting YAMLs to the cluster. The chart can come from a repository, a local folder or a .tgz package:

helm install magaza ./magaza -n magaza --create-namespace
helm install cache bitnami/redis --version 20.2.1
helm install magaza ./magaza --dry-run --debug    # only show

--wait waits until all resources are ready; it's used on CI to catch a failed installation.

See the template first

helm template renders the templates without connecting to the cluster at all and prints the resulting YAML. It's used to see what a chart will produce and to feed GitOps tools; helm lint checks the chart for errors:

helm lint ./magaza
helm template magaza ./magaza --set replicaCount=3 | kubectl apply --dry-run=server -f -

Practice Install the chart

Write three commands: lint the ./magaza chart; render the templates locally with the release name magaza; install ./magaza with the release name magaza into the magaza namespace (creating it if missing) and wait until ready.

Starter code

terminal
# buraya yaz

Sample solution

terminal
helm lint ./magaza
helm template magaza ./magaza
helm install magaza ./magaza -n magaza --create-namespace --wait

Expected output

==> Linting ./magaza
1 chart(s) linted, 0 chart(s) failed
---
# Source: magaza/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: magaza-web
NAME: magaza
NAMESPACE: magaza
STATUS: deployed
REVISION: 1

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does helm install ... --version 20.2.1 pin?

  • The Kubernetes version
  • The chart version Correct answer
  • The application (image) version
  • The Helm version

Explanation: For a reproducible installation, the chart version is always pinned.

2 Create the namespace if it doesn't exist.

Question
helm install magaza ./magaza -n magaza ____
Answer
helm install magaza ./magaza -n magaza --create-namespace

Explanation: Helm creates the namespace itself.

3 Match.

Term Meaning
helm install Install
--dry-run Show without applying
helm template Render locally
helm lint Check the chart

All lessons in Advanced