Skip to content

feat: Add support for init containers and multiple volumes#90

Merged
keelerm84 merged 4 commits intolaunchdarkly:mainfrom
rhiremani:feature/addVolumesInitCont2Deployment
Feb 10, 2026
Merged

feat: Add support for init containers and multiple volumes#90
keelerm84 merged 4 commits intolaunchdarkly:mainfrom
rhiremani:feature/addVolumesInitCont2Deployment

Conversation

@rhiremani
Copy link
Contributor

@rhiremani rhiremani commented Feb 4, 2026

Requirements

  • [ ] I have added test coverage for new or changed functionality
  • [ √] I have followed the repository's pull request submission guidelines
  • [√ ] I have validated my changes against all supported platform versions

Related issues

Provide links to any issues in this repository or elsewhere relating to this pull request.

Describe the solution you've provided
I have added sections to add initcontainers and extra volume needed to support them.

Describe alternatives you've considered
We have considered other alternatives of fetching the available helm chart and adding kustomization on top to maintain the whole spec. These can be added to values.yaml for deployments which use consul and corresponding changes in the template/deployment

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

> make update-golden-files
ok  	ld-relay-helm/test	1.968s

> make test
==> Linting .

1 chart(s) linted, 0 chart(s) failed
ok  	ld-relay-helm/test	1.775s

Sample values.yaml file - if it can be added in the documentation

nameOverride: "my-ld-relay"

Node selector for pod placement

nodeSelector:
   nodepool: my-nodepool

image:
  repository: <my-docker-repo>/my-ld-relay
  tag: v8-proxy

serviceAccount:
  name: my-ld-relay

relay:
  environment:
    USE_REDIS: "true"
    REDIS_HOST: "redis-master.my.svc.cluster.local"
    #REDIS_HOST: "10.x.x.x" # TODO check for actual redis address in dev/prod deploy
    REDIS_PREFIX: "ld-relay-latest"
    CACHE_TTL: "0"

  # Consul fetching logic
  initContainers:
    - name: fetch-consul-keys
      image: <my-docker-repo>/alpine:latest
      command: ["/bin/sh", "-c"]
      args:
        - |
          CONSUL_URL="http://consul-server:8500/v1/kv"
          echo "export LD_ENV_latest=$(wget -qO- ${CONSUL_URL}/common/launch-darkly/api-key?raw)" > /shared/.env
          echo "export LD_PREFIX_latest=$(wget -qO- ${CONSUL_URL}/common/launch-darkly/ld-prefix-latest?raw)" >> /shared/.env
          echo "export LD_CLIENT_SIDE_ID_latest=$(wget -qO- ${CONSUL_URL}/common/launch-darkly/client-id-latest?raw)" >> /shared/.env
          echo "export REDIS_PASSWORD=$(wget -qO- ${CONSUL_URL}/common/myRedis/authString?raw)" >> /shared/.env

      volumeMounts:
        - name: env-share
          mountPath: /shared

  extraVolumes:
    - name: env-share
      emptyDir: {}
  
  extraVolumeMounts:
    - name: env-share
      mountPath: /shared

  # Health Checks
  readinessProbe:
    httpGet:
      path: /status
      port: 8030
  livenessProbe:
    httpGet:
      path: /status
      port: 8030

# Entrypoint wrapper
command: ["/bin/sh", "-c"]
args:
  - |
    [ -f /shared/.env ] && . /shared/.env
    /usr/bin/ld-relay --from-env

@keelerm84
Copy link
Member

@rhiremani Thank you for this contribution. I have modified this PR slightly. The original implementation could have lead to a conflict with two command sections being generated.

If you want to confirm these changes work for you, that would be fantastic. Thanks!

@rhiremani rhiremani force-pushed the feature/addVolumesInitCont2Deployment branch from 813eb8a to d892ae2 Compare February 9, 2026 20:26
@rhiremani rhiremani requested a review from a team as a code owner February 9, 2026 20:26
@keelerm84 keelerm84 changed the title Add volumes init containers to deployment feat: Add support for init containers and multiple volumes Feb 9, 2026
@rhiremani
Copy link
Contributor Author

@keelerm84 Thank you for the thorough review and adding the test cases.
I can confirm that all the changes above (including the latest changes with the test cases) works fine and renders the yaml as intended.
It will be helpful for us if a tag can be generated for this latest helm chart (after merging), which we can refer to.
Appreciate the support.

@keelerm84 keelerm84 merged commit c5cd4ff into launchdarkly:main Feb 10, 2026
4 of 5 checks passed
keelerm84 pushed a commit that referenced this pull request Feb 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.5.0](3.4.1...3.5.0)
(2026-02-10)


### Features

* Add support for init containers and multiple volumes
([#90](#90))
([c5cd4ff](c5cd4ff))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@keelerm84
Copy link
Member

@rhiremani v3.5.0 has been released with support for this functionality. Thank you for your contribution!

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