0
0
Kubernetesdevops~20 mins

Creating custom Helm charts in Kubernetes - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Helm Chart Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Helm template rendering output
You have a Helm chart with a template that uses the following snippet:
{{- if .Values.service.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}-service
spec:
  type: {{ .Values.service.type }}
{{- end }}

If the values.yaml contains:
service:
  enabled: true
  type: ClusterIP

What will be the output of helm template mychart . regarding the Service resource?
AThe Service resource is included but the name is missing.
BNo Service resource is included because the template has a syntax error.
CThe Service resource is included but with type LoadBalancer regardless of values.yaml.
DThe Service resource YAML is included with type ClusterIP and name mychart-service.
Attempts:
2 left
💡 Hint
Check how the if condition uses the values.yaml to include the Service resource.
Configuration
intermediate
2:00remaining
Correct Helm Chart directory structure
Which of the following directory structures is the correct minimal layout for a custom Helm chart named myapp?
A
myapp/
  Chart.yaml
  values.yaml
  templates/
    deployment.yaml
    service.yaml
B
myapp/
  chart.yaml
  values.yaml
  templates/
    deployment.yaml
C
myapp/
  Chart.yaml
  values.yaml
  template/
    deployment.yaml
D
myapp/
  Chart.yaml
  values.yaml
  templates.yaml
Attempts:
2 left
💡 Hint
Remember Helm requires a Chart.yaml file and a templates directory.
Troubleshoot
advanced
2:00remaining
Helm install failure due to missing values
You run helm install myapp ./mychart and get the error:
Error: YAML parse error on mychart/templates/deployment.yaml: error converting YAML to JSON: yaml: line 10: did not find expected key

What is the most likely cause?
AThe values.yaml file is empty causing the deployment template to fail.
BThe deployment.yaml template has incorrect indentation or missing colon causing YAML syntax error.
CThe Kubernetes cluster is not reachable causing Helm to fail.
DThe Chart.yaml file is missing causing Helm to fail parsing templates.
Attempts:
2 left
💡 Hint
YAML parse errors usually mean indentation or syntax issues in the template files.
🔀 Workflow
advanced
2:00remaining
Helm chart versioning best practice
You want to release a new version of your Helm chart with bug fixes but no API changes. Which version bump is recommended according to semantic versioning in Chart.yaml?
AIncrease the minor version, e.g., from 1.2.3 to 1.3.0
BIncrease the major version, e.g., from 1.2.3 to 2.0.0
CIncrease the patch version, e.g., from 1.2.3 to 1.2.4
DKeep the same version number since only bug fixes were made
Attempts:
2 left
💡 Hint
Semantic versioning uses patch version for bug fixes without API changes.
🧠 Conceptual
expert
3:00remaining
Helm hooks execution order
Given these Helm hook annotations in templates:
  • pre-install
  • post-install
  • pre-upgrade
  • post-upgrade

What is the correct order of execution when you run helm upgrade --install on a new release?
A1, 2
B3, 4
C1, 3, 4, 2
D1, 2, 3, 4
Attempts:
2 left
💡 Hint
For a new release, only install hooks run, not upgrade hooks.