Skip to content

feat: Expose extraTemplateSpec, fix api extraSpec location#547

Merged
germangarces merged 3 commits into
Flagsmith:mainfrom
DelineaMosher:expose-priorityClassName
Jun 16, 2026
Merged

feat: Expose extraTemplateSpec, fix api extraSpec location#547
germangarces merged 3 commits into
Flagsmith:mainfrom
DelineaMosher:expose-priorityClassName

Conversation

@DelineaMosher

@DelineaMosher DelineaMosher commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?

Changes

Add extraTemplateSpec to be added to spec.template.spec in 5 templates. Allows specifying additional fields like priorityClassName. Addresses #446

  1. deployment-api.yaml
  2. deployment-frontend.yaml
  3. deployment-pgbouncer.yaml
  4. deployment-sse.yaml
  5. deployment-task-processor.yaml

In values.yaml move extraSpec outside of bootstrap and directly under api. Template reads from .Values.api.extraSpec, not .Values.api.bootsrap.extraSpec.

How did you test this code?

  1. Compare baseline
helm template flagsmith ./charts/flagsmith > /tmp/default.yaml
helm template flagsmith ./charts/flagsmith > /tmp/baseline.yaml
diff /tmp/baseline.yaml /tmp/default.yaml
  1. priorityClassName renders at correct YAML level
helm template flagsmith ./charts/flagsmith \
  --set api.extraTemplateSpec.priorityClassName=high-priority \
  --show-only templates/deployment-api.yaml \
  | yq '.spec.template.spec.priorityClassName'
  1. Verify arbitrary field renders
helm template flagsmith ./charts/flagsmith \
  --set api.extraTemplateSpec.runtimeClassName=gvisor \
  --set api.extraTemplateSpec.hostNetwork=false \
  --show-only templates/deployment-api.yaml \
  | yq '.spec.template.spec'
  1. Verify all 5 deployments
for tpl in deployment-api deployment-frontend deployment-task-processor deployment-sse deployment-pgbouncer; do
  case $tpl in
    deployment-frontend)     extra="--set api.separateApiAndFrontend=true --set frontend.enabled=true --set frontend.extraTemplateSpec.priorityClassName=test" ;;
    deployment-task-processor) extra="--set taskProcessor.enabled=true --set taskProcessor.extraTemplateSpec.priorityClassName=test" ;;
    deployment-sse)          extra="--set sse.enabled=true --set sse.extraTemplateSpec.priorityClassName=test" ;;
    deployment-pgbouncer)    extra="--set pgbouncer.enabled=true --set pgbouncer.extraTemplateSpec.priorityClassName=test" ;;
    deployment-api)          extra="--set api.extraTemplateSpec.priorityClassName=test" ;;
  esac
                                                                                                                                                                  
  result=$(eval helm template flagsmith ./charts/flagsmith $extra \
    --show-only templates/${tpl}.yaml 2>&1 \
    | yq '.spec.template.spec.priorityClassName')
                                                                                                                                                                  
  echo "$tpl: $result"
done
  1. Verify api.extraSpec fix
helm template flagsmith ./charts/flagsmith \
  --set api.extraSpec.strategy.type=Recreate \
  --show-only templates/deployment-api.yaml \
  | yq '.spec.strategy.type'

6 Verify volumes: included only if extraVolumes is specified.

helm template flagsmith ./charts/flagsmith \
    --show-only templates/deployment-api.yaml 2>&1 | yq '.spec.template.spec.volumes'

helm template flagsmith ./charts/flagsmith \
    --set 'api.extraVolumes[0].name=test-vol' \
    --set 'api.extraVolumes[0].emptyDir.medium=Memory' \
    --show-only templates/deployment-api.yaml 2>&1 | yq '.spec.template.spec.volumes'

# etc for other charts.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds the extraTemplateSpec field to several deployment templates (api, frontend, pgbouncer, sse, and task-processor) to allow custom configuration of spec.template.spec. The reviewer identified a critical issue across all these templates: if extraVolumes is empty but extraTemplateSpec is provided, the templates will render an empty volumes: key, causing Kubernetes API validation to fail. The reviewer suggests conditionally rendering the volumes: block only when volumes are actually defined.

Comment thread charts/flagsmith/templates/deployment-api.yaml
Comment thread charts/flagsmith/templates/deployment-frontend.yaml
Comment thread charts/flagsmith/templates/deployment-pgbouncer.yaml
Comment thread charts/flagsmith/templates/deployment-sse.yaml
Comment thread charts/flagsmith/templates/deployment-task-processor.yaml

@germangarces germangarces left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contrib @DelineaMosher
👍 LGTM

@germangarces germangarces changed the title Expose extraTemplateSpec, fix api extraSpec location feat: Expose extraTemplateSpec, fix api extraSpec location Jun 16, 2026
@germangarces germangarces merged commit cf7c7d2 into Flagsmith:main Jun 16, 2026
2 checks passed
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.

2 participants