You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Support additional PodSpec fields via optional overlay #217
The current DruidNodeSpec interface does not expose the full range of Kubernetes v1.PodSpec fields, which number over 40. Exposing all of them explicitly is impractical and would lead to an overly complex CRD.
However, there are valid use cases for customizing unmanaged PodSpec fields—such as setting dnsPolicy, dnsConfig, priorityClassName, hostAliases, and others—that are currently unsupported.
This proposal introduces a mechanism to support these use cases without overcomplicating the existing API:
1. Add an optional field AdditionalPodSpec *v1.PodSpec to both DruidSpec and DruidNodeSpec.
2. During reconciliation, non-nil fields from additionalPodSpec are merged into the generated PodSpec. Only fields not already managed by the operator are eligible for merge.
2.1. If a field in additionalPodSpec conflicts with a field already managed by the operator (via DruidNodeSpec), the operator will return an error to avoid silent misconfiguration.
3. DruidSpec.additionalPodSpec defines global defaults across all node types, and DruidNodeSpec.additionalPodSpec overrides those values for specific node roles.
3.1. The merge logic is shallow: individual fields from DruidNodeSpec.additionalPodSpec override corresponding fields from DruidSpec.additionalPodSpec.
This pattern maintains separation of concerns while offering flexibility for advanced users who need finer control over pod-level configuration.
Regarding the CR modification,
I’m considering following the pattern used by built-in workload controllers (e.g. StatefulSet, Deployment) by introducing a .template field of type PodTemplateSpec.
This would allow users to specify the full PodSpec in a familiar format:
spec:
template:
metadata: # <-- Not currently supportedlabels:
app: my-appspec: # <-- This is the actual PodSpec (containers, volumes, etc.)containers:
- name: ...image: ...
Initially, we can document that template.metadata is not supported and enforce that by validating and rejecting CRs that include it. This gives us flexibility to introduce support for it later, once we can determine how to safely merge it with the operator’s own label/annotation logic.
Activity
AdheipSingh commentedon Mar 30, 2025
+1. Feel free to raise a PR.
yurmix commentedon Apr 1, 2025
@AdheipSingh additional thought:
Regarding the CR modification,
I’m considering following the pattern used by built-in workload controllers (e.g.
StatefulSet,Deployment) by introducing a.templatefield of typePodTemplateSpec.This would allow users to specify the full
PodSpecin a familiar format:Initially, we can document that
template.metadatais not supported and enforce that by validating and rejecting CRs that include it. This gives us flexibility to introduce support for it later, once we can determine how to safely merge it with the operator’s own label/annotation logic.