diff --git a/helm/charts/nats/files/nats-box/deployment/pod-template.yaml b/helm/charts/nats/files/nats-box/deployment/pod-template.yaml index 71056bfb..3f9e3221 100644 --- a/helm/charts/nats/files/nats-box/deployment/pod-template.yaml +++ b/helm/charts/nats/files/nats-box/deployment/pod-template.yaml @@ -2,6 +2,15 @@ metadata: labels: {{- include "natsBox.labels" $ | nindent 4 }} spec: + {{- with .Values.natsBox.podTemplate.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4 }} + {{- end }} + + {{- with .Values.natsBox.podTemplate.tolerations }} + tolerations: + {{- toYaml . | nindent 4 }} + {{- end }} containers: {{- with .Values.natsBox.container }} - {{ include "nats.loadMergePatch" (merge (dict "file" "nats-box/deployment/container.yaml" "ctx" $) .) | nindent 4 }} diff --git a/helm/charts/nats/files/stateful-set/pod-template.yaml b/helm/charts/nats/files/stateful-set/pod-template.yaml index 9832ba34..30ebc3be 100644 --- a/helm/charts/nats/files/stateful-set/pod-template.yaml +++ b/helm/charts/nats/files/stateful-set/pod-template.yaml @@ -7,6 +7,15 @@ metadata: checksum/config: {{ sha256sum $configMap }} {{- end }} spec: + {{- with .Values.podTemplate.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 4 }} + {{- end }} + + {{- with .Values.podTemplate.tolerations }} + tolerations: + {{- toYaml . | nindent 4 }} + {{- end }} containers: # nats {{- $nats := dict }} diff --git a/helm/charts/nats/values.yaml b/helm/charts/nats/values.yaml index 24c6708f..729c6075 100644 --- a/helm/charts/nats/values.yaml +++ b/helm/charts/nats/values.yaml @@ -494,6 +494,14 @@ podTemplate: # topologySpreadConstraints: {} + # node selection for NATS StatefulSet pods + # if empty, Kubernetes will schedule on any node + nodeSelector: {} + + # tolerations for NATS StatefulSet pods + # if empty, no tolerations are applied + tolerations: [] + # merge or patch the pod template # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#pod-v1-core merge: {} @@ -619,6 +627,14 @@ natsBox: # deployment -> pod template podTemplate: + # node selection for nats-box pods + # if empty, Kubernetes will schedule on any node + nodeSelector: {} + + # tolerations for nats-box pods + # if empty, no tolerations are applied + tolerations: [] + # merge or patch the pod template # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#pod-v1-core merge: {}