Summary - Helm
- Docker & Kubernetes course
- Advanced
- Lesson 12/70
- 5 min
Combine install, values and upgrade to manage a chart.
Summary: Helm
In this group:
- Helm is Kubernetes's package manager: chart (package), release (installed instance), repo (repository).
- Chart:
Chart.yaml(version, appVersion),values.yaml, Go-templatedtemplates/. helm install(-n,--create-namespace,--version,--wait),template,lint.- Values: values.yaml <
-f<--set;helm get/show values. upgrade --install,history,rollback,--atomic,uninstall.
helm upgrade --install magaza ./magaza -n magaza -f prod-values.yaml --atomic
helm rollback magaza 1 -n magazaPractice Write a template
Write a Helm Service template: apiVersion: v1, kind: Service; name {{ .Release.Name }}-web; type: {{ .Values.service.type }}; selector app: {{ .Release.Name }}-web; port port: {{ .Values.service.port }}.
Starter code
# templates/service.yaml
# buraya yazSample solution
# templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-web
spec:
type: {{ .Values.service.type }}
selector:
app: {{ .Release.Name }}-web
ports:
- port: {{ .Values.service.port }}Expected output
$ helm template magaza ./magaza --set service.type=NodePort
apiVersion: v1
kind: Service
metadata:
name: magaza-web
spec:
type: NodePort
selector:
app: magaza-web
ports:
- port: 80
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which shows what a chart will produce without connecting to the cluster at all?
- helm history
- helm status
- helm template Correct answer
- helm install
Explanation: helm install --dry-run talks to the cluster; helm template doesn't.
2 Uninstall the release.
helm ____ magaza -n magaza
helm uninstall magaza -n magaza
Explanation: uninstall deletes the release's resources.
3 Match.
| Term | Meaning |
|---|---|
install |
Install |
upgrade |
Upgrade |
rollback |
Roll back |
uninstall |
Uninstall |