diff --git a/charts/sn-platform-slim/templates/grafana/grafana-deployment.yaml b/charts/sn-platform-slim/templates/grafana/grafana-deployment.yaml index 33073324e..d32bd09f5 100644 --- a/charts/sn-platform-slim/templates/grafana/grafana-deployment.yaml +++ b/charts/sn-platform-slim/templates/grafana/grafana-deployment.yaml @@ -50,6 +50,8 @@ spec: tolerations: {{ toYaml .Values.grafana.tolerations | indent 8 }} {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.grafana.affinity "Component" .Values.grafana.component "Release" .Release "Chart" .Chart) | indent 8 }} terminationGracePeriodSeconds: {{ .Values.grafana.gracePeriod }} containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}" diff --git a/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-initialize.yaml b/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-initialize.yaml index 70395e616..ca9fb8a67 100644 --- a/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-initialize.yaml +++ b/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-initialize.yaml @@ -21,6 +21,14 @@ spec: {{- if .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} {{- end }} + {{- if .Values.streamnative_console.nodeSelector }} + nodeSelector: {{- toYaml .Values.streamnative_console.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.streamnative_console.tolerations }} + tolerations: {{- toYaml .Values.streamnative_console.tolerations | nindent 8 }} + {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }} {{- if not .Values.istio.enabled }} initContainers: # This init container will wait for broker to be ready before diff --git a/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-statefulset.yaml b/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-statefulset.yaml index 610b6815a..e1d23068b 100644 --- a/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-statefulset.yaml +++ b/charts/sn-platform-slim/templates/streamnative-console/streamnative-console-statefulset.yaml @@ -52,6 +52,8 @@ spec: tolerations: {{ toYaml .Values.streamnative_console.tolerations | indent 8 }} {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }} terminationGracePeriodSeconds: {{ .Values.streamnative_console.gracePeriod }} {{- if not .Values.istio.enabled }} initContainers: diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 5bf2d1ce8..6015d527d 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -1703,7 +1703,6 @@ prometheus: requests: memory: 256Mi cpu: 0.1 - # Definition of the serviceAccount used to run brokers. affinity: anti_affinity: true zone_anti_affinity: true @@ -1711,6 +1710,7 @@ prometheus: # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution + # Definition of the serviceAccount used to run brokers. serviceAccount: # Specifies whether to use a service account to run this component use: true @@ -1863,6 +1863,13 @@ grafana: requests: memory: 250Mi cpu: 0.1 + affinity: + anti_affinity: true + zone_anti_affinity: true + # Set the anti affinity type. Valid values: + # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica + # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee + type: preferredDuringSchedulingIgnoredDuringExecution volumes: # use a persistent volume or emptyDir persistence: true @@ -2018,6 +2025,13 @@ streamnative_console: limits: {} # memory: "1Gi" # cpu: "0.4" + affinity: + anti_affinity: true + zone_anti_affinity: true + # Set the anti affinity type. Valid values: + # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica + # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee + type: preferredDuringSchedulingIgnoredDuringExecution volumes: # use a persistent volume or emptyDir persistence: true diff --git a/charts/sn-platform/templates/grafana/grafana-statefulset.yaml b/charts/sn-platform/templates/grafana/grafana-statefulset.yaml index 99683f0c2..1856c21c8 100644 --- a/charts/sn-platform/templates/grafana/grafana-statefulset.yaml +++ b/charts/sn-platform/templates/grafana/grafana-statefulset.yaml @@ -48,6 +48,8 @@ spec: tolerations: {{ toYaml .Values.grafana.tolerations | indent 8 }} {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.grafana.affinity "Component" .Values.grafana.component "Release" .Release "Chart" .Chart) | indent 8 }} terminationGracePeriodSeconds: {{ .Values.grafana.gracePeriod }} {{- if .Values.grafana.volumes.securityContext }} securityContext: diff --git a/charts/sn-platform/templates/streamnative-console/streamnative-console-initialize.yaml b/charts/sn-platform/templates/streamnative-console/streamnative-console-initialize.yaml index 50fe8e388..8e642323b 100644 --- a/charts/sn-platform/templates/streamnative-console/streamnative-console-initialize.yaml +++ b/charts/sn-platform/templates/streamnative-console/streamnative-console-initialize.yaml @@ -21,6 +21,14 @@ spec: {{- if .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} {{- end }} + {{- if .Values.streamnative_console.nodeSelector }} + nodeSelector: {{- toYaml .Values.streamnative_console.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.streamnative_console.tolerations }} + tolerations: {{- toYaml .Values.streamnative_console.tolerations | nindent 8 }} + {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }} {{- if not .Values.istio.enabled }} initContainers: # This init container will wait for broker to be ready before diff --git a/charts/sn-platform/templates/streamnative-console/streamnative-console-statefulset.yaml b/charts/sn-platform/templates/streamnative-console/streamnative-console-statefulset.yaml index 8a0fdb33d..503af6cbc 100644 --- a/charts/sn-platform/templates/streamnative-console/streamnative-console-statefulset.yaml +++ b/charts/sn-platform/templates/streamnative-console/streamnative-console-statefulset.yaml @@ -52,6 +52,8 @@ spec: tolerations: {{ toYaml .Values.streamnative_console.tolerations | indent 8 }} {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }} terminationGracePeriodSeconds: {{ .Values.streamnative_console.gracePeriod }} {{- if not .Values.istio.enabled }} initContainers: diff --git a/charts/sn-platform/templates/vault/vault-initialize-public-key.yaml b/charts/sn-platform/templates/vault/vault-initialize-public-key.yaml index 4139a306b..017b17ac4 100644 --- a/charts/sn-platform/templates/vault/vault-initialize-public-key.yaml +++ b/charts/sn-platform/templates/vault/vault-initialize-public-key.yaml @@ -26,6 +26,19 @@ spec: {{- end }} spec: serviceAccountName: {{ template "pulsar.vault.serviceAccount" . }} + {{- if .Values.global.imagePullSecrets }} + imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.vault.tolerations }} + tolerations: + {{ toYaml .Values.vault.tolerations | indent 8 }} + {{- end }} + {{- if .Values.vault.nodeSelector }} + nodeSelector: + {{ toYaml .Values.vault.nodeSelector | indent 8 }} + {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.vault.affinity "Component" .Values.vault.component "Release" .Release "Chart" .Chart) | indent 8 }} containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.vault.component }}-init" image: "{{ .Values.images.vault_init.repository }}:{{ .Values.images.vault_init.tag }}" diff --git a/charts/sn-platform/templates/vault/vault-initialize.yaml b/charts/sn-platform/templates/vault/vault-initialize.yaml index 02e6a2f62..6a71986a6 100644 --- a/charts/sn-platform/templates/vault/vault-initialize.yaml +++ b/charts/sn-platform/templates/vault/vault-initialize.yaml @@ -29,6 +29,16 @@ spec: {{- if .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} {{- end }} + {{- if .Values.vault.tolerations }} + tolerations: + {{ toYaml .Values.vault.tolerations | indent 8 }} + {{- end }} + {{- if .Values.vault.nodeSelector }} + nodeSelector: + {{ toYaml .Values.vault.nodeSelector | indent 8 }} + {{- end }} + affinity: + {{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.vault.affinity "Component" .Values.vault.component "Release" .Release "Chart" .Chart) | indent 8 }} containers: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.vault.component }}-init" image: "{{ .Values.images.vault_init.repository }}:{{ .Values.images.vault_init.tag }}" diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index f1b49c361..92b9e3638 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -1784,7 +1784,6 @@ prometheus: requests: memory: 256Mi cpu: 0.1 - # Definition of the serviceAccount used to run brokers. affinity: anti_affinity: true zone_anti_affinity: true @@ -1792,6 +1791,7 @@ prometheus: # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution + # Definition of the serviceAccount used to run brokers. serviceAccount: # Specifies whether to use a service account to run this component use: true @@ -1944,6 +1944,13 @@ grafana: labels: {} annotations: {} tolerations: [] + affinity: + anti_affinity: true + zone_anti_affinity: true + # Set the anti affinity type. Valid values: + # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica + # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee + type: preferredDuringSchedulingIgnoredDuringExecution gracePeriod: 0 port: 3000 resources: @@ -2097,6 +2104,13 @@ streamnative_console: podLabels: {} podAnnotations: {} tolerations: [] + affinity: + anti_affinity: true + zone_anti_affinity: true + # Set the anti affinity type. Valid values: + # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica + # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee + type: preferredDuringSchedulingIgnoredDuringExecution gracePeriod: 0 # Resources requests/limits for both init containers and app containers # See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources