Custom Volumes in Helm Installation

Mount Kubernetes volumes to JFrog pods using customVolumes and customVolumeMounts in Helm values.yaml.

A Kubernetes volume is a directory accessible to all containers in a pod. To configure custom volumes, use the customVolumes and customVolumeMounts sections for each product, following the official Kubernetes volume parameters.

Artifactory Example

This example mounts a configMap as a custom volume. Any supported Kubernetes volume type works in place of it.

  1. To create a configMap called log-config that contains a test.yaml file, run the following command:

    kubectl create configmap log-config --from-file=test.yaml
  2. To create a custom volume, update the customVolumes section as follows:

    artifactory:
      customVolumes: |
        - name: config-vol ## Name of the custom volume
          configMap: ## Predefined parameter of the configMap
            name: log-config
  3. To define the mount path (/tmp/etc/) for the volume, update the customVolumeMounts section as follows:

    artifactory:
      customVolumes: |
        - name: config-vol ## Name of the custom volume
          configMap: ## Predefined parameter of the configMap
            name: log-config
    
      customVolumeMounts: |
        - name: config-vol ## Name of the custom volume    
          mountPath: /tmp/etc/test.yaml
          subPath: test.yaml
  4. These settings bootstrap the configMap under the /tmp/etc folder. To interact with custom volumes further, use preStartCommand.

    artifactory:
      customVolumes: |
        - name: config-vol
          configMap:
            name: log-config
    
      customVolumeMounts: |
        - name: config-vol ## The name here must match the name set under customVolumes    
          mountPath: /tmp/etc/test.yaml
          subPath: test.yaml
      preStartCommand: "cat /tmp/etc/test.yaml"

Follow the same steps to manage custom volumes for Xray and Distribution, updating the configurations under the correct parent keys.

Xray Example

xray:
  common:
    customVolumes: |
      - name: config-vol
        configMap:
          name: log-config

    customVolumeMounts: |
      - name: config-vol ## The name here must match the name set under customVolumes    
        mountPath: /tmp/etc/test.yaml
        subPath: test.yaml
    preStartCommand: "cat /tmp/etc/test.yaml"

Distribution Example

distribution:
  common:
    customVolumes: |
      - name: config-vol
        configMap:
          name: log-config

    customVolumeMounts: |
      - name: config-vol ## The name here must match the name set under customVolumes    
        mountPath: /tmp/etc/test.yaml
        subPath: test.yaml
    preStartCommand: "cat /tmp/etc/test.yaml"