Skip to content

Conversation

@mattjohnson
Copy link
Collaborator

Summary

This PR adds support for configuring additional volumes and volume mounts on the IQ Server main container, based on the work in PR #51 by @sleyer.

This implementation includes several improvements and fixes to ensure the feature produces clean, idiomatic Kubernetes YAML and has accurate documentation.

Changes

Feature Implementation (from PR #51)

  • ✅ Add extraVolumes configuration supporting:
    • persistentVolumeClaim (via existingClaim)
    • hostPath
    • configMap
    • secret
    • emptyDir (with optional parameters)
  • ✅ Add extraVolumeMounts configuration with:
    • Required: name, mountPath
    • Optional: subPath, readOnly
  • ✅ Comprehensive helm unit tests for both features
  • ✅ Example configurations in values.yaml

Improvements & Fixes

  1. Fixed volumeMounts rendering (Critical)

    • Previously rendered empty values for optional fields: subPath: "" and readOnly:
    • Now properly omits optional fields when not specified
    • Uses hasKey check for readOnly to handle explicit false values
    • Produces cleaner, more idiomatic Kubernetes YAML
  2. Fixed documentation errors

    • Corrected typo: subpathsubPath (capital P)
    • Fixed incorrect comment about readOnly default (Kubernetes defaults to false/read-write, not true)
  3. Updated test expectations

    • Removed incorrect null assertions for optional fields
    • Tests now properly validate that fields are omitted when not specified
  4. Improved test metadata

    • Updated suite names to accurately reflect what's being tested
    • Removed trailing whitespace and added proper newlines

Testing

All changes verified with:

  • helm lint chart/ - passes with no errors
  • ✅ Template rendering tests with minimal configuration (only required fields)
  • ✅ Template rendering tests with all fields specified
  • ✅ All volume types tested (secret, configMap, etc.)

Example Rendering

Before (with fixes):

# Minimal configuration - clean output
- name: test-mount
  mountPath: /test/path

# With all options - everything renders correctly
- name: test-mount
  mountPath: /test/path
  subPath: mysubpath
  readOnly: false

Previously:

# Minimal configuration - had empty values
- name: test-mount
  mountPath: /test/path
  subPath: 
  readOnly: 

Use Case

This feature enables users to mount custom certificates, configuration files, or other resources into the IQ Server container via ConfigMaps, Secrets, or other Kubernetes volume types.

Related

Checklist

  • Code changes are tested and verified
  • Helm lint passes
  • Template rendering produces valid YAML
  • Documentation is accurate
  • Test files are clean and properly formatted
  • Original author attribution preserved

mattjohnson and others added 2 commits December 15, 2025 10:31
Allow users to configure additional volumes and volume mounts on the
IQ Server main container. This is useful for mounting custom certificates
via ConfigMaps, Secrets, or other volume types into the container.

- Add extraVolumes configuration with support for:
  - persistentVolumeClaim (existingClaim)
  - hostPath
  - configMap
  - secret
  - emptyDir
- Add extraVolumeMounts configuration with mountPath, subPath, and readOnly options
- Include comprehensive helm unit tests for both features
- Add examples in values.yaml for all volume types

Co-authored-by: Sascha Leyer <[email protected]>
Based-on: #51
Improvements to the extraVolumes/extraVolumeMounts feature:

1. Fix volumeMounts conditional rendering:
   - Only render subPath field when actually specified
   - Only render readOnly field when explicitly set
   - Use hasKey check for readOnly to handle explicit false values
   - This produces cleaner, more idiomatic Kubernetes YAML

2. Fix documentation errors in values.yaml:
   - Correct typo: 'subpath' → 'subPath' (capital P)
   - Fix incorrect default comment for readOnly
     (Kubernetes defaults to false/read-write, not true)

3. Update test expectations:
   - Remove null assertions for optional fields
   - Fields are now properly omitted when not specified

4. Improve test suite names:
   - Rename to accurately reflect what's being tested
   - iq-server-deployment-extra-volumes
   - iq-server-deployment-extra-volume-mounts

5. Clean up test files:
   - Remove trailing whitespace
   - Add proper newlines at end of files

All changes verified with helm lint and template rendering tests.

Addresses review feedback on PR #51
Copy link
Contributor

@jawadshaikst jawadshaikst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mattjohnson mattjohnson merged commit df4da3e into main Dec 15, 2025
1 check passed
@mattjohnson mattjohnson deleted the fix/extra-volumes-and-mounts branch December 15, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants