Skip to content

Package an Application as a Helm Chart

Easy ~30 min

What you'll build

A reusable Helm Chart that deploys a web application with configurable replica count, image tag, and service type.

Goals

  • Understand Helm Chart structure
  • Create templates for Deployment and Service
  • Write a values.yaml with configurable parameters
  • Install and upgrade the Chart

Prerequisites

  • Helm installed
  • A Kubernetes cluster
  • Basic understanding of Kubernetes manifests

Steps

  1. 1

    Create the Chart scaffold

    Use helm create to generate the Chart directory structure with default templates.

    Code
    helm create my-app-chart
    cd my-app-chart

    Expected result

    A Chart directory is created with templates/, values.yaml, and Chart.yaml.

  2. 2

    Customize values.yaml

    Edit values.yaml to define configurable parameters: replicaCount, image repository and tag, service type and port.

    Code
    replicaCount: 2
    image:
      repository: nginx
      tag: "1.25"
    service:
      type: ClusterIP
      port: 80

    Expected result

    values.yaml is customized with the parameters you want to make configurable.

  3. 3

    Review and customize templates

    Look at templates/deployment.yaml and templates/service.yaml. They use Go template syntax to reference values from values.yaml. Customize them if needed.

    Expected result

    You understand how templates reference values using {{ .Values.xxx }} syntax.

  4. 4

    Install and test the Chart

    Install the Chart with default values, then upgrade it with a custom value to see how Helm applies changes.

    Code
    helm install my-release .
    # Upgrade with custom replica count
    helm upgrade my-release . --set replicaCount=5
    # Verify
    kubectl get pods

    Expected result

    The application is deployed with 2 replicas, then upgraded to 5 replicas.

  5. 5

    Add a health check endpoint

    Add a /health endpoint returning 200 OK for orchestration systems (Kubernetes, load balancers) to probe liveness. Health checks are foundational for production deployment.

    Code
    # app.py (Flask example)
    from flask import Flask, jsonify
    app = Flask(__name__)
    
    @app.route("/health")
    def health():
        return jsonify({"status": "ok"}), 200
    
    @app.route("/ready")
    def ready():
        # Check DB connection etc.
        return jsonify({"ready": True}), 200

    Expected result

    curl localhost:5000/health returns {"status":"ok"} with a 200 status code.

Try it yourself

What you learned

You created a Helm Chart that packages a Kubernetes application with configurable values. Helm Charts make it easy to share, version, and deploy applications consistently.

Related Resources

Related Glossary

  • Helm

    Kubernetes package manager

Related Glossary

A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.

  • Helm

    Kubernetes package manager

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to topic