Chart-Modus
Übersicht über den ohMyHelm Chart-Modus: Deployment, StatefulSet und DaemonSet samt Service, Ingress, RBAC, Probes, Volumes und Monitoring konfigurieren.
Chart-Modus
Mit chart.enabled: true erzeugt ohMyHelm eine vollständige Anwendungs-Bereitstellung in Kubernetes — inklusive Workload, Service, optionalem Ingress, Health Checks, Volumes, RBAC, Secrets, ConfigMaps und Monitoring.
Was erzeugt der Chart-Modus?
Je nach Konfiguration generiert ohMyHelm aus dem chart:-Block folgende Ressourcen im Release-Namespace:
- Workload: wahlweise
Deployment(Standard),StatefulSetoderDaemonSet - Service:
v1/Servicemit automatischem Namenohmyhelm.fullname - ServiceAccount:
v1/ServiceAccount(standardmäßigcreate: true) - Ingress (optional):
chart.ingressSimplefür Single-Host oderchart.ingressfür komplexe Routing-Regeln - RBAC (optional): namespace-bezogene
RoleundRoleBindingviachart.rbac - Multi-Container (optional):
chart.initContainer,chart.sidecarundchart.extraContainers - Chart-Helper (optional):
chart.secrets,chart.configs,chart.monitoringundchart.job - Autoscaling (optional):
chart.autoscaling(Hinweis zu Kubernetes ≥ 1.25 beachten)
Minimalkonfiguration
# Chart.yaml
apiVersion: v2
name: acme-service
version: 0.1.0
dependencies:
- name: ohmyhelm
alias: app
repository: https://gitlab.com/api/v4/projects/28993678/packages/helm/stable
version: 1.18.0
# values.yaml
app:
chart:
enabled: true
fullnameOverride: "acme-service"
container:
image: nginxinc/nginx-unprivileged:1.27-alpine
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
service:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
Workload-Typ wählen
ohMyHelm unterstützt drei Workload-Typen im Chart-Modus:
- Deployment (Standard):
chart.deployment: true,chart.statefulset: false,chart.daemonset: false— ideal für zustandslose Webservices, APIs und Worker. - StatefulSet:
chart.statefulset: true(empfohlen:chart.deployment: false) — für zustandsbehaftete Dienste mit stabilen Pod-Namen undstatefulsetVolume.volumeClaimTemplates. - DaemonSet:
chart.daemonset: true(empfohlen:chart.deployment: false) — für Node-lokale Agenten wie Log-Collector oder Monitoring-Exporter.
Alle Details zur Flag-Logik, Update-Strategien und Volumes finden Sie unter Workloads: Deployment, StatefulSet und DaemonSet.
Ressourcen und Autoscaling richtig konfigurieren
CPU- und Memory-Limits (chart.container.resources)
Definieren Sie requests und limits immer direkt am Container (bzw. unter chart.sidecar.resources):
chart:
enabled: true
container:
image: registry.acme.corp/app:1.2.0
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
HorizontalPodAutoscaler auf Kubernetes ≥ 1.25
Ingress im Chart-Modus
Einfacher Ingress (chart.ingressSimple)
Für einen einzelnen Host genügt chart.ingressSimple. Das Template routet automatisch auf den Chart-Service (ohmyhelm.fullname) und dessen Port mit name: http:
chart:
enabled: true
fullnameOverride: "acme-web"
service:
ports:
- name: http
port: 80
targetPort: http
ingressSimple:
enabled: true
host: web.acme.example
path: /
pathType: Prefix
tlsSecretName: acme-web-tls
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
Erweiterter Ingress (chart.ingress)
Für mehrere Hosts oder Pfade verwenden Sie chart.ingress mit gültiger networking.k8s.io/v1-Syntax:
chart:
enabled: true
fullnameOverride: "acme-web"
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
tls:
- secretName: acme-web-tls
hosts:
- web.acme.example
- api.acme.example
hosts:
- host: web.acme.example
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: acme-web
port:
name: http
- host: api.acme.example
http:
paths:
- path: /v1
pathType: Prefix
backend:
service:
name: acme-web
port:
name: http