Add affinity configuration to Kubernetes pod template

This commit adds support for specifying pod affinity settings
in the Kubernetes pod template for the Artemis broker Helm chart.
The changes include a new conditional block in the `_pod.tpl`
template file that allows users to define affinity rules in
the `values.yaml` file under the `affinity` key.

The addition was necessary to provide users with more flexibility
in scheduling their pods based on node characteristics, which is
essential for optimizing resource allocation and achieving desired
deployment strategies.

No breaking changes were introduced, and the default `affinity`
configuration remains empty, ensuring backward compatibility.
This commit is contained in:
Marko Oldenburg 2025-03-04 07:26:58 +01:00
parent e4c7b319e2
commit d40a1070fa
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,9 @@
{{- define "amq.pod" -}}
{{- if eq .Values.platform "kubernetes" -}}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 2 -}}
{{- end }}
imagePullSecrets:
- name: {{ .Values.application.pullSecretName }}
{{- end }}

View File

@ -225,3 +225,13 @@ resources: {}
# memory: 1000Mi
#
# k8s affinity
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: disktype
# operator: In
# values:
# - ssd