Examples and Use Cases

Practical ohMyHelm examples and use cases: web app with Ingress, StatefulSet database, sidecar, multi-service chart, GitOps, and third-party helpers.

Examples and Use Cases

This page brings together typical usage scenarios and fully tested configuration examples for ohMyHelm — from a quick prototype to a structured multi-service chart.

1. Web Application with Ingress, ConfigMap, and Probes

The most common use case: a stateless web application or API behind an Ingress with properly configured resource limits and health checks.

# Chart.yaml
apiVersion: v2
name: acme-webapp
version: 0.1.0

dependencies:
  - name: ohmyhelm
    alias: webapp
    repository: https://gitlab.com/api/v4/projects/28993678/packages/helm/stable
    version: 1.18.0
# values.yaml
webapp:
  chart:
    enabled: true
    fullnameOverride: "acme-webapp"
    replicaCount: 2

    container:
      image: registry.acme.corp/webapp:1.4.2
      ports:
        - name: http
          containerPort: 8080
          protocol: TCP
      env:
        - name: APP_ENV
          value: production
      resources:
        requests:
          cpu: 100m
          memory: 128Mi
        limits:
          cpu: 500m
          memory: 256Mi
      livenessProbe:
        httpGet:
          path: /healthz
          port: http
        initialDelaySeconds: 15
        periodSeconds: 10
      readinessProbe:
        httpGet:
          path: /readyz
          port: http
        initialDelaySeconds: 5
        periodSeconds: 5

    deploymentVolume:
      volumeMounts:
        - name: app-config
          mountPath: /etc/app/config.yaml
          subPath: config.yaml
          readOnly: true
      volumes:
        - name: app-config
          configMap:
            name: acme-webapp-config

    service:
      type: ClusterIP
      ports:
        - name: http
          port: 80
          targetPort: http
          protocol: TCP

    ingressSimple:
      enabled: true
      host: app.acme.example
      path: /
      pathType: Prefix
      tlsSecretName: acme-webapp-tls
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt-prod

    configs:
      - name: acme-webapp-config
        dontOverrideOnUpdate: false
        values:
          config.yaml: |
            server:
              port: 8080
              logLevel: info

2. Stateful Service as a StatefulSet

For databases, queues, or services requiring persistent storage, enable chart.statefulset: true and configure statefulsetVolume along with volumeClaimTemplates:

chart:
  enabled: true
  deployment: false
  statefulset: true
  fullnameOverride: "acme-postgres"
  replicaCount: 1

  container:
    image: postgres:16-alpine
    ports:
      - name: postgres
        containerPort: 5432
        protocol: TCP
    env:
      - name: POSTGRES_DB
        value: acme
      - name: POSTGRES_USER
        valueFrom:
          secretKeyRef:
            name: acme-postgres-auth
            key: username
      - name: POSTGRES_PASSWORD
        valueFrom:
          secretKeyRef:
            name: acme-postgres-auth
            key: password
    resources:
      requests:
        cpu: 250m
        memory: 512Mi
      limits:
        cpu: 1000m
        memory: 1Gi

  service:
    type: ClusterIP
    clusterIP: None
    ports:
      - name: postgres
        port: 5432
        targetPort: postgres
        protocol: TCP

  statefulsetVolume:
    volumeMounts:
      - name: pgdata
        mountPath: /var/lib/postgresql/data
    volumeClaimTemplates:
      - metadata:
          name: pgdata
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 20Gi

  secrets:
    - name: acme-postgres-auth
      values:
        username: acme
        password: ""

3. Application with Sidecar and Shared Volume

When a sidecar (such as a log forwarder or config reloader) needs to access the same volume as the main container, set chart.sidecar.useContainerVolume: true:

chart:
  enabled: true
  fullnameOverride: "acme-api"

  container:
    image: registry.acme.corp/api:2.1.0
    ports:
      - name: http
        containerPort: 8080
    resources:
      requests:
        cpu: 100m
        memory: 128Mi

  sidecar:
    enabled: true
    image: fluent/fluent-bit:3.1
    useContainerVolume: true
    env:
      - name: LOG_PATH
        value: /var/log/app/app.log
    resources:
      requests:
        cpu: 50m
        memory: 64Mi

  deploymentVolume:
    volumeMounts:
      - name: app-logs
        mountPath: /var/log/app
    volumes:
      - name: app-logs
        emptyDir: {}

  service:
    type: ClusterIP
    ports:
      - name: http
        port: 80
        targetPort: http

If the companion container needs its own ports or different volume mounts, use chart.extraContainers instead.

4. Extending Third-Party Charts with Helpers

Many third-party charts expect pre-existing Secrets, ConfigMaps, or registry credentials. Include ohMyHelm as a helper-only dependency (chart.enabled remains false):

# Chart.yaml
apiVersion: v2
name: acme-thirdparty-wrapper
version: 0.1.0

dependencies:
  - name: ohmyhelm
    alias: prereqs
    repository: https://gitlab.com/api/v4/projects/28993678/packages/helm/stable
    version: 1.18.0
# values.yaml
prereqs:
  imageCredentials:
    - name: acme-registry-cred
      namespace: acme-prod
      registry: https://registry.acme.corp
      username: pull-bot
      accessToken: "<token-via-ci-secret>"

  configs:
    - name: shared-env-config
      namespace: acme-prod
      values:
        CLUSTER_REGION: eu-central-1
        LOG_FORMAT: json

5. Multi-Service Environments with Shared Defaults and Overrides

For microservice architectures, define a base values.yaml and environment-specific overlay files (values-staging.yaml, values-prod.yaml):

# Override values per environment or via --set
helm upgrade --install acme-stack . \
  --namespace acme-prod \
  -f values.yaml \
  -f values-prod.yaml \
  --set webapp.chart.container.image=registry.acme.corp/webapp:1.4.3 \
  --set webapp.chart.replicaCount=4

6. Adding Modern Kubernetes Resources via manifests:

For resources that ohMyHelm does not provide a dedicated template for — such as HorizontalPodAutoscaler (autoscaling/v2), PodDisruptionBudget, or NetworkPolicy — add them directly via the manifests: helper:

manifests:
  - apiVersion: policy/v1
    kind: PodDisruptionBudget
    content:
      metadata:
        name: acme-webapp-pdb
        namespace: acme-prod
      spec:
        minAvailable: 1
        selector:
          matchLabels:
            app: acme-webapp

  - apiVersion: autoscaling/v2
    kind: HorizontalPodAutoscaler
    content:
      metadata:
        name: acme-webapp-hpa
        namespace: acme-prod
      spec:
        scaleTargetRef:
          apiVersion: apps/v1
          kind: Deployment
          name: acme-webapp
        minReplicas: 2
        maxReplicas: 10
        metrics:
          - type: Resource
            resource:
              name: cpu
              target:
                type: Utilization
                averageUtilization: 75

Related Pages