01
Primeros pasos
Comandos
Comandos principales de Helm.
helm
# helm create mychart
# helm install myapp ./mychart
# helm upgrade myapp ./mychart
# helm uninstall myapp
# helm listEstructura de un chart
Estructura estándar del directorio de un chart.
helm
mychart/
Chart.yaml # chart metadata
values.yaml # default values
templates/
deployment.yaml
service.yaml
_helpers.tpl02
Plantillas
Values
Accede a los valores con .Values; filtro default.
helm
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}
spec:
replicas: {{ .Values.replicas | default 1 }}Helpers
Define e incluye helpers de plantilla.
helm
{{- define "labels" -}}
app: {{ .Chart.Name }}
version: {{ .Chart.Version }}
{{- end -}}
metadata:
labels:
{{ include "labels" . | indent 4 }}Bucles
Range para iterar dentro de las plantillas.
helm
{{- range .Values.services }}
- name: {{ .name }}
port: {{ .port }}
{{- end }}Was this helpful?