### Helm: Multiple Services with Multiple Controllers Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/multiple-services This example illustrates how to configure multiple Service objects, each pointing to distinct controllers. This setup is ideal for managing and exposing different microservices or components independently within a Helm deployment. ```yaml controllers: main: containers: main: image: repository: ghcr.io/mendhak/http-https-echo tag: 31 pullPolicy: IfNotPresent second: containers: main: image: repository: ghcr.io/mendhak/http-https-echo tag: 31 pullPolicy: IfNotPresent service: main: controller: main ports: http: port: 8080 second: controller: main ports: http: port: 8081 third: controller: second ports: http: port: 8081 ``` -------------------------------- ### Example values.yaml for Vaultwarden Deployment Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template This snippet shows an example `values.yaml` file used to deploy the Vaultwarden application using the App Template Helm chart. It configures container images, environment variables, service ports, ingress, routing rules, and persistence settings. Ensure you consult the common library documentation and its `values.yaml` for a comprehensive list of configuration options. ```yaml # yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s-labs/helm-charts/app-template-4.5.0/charts/other/app-template/values.schema.json controllers: main: strategy: Recreate containers: main: image: # -- image repository repository: vaultwarden/server # -- image tag # this example is not automatically updated, so be sure to use the latest image tag: 1.25.2 # -- image pull policy pullPolicy: IfNotPresent # -- environment variables. # See [image docs](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template) for more details. env: # -- Config dir DATA_FOLDER: "config" # -- Configures service settings for the chart. service: main: controller: main ports: http: port: 80 websocket: enabled: true port: 3012 ingress: # -- Enable and configure ingress settings for the chart under this key. main: hosts: - host: chart-example.local paths: - path: / pathType: Prefix service: identifier: main port: http - path: /notifications/hub/negotiate pathType: Prefix service: identifier: main port: http - path: /notifications/hub pathType: Prefix service: identifier: main port: websocket route: # -- Enable and configure route settings for the chart under this key. main: parentRefs: - name: gateway namespace: gateway-namespace sectionName: gateway-section hostnames: - chart-example.local rules: - matches: - path: type: PathPrefix value: "/" backendRefs: - kind: Service port: 80 name: main namespace: default weight: 1 - matches: - path: type: PathPrefix value: "/notifications/hub/negotiate" backendRefs: - kind: Service port: 80 name: main namespace: default weight: 1 - matches: - path: type: PathPrefix value: "/notifications/hub" backendRefs: - kind: Service port: 3012 name: main namespace: default weight: 1 # -- Configure persistence settings for the chart under this key. persistence: config: type: persistentVolumeClaim accessMode: ReadWriteOnce size: 1Gi globalMounts: - path: /config ``` -------------------------------- ### App Template v2 to v3 Configuration Migration Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/upgrade-instructions Compares and contrasts the Helm chart values for 'app-template' between v2 and v3. The v3 example showcases changes in service account naming, controller naming, and the introduction of probes. ```yaml --- defaultPodOptions: securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 controllers: main: containers: main: image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent service: main: ports: http: port: 8080 ingress: media: enabled: true className: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / service: name: main port: http persistence: media: existingClaim: nas-media globalMounts: - path: /data/nas-media ``` ```yaml --- defaultPodOptions: enableServiceLinks: true securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 controllers: sabnzbd: # this can now be any name you wish containers: app: # this can now be any name you wish image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent probes: liveness: enabled: true readiness: enabled: true startup: enabled: true spec: failureThreshold: 30 periodSeconds: 5 service: app: # this can now be any name you wish controller: sabnzbd ports: http: port: 8080 ingress: media: # this can now be any name you wish className: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / service: identifier: app port: http persistence: media: existingClaim: nas-media globalMounts: - path: /data/nas-media ``` -------------------------------- ### Helm Chart Values Migration (YAML) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/upgrade-instructions Demonstrates the transformation of Helm chart values from version 1.x.x to 2.x.x. This example highlights key changes in structure and default settings, aiding users in updating their configurations. ```yaml image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent podSecurityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 service: main: ports: http: port: 8080 ingress: media: enabled: true ingressClassName: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / persistence: media: enabled: true existingClaim: nas-media globalMounts: - path: /data/nas-media probes: liveness: enabled: false readiness: enabled: false startup: enabled: false ``` ```yaml defaultPodOptions: securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 controllers: main: containers: main: image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent probes: liveness: enabled: false readiness: enabled: false startup: enabled: false service: main: ports: http: port: 8080 ingress: media: enabled: true className: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / service: name: main port: http persistence: media: existingClaim: nas-media globalMounts: - path: /data/nas-media ``` -------------------------------- ### Add Helm Chart Repository Source: https://bjw-s-labs.github.io/helm-charts/docs/index Adds the bjw-s Helm chart repository to your local Helm configuration. This allows you to search and install charts from this repository. Ensure Helm is installed before running this command. ```bash helm repo add bjw-s https://bjw-s-labs.github.io/helm-charts ``` -------------------------------- ### Helm Template Usage in values.yaml Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/helm-templates Demonstrates how to use Helm templating within a values.yaml file to dynamically set configuration values. This is particularly useful for image tags and other parameters that should adapt to the chart's version or other contextual information. The example shows a 'tag' field being set using the '{{.Chart.AppVersion}}' template. ```yaml containers: subcleaner: name: subcleaner image: repository: k8s.gcr.io/git-sync/git-sync tag: {{.Chart.AppVersion}} args: - --repo=https://github.com/KBlixt/subcleaner.git - --branch=master - --depth=1 - --root=/add-ons/subcleaner ``` -------------------------------- ### Configure Multiple SubPaths for a Volume in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/multiple-subpath This example demonstrates how to configure a Helm chart to mount multiple subPaths from the same volume into a container. It utilizes the `advancedMounts` section, specifying `subPath` as a list to map different files or directories from a volume to distinct paths within the container's filesystem. This is useful for scenarios where a single volume needs to provide configuration files or data to multiple parts of an application or different containers. ```yaml persistence: config: type: configMap name: my-configMap advancedMounts: main: main: - path: /data/config.yaml readOnly: false subPath: config.yaml - path: /data/secondConfigFile.yaml readOnly: false subPath: secondConfigFile.yaml second-container: - path: /appdata/config readOnly: true second-controller: main: - path: /data/config.yaml readOnly: false subPath: config.yaml ``` -------------------------------- ### Minimal NFS Share Configuration in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/nfs-share This configuration enables and sets up an NFS share for persistent storage within a Helm chart. It requires specifying the NFS server's IP address or hostname and the path to the share on the server. This setup mounts the specified NFS share to the '/config' directory. Mount options cannot be specified with this inline configuration. ```yaml persistence: config: enabled: true type: nfs server: 10.10.0.8 path: /tank/nas/library ``` -------------------------------- ### Helm: Default Container Options (Merge Strategy) Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/howto/default-container-options Configures default container options using the 'merge' strategy in Helm charts. Default configurations are merged with container-specific settings. This example demonstrates merging resource requests, combining both default and container-specific values. ```yaml controllers: main: defaultContainerOptionsStrategy: merge defaultContainerOptions: resources: requests: memory: 1Gi cpu: 150m containers: main: ... resources: requests: cpu: 100m ``` -------------------------------- ### Helm: Default Container Options (Overwrite Strategy) Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/howto/default-container-options Configures default container options using the 'overwrite' strategy in Helm charts. If a container has a matching entry, the default configuration is entirely replaced by the container-specific one. This example shows resource requests. ```yaml controllers: main: defaultContainerOptions: resources: requests: memory: 1Gi cpu: 150m containers: main: ... resources: requests: cpu: 100m ``` -------------------------------- ### Configure qBittorrent with Gluetun Sidecar (Helm) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/examples/qbittorrent-gluetun This YAML configuration defines a Helm chart for deploying qBittorrent with the Gluetun VPN sidecar. It specifies image repositories, tags, environment variables for VPN configuration, container security contexts, and volume mounts for persistent storage and port forwarding information. It also sets up Kubernetes Service and Ingress resources. ```yaml --- # yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s-labs/helm-charts/app-template-4.5.0/charts/other/app-template/values.schema.json # Configure options applied to all pods defaultPodOptions: automountServiceAccountToken: false controllers: # Configure the main controller main: annotations: reloader.stakater.com/auto: "true" # Configure the pod-specific securityContext pod: securityContext: fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" containers: # Configure the main application container main: image: # -- image repository repository: ghcr.io/onedr0p/qbittorrent # -- image tag # this example is not automatically updated, so be sure to use the latest image tag: 4.6.0 # Configure the container-specific securityContext securityContext: runAsUser: 568 runAsGroup: 568 # Configure the gluetun sidecar gluetun: dependsOn: main image: # -- image repository repository: ghcr.io/qdm12/gluetun # -- image tag # this example is not automatically updated, so be sure to use the latest image tag: latest # -- environment variables. # See [image docs](https://github.com/qdm12/gluetun-wiki) for more details on how to configure # your VPN and how to set up port-forwarding. env: VPN_TYPE: wireguard VPN_INTERFACE: wg0 # Configure the container-specific securityContext securityContext: capabilities: add: - NET_ADMIN port-forward: dependsOn: gluetun image: repository: docker.io/snoringdragon/gluetun-qbittorrent-port-manager tag: "1.0" env: - name: QBITTORRENT_SERVER value: localhost - name: QBITTORRENT_PORT value: "8080" - name: PORT_FORWARDED value: "/tmp/gluetun/forwarded_port" service: # Configure a service for the main application main: controller: main type: ClusterIP ports: http: port: 8080 ingress: # Configure an Ingress for the main application main: className: "external-nginx" hosts: - host: &host "qb.example.local" paths: - path: / pathType: Prefix service: identifier: main port: http tls: - hosts: - *host persistence: # Configure the main configuration storage location config: existingClaim: qbittorrent-config advancedMounts: main: main: - path: /config # Configure an emptyDir to share the port-forwarding location between containers gluetun-data: type: emptyDir advancedMounts: main: gluetun: - path: /tmp/gluetun port-forward: - path: /tmp/gluetun readOnly: true ``` -------------------------------- ### Deploy Home-Assistant with code-server Sidecar (Helm) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/examples/home-assistant-codeserver This Helm chart configuration deploys Home-Assistant as the main application and a code-server instance as a sidecar. It specifies container images, ports, services for both, and ingress rules for external and internal access. Persistence is configured for Home-Assistant configuration and backups. ```yaml # yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s-labs/helm-charts/app-template-4.5.0/charts/other/app-template/values.schema.json # Configure options applied to all pods defaultPodOptions: automountServiceAccountToken: false securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" controllers: # Configure the main controller main: type: statefulset annotations: reloader.stakater.com/auto: "true" containers: # Configure the main application container main: image: # -- image repository repository: ghcr.io/onedr0p/home-assistant # -- image tag # this example is not automatically updated, so be sure to use the latest image tag: 2023.11.2 # Configure the code-server sidecar code: dependsOn: main image: # -- image repository repository: ghcr.io/coder/code-server # -- image tag # this example is not automatically updated, so be sure to use the latest image tag: 4.19.0 args: - --auth - "none" - --user-data-dir - "/config/.vscode" - --extensions-dir - "/config/.vscode" - --port - "8081" - "/config" service: # Configure a service for the main application main: controller: main type: ClusterIP ports: http: port: 8123 # Configure a service for the code-server sidecar code: type: ClusterIP controller: main ports: http: port: 8081 ingress: # Configure an Ingress for the main application main: className: "external-nginx" hosts: - host: &host "hass.example.local" paths: - path: / pathType: Prefix service: identifier: main port: http tls: - hosts: - *host # Configure an Ingress for the code-server sidecar code: className: "internal-nginx" hosts: - host: &host-code "hass-code.example.local" paths: - path: / pathType: Prefix service: identifier: code port: http tls: - hosts: - *host-code persistence: # Configure the main configuration storage location config: existingClaim: home-assistant-config globalMounts: - path: /config # Configure an NFS mount to store backups on backup: type: nfs server: nas.example.lan path: /volume/Backups/k8s/hass globalMounts: - path: /config/backups ``` -------------------------------- ### Configure Advanced Mounts in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/globalOptions Illustrates advanced mounting configurations for specific controllers and containers within Helm charts. This allows fine-grained control over where volumes are mounted, including specifying paths, read-only settings, and sub-paths for individual containers and controllers. ```yaml advancedMounts: main: main: - path: /data/config.yaml readOnly: true subPath: config.yaml second-container: - path: /appdata/config readOnly: true second-controller: main: - path: /data/config.yaml readOnly: false subPath: config.yaml ``` -------------------------------- ### Configure Service Accounts in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/upgrade-instructions Demonstrates the updated syntax for configuring service accounts in Helm charts, including enabling or disabling them and setting static token preferences. This replaces the older default and extra service account configuration. ```yaml serviceAccount: myServiceAccount: {} mySecondServiceAccount: staticToken: true myThirdServiceAccount: enabled: false controllers: main: serviceAccount: identifier: myServiceAccount ``` -------------------------------- ### Configure Global Mounts in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/globalOptions Demonstrates how to configure global mounts for persistence items in Helm charts. This allows specifying the path and read-only status for volumes mounted across all controllers and containers. By default, the persistence item is mounted to a path derived from its name. ```yaml globalMounts: - path: /config readOnly: false ``` -------------------------------- ### Helm: Multiple Services with Single Controller Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/multiple-services This configuration demonstrates how to set up multiple Service objects that all direct traffic to a single controller. It is useful for scenarios where different ports or configurations of the same underlying service need to be exposed. ```yaml controllers: main: containers: main: image: repository: ghcr.io/mendhak/http-https-echo tag: 31 pullPolicy: IfNotPresent service: main: controller: main ports: http: port: 8080 second: controller: main ports: http: port: 8081 ``` -------------------------------- ### Configure Custom Volume with downwardAPI - YAML Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/custom This snippet demonstrates the minimal configuration for enabling a custom persistent volume. It utilizes the `custom` type and specifies a `volumeSpec` with `downwardAPI` to mount metadata like labels and annotations. This is useful for injecting runtime information into pods. ```yaml persistence: config: enabled: true type: custom volumeSpec: downwardAPI: items: - path: "labels" fieldRef: fieldPath: metadata.labels - path: "annotations" fieldRef: fieldPath: metadata.annotations ``` -------------------------------- ### Configure Image Persistence with Helm Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/image This configuration snippet demonstrates how to set up image persistence in Helm charts. It utilizes the 'image' type to mount an OCI artifact, such as a container image, as a volume. The `image` field specifies the OCI artifact reference, and `pullPolicy` can be used to control image pulling behavior. This feature requires Kubernetes version 1.33 or higher. ```yaml persistence: config: type: image image: quay.io/crio/artifact:v2 ``` -------------------------------- ### Reference Preexisting ConfigMap for Environment Variables Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Allows referencing an already existing ConfigMap for environment variables. This is useful when configuration is managed outside the current Helm chart. ```yaml controllers: main: containers: main: envFrom: - configMapRef: name: preexisting-configmap-name ``` -------------------------------- ### Configure emptyDir Volume in Helm Chart (YAML) Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/emptyDir This configuration enables an ephemeral emptyDir volume and mounts it to the specified path (e.g., `/config`). The `type` is set to `emptyDir` under `persistence.config`. The `medium` field can optionally be set to `Memory` for a RAM-backed filesystem. ```yaml persistence: config: enabled: true type: emptyDir # medium: Memory # sizeLimit: 512Mi ``` -------------------------------- ### Create ConfigMap for Shared Environment Variables Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Defines a ConfigMap containing environment variables and then references it for a container's environment. This is ideal for managing shared configuration across multiple containers or applications. ```yaml configMaps: app-config: data: ENV_VAR_NAME: "value" ANOTHER_ENV_VAR: "another value" controllers: main: containers: main: envFrom: - configMapRef: identifier: app-config ``` -------------------------------- ### Minimal Secret Mount Configuration (Helm/YAML) Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/secret This configuration demonstrates the simplest way to mount a Kubernetes Secret as a persistent volume using Helm. It enables persistence, specifies the type as 'secret', and references a pre-existing Secret by its 'name'. The Secret's contents will be mounted to a default path within the pod. ```yaml persistence: config: enabled: true type: secret name: mySecret ``` -------------------------------- ### Define Environment Variables Directly in Container (Dictionary) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Sets environment variables for a container using a dictionary format, where keys are variable names and values are their corresponding string values. This offers a more concise syntax for simple key-value pairs. ```yaml containers: main: env: ENV_VAR_NAME: "value" ANOTHER_ENV_VAR: "another value" ``` -------------------------------- ### Configure Dynamically Provisioned PVC in Helm Chart Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/persistentVolumeClaim This configuration enables dynamic provisioning of a Persistent Volume Claim (PVC) for Helm charts. It requires specifying the access mode and size, with optional parameters for storage class and name override. The PVC will be created automatically when the chart is deployed. ```yaml persistence: config: enabled: true type: persistentVolumeClaim accessMode: ReadWriteOnce size: 1Gi ``` -------------------------------- ### Helm: Default Pod Options - Merge Strategy Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/howto/default-pod-options Illustrates the 'merge' strategy for default Pod options in Helm charts. This strategy combines default Pod options with controller-specific configurations, preserving both. It's ideal for augmenting existing default settings without complete replacement. ```yaml defaultPodOptionsStrategy: merge defaultPodOptions: resources: requests: memory: 1Gi cpu: 150m controllers: main: pod: resources: requests: cpu: 100m containers: main: ... ``` ```yaml resources: requests: memory: 1Gi cpu: 100m ``` -------------------------------- ### Helm Chart Value Diff (YAML) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/upgrade-instructions Compares old and new Helm chart values, highlighting additions, deletions, and modifications. This diff is useful for understanding configuration changes between chart versions and identifying necessary adjustments. ```yaml --- old: defaultPodOptions: enableServiceLinks: true securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 controllers: main: containers: main: image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent probes: liveness: enabled: true readiness: enabled: true startup: enabled: true spec: failureThreshold: 30 periodSeconds: 5 service: main: ports: http: port: 8080 ingress: media: enabled: true className: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / service: name: main port: http persistence: media: existingClaim: nas-media globalMounts: - path: /data/nas-media ++ new + defaultPodOptions: + enableServiceLinks: true securityContext: runAsUser: 568 runAsGroup: 568 fsGroup: 568 fsGroupChangePolicy: "OnRootMismatch" supplementalGroups: - 65539 controllers: - main: + sabnzbd: # this can now be any name you wish containers: - main: + app: # this can now be any name you wish image: repository: ghcr.io/onedr0p/sabnzbd tag: latest pullPolicy: IfNotPresent + probes: + liveness: + enabled: true + readiness: + enabled: true + startup: + enabled: true + spec: + failureThreshold: 30 + periodSeconds: 5 + service: - main: + app: # this can now be any name you wish + controller: sabnzbd ports: http: port: 8080 ingress: - media: - enabled: true + media: # this can now be any name you wish className: "ingress-nginx" hosts: - host: sabnzbd.bjw-s.dev paths: - path: / service: - name: main + identifier: app port: http persistence: media: existingClaim: nas-media globalMounts: - path: /data/nas-media ``` -------------------------------- ### Helm: Default Pod Options - Overwrite Strategy Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/howto/default-pod-options Demonstrates the 'overwrite' strategy for default Pod options in Helm charts. This strategy replaces any existing default Pod option with the controller-specific configuration. It's useful when the chart-defined defaults should be completely overridden. ```yaml defaultPodOptions: resources: requests: memory: 1Gi cpu: 150m controllers: main: pod: resources: requests: cpu: 100m containers: main: ... ``` ```yaml resources: requests: cpu: 100m ``` -------------------------------- ### Rendered Output with Helm Template Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/helm-templates Shows the output of the Helm chart after the templating in values.yaml has been processed. The 'tag' field, previously a template, is now rendered with the specific application version (e.g., 'v3.6.2'). This illustrates the dynamic nature of Helm templating for configuration. ```yaml containers: subcleaner: name: subcleaner image: repository: k8s.gcr.io/git-sync/git-sync tag: v3.6.2 args: - --repo=https://github.com/KBlixt/subcleaner.git - --branch=master - --depth=1 - --root=/add-ons/subcleaner ``` -------------------------------- ### Configure ConfigMap Persistence in Helm Charts Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/configmap This configuration enables mounting a ConfigMap as a persistent volume. It requires specifying the type as 'configMap' and providing either the 'name' or 'identifier' of the ConfigMap to be mounted. The 'defaultMode' and 'items' fields offer further customization for file permissions and specific item configurations. The ConfigMap will be mounted read-only by default. ```yaml persistence: config: enabled: true type: configMap name: mySettings ``` -------------------------------- ### Configure Host Path Persistence in Helm Chart Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/hostPath This configuration snippet enables hostPath persistence for a given item, mounting a specified path from the host node into the container. It requires the `hostPath` field to be set and optionally accepts `hostPathType` for added checks. This is useful for accessing node-level directories or attached USB devices. ```yaml persistence: config: enabled: true type: hostPath hostPath: /dev ``` -------------------------------- ### Define Environment Variables Directly in Container (List) Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Sets environment variables for a container using a list of name-value pairs. This is a straightforward method for defining individual variables. ```yaml containers: main: env: - name: ENV_VAR_NAME value: "value" - name: ANOTHER_ENV_VAR value: "another value" ``` -------------------------------- ### Manage Secrets as Environment Variables Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Defines a Secret containing sensitive key-value pairs and then references it for a container's environment. This ensures that sensitive data is handled securely. ```yaml secrets: app-secrets: SECRET_KEY: "s3cr3t" controllers: main: containers: main: envFrom: - secretRef: identifier: app-secrets ``` -------------------------------- ### Define Ordered and Dependent Environment Variables Source: https://bjw-s-labs.github.io/helm-charts/docs/app-template/howto/environment-variables Allows explicit definition of environment variable dependencies using the `dependsOn` field. This is useful when the order of variable evaluation is critical, such as when one variable's value relies on another. ```yaml containers: main: env: STATIC_ENV: 1 DYNAMIC_ENV: valueFrom: fieldRef: fieldPath: spec.nodeName dependsOn: STATIC_ENV ORDERED_ENV: value: true dependsOn: STATIC_ENV DEPENDENT_ENV: value: moo_two dependsOn: - DYNAMIC_ENV - ORDERED_ENV ``` -------------------------------- ### Configure Existing PVC Attachment in Helm Chart Source: https://bjw-s-labs.github.io/helm-charts/docs/common-library/storage/types/persistentVolumeClaim This configuration allows Helm charts to attach to a pre-existing Persistent Volume Claim (PVC). You must provide the name of the existing PVC to be mounted. This is useful for reusing existing storage resources. ```yaml persistence: config: enabled: true type: persistentVolumeClaim existingClaim: myAppData ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.