Skip to content

feat: Add affinity support for schema Job #904

@kubroid

Description

@kubroid

Problem

The server-job.yaml template uses $.Values.admintools.nodeSelector and $.Values.admintools.tolerations for the schema Job pod spec, but affinity is not applied, despite admintools.affinity: {} being defined in values.yaml.

Additionally, the schema: section in values.yaml has no scheduling-related fields at all (nodeSelector, tolerations, affinity), making it impossible to independently control where the schema Job runs.

Current behavior

server-job.yaml (lines 208–215):

{{- with $.Values.admintools.nodeSelector }}
nodeSelector:
  {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $.Values.admintools.tolerations }}
tolerations:
  {{- toYaml . | nindent 8 }}
{{- end }}

affinity block is missing entirely.

Expected behavior

Either:

Option A — respect admintools.affinity in the Job (minimal fix):

{{- with $.Values.admintools.affinity }}
affinity:
  {{- toYaml . | nindent 8 }}
{{- end }}

Option B — add dedicated schema.affinity / schema.nodeSelector / schema.tolerations fields so the Job can be scheduled independently from the admintools deployment.

values.yaml change needed

schema:
  # ... existing fields ...
  nodeSelector: {}
  tolerations: []
  affinity: {}

This is useful in environments where the schema migration Job needs to run on specific nodes (e.g. nodes with database network access, or spot/preemptible exclusion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions