Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add host path storage option to Helm chart #172

@yonch

Description

@yonch

Context

Users running on-premises deployments often need to write collector output to a directory on the host node's filesystem. Currently, our local storage option doesn't properly support this use case, as it uses an empty directory volume rather than mounting a host path.

Requirements

  1. Add a new storage type option called hostPath in the Helm chart
  2. Rename the existing local storage type to emptyDir for clarity (since it uses an emptyDir volume)
  3. For the new hostPath type:
    • Add a configuration parameter for specifying the host directory path to mount
    • Automatically prepend the mounted path to the storage prefix parameter
    • Ensure proper volume and volumeMount configuration in the Helm chart

Implementation Details

  1. Update values.yaml to include the new storage type option:

    storage:
      type: "s3"  # Possible values: "s3", "emptyDir", "hostPath"
      prefix: "memory-collector-metrics-"
      hostPath:
        path: "/mnt/data"  # Path on the host to mount
  2. Rename the existing local type to emptyDir throughout the codebase

    • Update documentation to reflect this change
    • Ensure backward compatibility or provide migration notes
  3. Update the Helm templates to handle the new hostPath storage type:

    • Create the appropriate volumeMount and volume definitions
    • Mount the host path to a fixed location in the container (e.g., /data)
    • When hostPath is selected, automatically prepend the container's mount path to the prefix
    • For example, if the container mount path is /data and storage.prefix is memory-collector-metrics-, the effective prefix should be /data/memory-collector-metrics-
  4. Add validation to ensure the provided paths are valid

  5. Update the charts/collector/README.md with examples of using the new storage type:

    storage:
      type: "hostPath"
      prefix: "memory-collector-metrics-"
      hostPath:
        path: "/mnt/collector-data"  # Path on the host

Acceptance Criteria

  • The Helm chart supports a new hostPath storage type
  • The existing local type is renamed to emptyDir for clarity
  • When using hostPath, the mounted directory is automatically prepended to the storage prefix
  • Documentation is updated to explain the new storage option
  • Tests verify the functionality works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions