0
0
Kubernetesdevops~10 mins

Creating custom Helm charts in Kubernetes - Visual Walkthrough

Choose your learning style9 modes available
Process Flow - Creating custom Helm charts
Start: Define Chart Structure
Create Chart.yaml
Create values.yaml
Create templates/ directory
Add Kubernetes YAML templates
Use placeholders for values
Package and install chart
Chart deployed with custom values
END
This flow shows the step-by-step process of creating a Helm chart: starting with structure, adding metadata, templates, and values, then packaging and deploying.
Execution Sample
Kubernetes
helm create mychart
# Edit mychart/Chart.yaml
# Edit mychart/values.yaml
# Add templates/deployment.yaml with placeholders
helm install myrelease mychart -f custom-values.yaml
This sequence creates a Helm chart, customizes it, and installs it with custom values.
Process Table
StepActionFile/CommandEffect/Result
1Create new chart skeletonhelm create mychartFolder 'mychart' with default files created
2Edit Chart.yamlmychart/Chart.yamlSet chart name, version, description
3Edit values.yamlmychart/values.yamlDefine default configuration values
4Add template with placeholdersmychart/templates/deployment.yamlTemplate uses {{ .Values.key }} for dynamic values
5Package chart (optional)helm package mychartChart packaged as .tgz file
6Install chart with custom valueshelm install myrelease mychart -f custom-values.yamlKubernetes resources deployed with custom settings
7Verify deploymentkubectl get podsPods running as per chart configuration
8Exit-Chart deployed successfully, process complete
💡 Chart installed and Kubernetes resources created, no further steps
Status Tracker
Variable/FileStartAfter Step 2After Step 3After Step 4After Step 6Final
Chart.yamlempty templatename, version setunchangedunchangedunchangedunchanged
values.yamldefault valuesunchangedcustom values addedunchangedused for deploymentunchanged
templates/deployment.yamldefault templateunchangedunchangedplaceholders addedrendered with valuesunchanged
Kubernetes deploymentnonenonenonenonecreated with custom valuesrunning pods
Key Moments - 3 Insights
Why do we use placeholders like {{ .Values.key }} in templates?
Placeholders allow templates to use dynamic values from values.yaml or custom files, as shown in step 4 and step 6 of the execution_table.
What happens if we don't provide a custom values file during install?
Helm uses default values from values.yaml, so deployment uses those defaults (see step 6 and variable_tracker for values.yaml).
Why do we need to edit Chart.yaml if it has defaults?
Chart.yaml defines metadata like name and version, important for identifying the chart, as shown in step 2.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step are placeholders added to templates?
AStep 2
BStep 4
CStep 6
DStep 1
💡 Hint
Check the 'Action' column for 'Add template with placeholders' in execution_table
According to variable_tracker, what is the state of values.yaml after Step 3?
ACustom values added
BDefault values only
CEmpty file
DUsed for deployment
💡 Hint
Look at values.yaml row under 'After Step 3' in variable_tracker
If you skip editing Chart.yaml, what is the likely effect?
AChart will fail to install
BTemplates won't render
CChart installs with default metadata
DValues.yaml is ignored
💡 Hint
Refer to step 2 and the key_moments about Chart.yaml importance
Concept Snapshot
Creating custom Helm charts:
1. Use 'helm create <name>' to scaffold.
2. Edit Chart.yaml for metadata.
3. Define default config in values.yaml.
4. Add templates with {{ .Values.key }} placeholders.
5. Install with 'helm install' and optional custom values.
6. Kubernetes resources deploy using these configs.
Full Transcript
Creating custom Helm charts involves starting with a scaffold using 'helm create'. Then, you edit Chart.yaml to set the chart's name and version. Next, you define default configuration values in values.yaml. Templates in the templates directory use placeholders like {{ .Values.key }} to insert these values dynamically. You can package the chart or install it directly with 'helm install', optionally providing a custom values file to override defaults. This process results in Kubernetes resources deployed with your custom settings.