Skip to content

feat: add additionalInitContainers support to Qdrant StatefulSet#481

Open
naveenkumarsp wants to merge 1 commit into
qdrant:mainfrom
naveenkumarsp:feat/additional-init-containers
Open

feat: add additionalInitContainers support to Qdrant StatefulSet#481
naveenkumarsp wants to merge 1 commit into
qdrant:mainfrom
naveenkumarsp:feat/additional-init-containers

Conversation

@naveenkumarsp

@naveenkumarsp naveenkumarsp commented Jul 9, 2026

Copy link
Copy Markdown

Problem

The chart provides no hook for custom init containers. Operators needing
one-shot node-level setup before Qdrant starts (e.g. raising
vm.max_map_count to avoid ENOMEM on mmap-heavy deployments with many
collections and shards) are forced to use workarounds:

  • A privileged sidecar — no ordering guarantee, must sleep infinity
    to stay alive alongside Qdrant.
  • A separate DaemonSet — decoupled from the pod lifecycle, requires
    node pool label coordination.

Solution

Add additionalInitContainers to values.yaml (default []). Entries
are appended after the existing ensure-dir-ownership init container in
the StatefulSet template, so they run sequentially before Qdrant starts.

Changes

  • templates/statefulset.yaml — render additionalInitContainers after
    the ensure-dir-ownership block.
  • values.yaml — add additionalInitContainers: [] with a fully
    commented real-world example (vm.max_map_count) and guidance on when
    to prefer init containers over sidecarContainers.

Example usage

additionalInitContainers:
  - name: set-vm-max-map-count
    image: busybox
    command: ['sysctl', '-w', 'vm.max_map_count=262144']
    securityContext:
      privileged: true
    resources:
      requests:
        cpu: 1m
        memory: 1Mi

The chart currently has no hook for injecting custom init containers.
Init containers run sequentially to completion before the main Qdrant
container starts, which is the correct place for one-shot node-level
setup (e.g. raising vm.max_map_count before Qdrant loads collections).

Without this, operators must either:
- Add a privileged sidecar that runs sysctl alongside Qdrant (no strict
  ordering guarantee, container must sleep forever to stay alive), or
- Deploy a separate DaemonSet tied to specific node pool labels.

Changes:
- templates/statefulset.yaml: append .Values.additionalInitContainers
  after the existing ensure-dir-ownership init container block.
- values.yaml: add additionalInitContainers: [] with a fully commented
  real-world example (vm.max_map_count) and guidance on when to prefer
  init containers over sidecarContainers.
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.

1 participant