Chart-Integrated Helpers

Use chart.secrets, chart.configs, and chart.monitoring directly inside Chart mode, including volume mounts, GitOps caveats, and ServiceMonitor setup.

Chart-Integrated Helpers

When chart.enabled: true is set, you can manage Secrets, ConfigMaps, and Prometheus ServiceMonitors directly inside the chart: block using chart.secrets, chart.configs, and chart.monitoring.

Differences from Root Helpers

Aspect Chart-Integrated Helpers (chart.*) Root Helpers (secrets, configs, monitoring)
Activation Effective only when chart.enabled: true Always active, even without Chart mode
Target namespace chart.secrets / chart.configs always use the release namespace; chart.monitoring uses its own namespace field Individual namespace configurable per entry
monitoring activation Every entry explicitly requires enabled: true No enabled flag required
monitoring resource name Always <ohmyhelm.fullname>-metrics Exact .name

1. chart.secrets

Creates v1/Secret resources in the release namespace (metadata.name is truncated to 63 characters). Empty values ("") are automatically populated with a 20-character random string (randAlphaNum 20) on the initial helm install; existing values are preserved on helm upgrade via lookup.

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

  container:
    image: registry.acme.corp/app:1.2.0
    env:
      - name: DB_USER
        valueFrom:
          secretKeyRef:
            name: acme-db-secret
            key: user
      - name: DB_PASS
        valueFrom:
          secretKeyRef:
            name: acme-db-secret
            key: password

  secrets:
    - name: acme-db-secret
      values:
        user: acme_user
        password: ""

2. chart.configs

Creates v1/ConfigMap resources in the release namespace. With dontOverrideOnUpdate: true, helm upgrade preserves existing ConfigMap values in the cluster via lookup (note: does not apply to GitOps/helm template).

To mount a ConfigMap as a file inside the container, always use the workload's dedicated volume block (chart.deploymentVolume, chart.statefulsetVolume, or chart.daemonsetVolume) — never chart.container.volumeMounts:

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

  container:
    image: registry.acme.corp/app:1.2.0
    ports:
      - name: http
        containerPort: 8080

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

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

3. chart.monitoring (Prometheus ServiceMonitor)

Creates monitoring.coreos.com/v1/ServiceMonitor resources. Keep three important details from omh-chart-prometheus-serviceMonitor.yaml in mind:

  1. Mandatory enabled: true: Each list item under chart.monitoring is rendered only if enabled: true is set.
  2. Known template limitation with scheme: In the current chart release (1.18.0), do not set the scheme field, because the template renders literal scheme: .scheme, which Prometheus Operator rejects.
  3. Label selector alignment: The template selects app.kubernetes.io/name: [<ohmyhelm.fullname>], whereas the Service carries app.kubernetes.io/name: <ohmyhelm.name>. Therefore, set both nameOverride and fullnameOverride to the same value so the ServiceMonitor reliably matches the Service.
chart:
  enabled: true
  nameOverride: "acme-app"
  fullnameOverride: "acme-app"

  container:
    image: registry.acme.corp/app:1.2.0
    ports:
      - name: http
        containerPort: 8080
      - name: metrics
        containerPort: 9090

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

  monitoring:
    - enabled: true
      namespace: monitoring
      release: prometheus
      endpoints:
        - port: metrics
          interval: 30s
          path: /metrics

Further Reading