Skip to content

Commit

Permalink
fix: support some missing configs on console, vault and grafana compo…
Browse files Browse the repository at this point in the history
…nents (#1193)

* fix: support some missting configs

Signed-off-by: ericsyh <[email protected]>

* update

Signed-off-by: ericsyh <[email protected]>

* apply on sn-platform

Signed-off-by: ericsyh <[email protected]>

* support vault init jobs

Signed-off-by: ericsyh <[email protected]>

* fix lint

Signed-off-by: ericsyh <[email protected]>

---------

Signed-off-by: ericsyh <[email protected]>
(cherry picked from commit f82fc0a)
  • Loading branch information
ericsyh committed Dec 20, 2024
1 parent 4586368 commit 918cb84
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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:
Expand Down
16 changes: 15 additions & 1 deletion charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1725,14 +1725,14 @@ prometheus:
requests:
memory: 256Mi
cpu: 0.1
# Definition of the serviceAccount used to run brokers.
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
# Definition of the serviceAccount used to run brokers.
serviceAccount:
# Specifies whether to use a service account to run this component
use: true
Expand Down Expand Up @@ -1885,6 +1885,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
Expand Down Expand Up @@ -2040,6 +2047,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
Expand Down
2 changes: 2 additions & 0 deletions charts/sn-platform/templates/grafana/grafana-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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 }}"
Expand Down
10 changes: 10 additions & 0 deletions charts/sn-platform/templates/vault/vault-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,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 }}"
Expand Down
16 changes: 15 additions & 1 deletion charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1806,14 +1806,14 @@ prometheus:
requests:
memory: 256Mi
cpu: 0.1
# Definition of the serviceAccount used to run brokers.
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
# Definition of the serviceAccount used to run brokers.
serviceAccount:
# Specifies whether to use a service account to run this component
use: true
Expand Down Expand Up @@ -1966,6 +1966,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:
Expand Down Expand Up @@ -2119,6 +2126,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
Expand Down

0 comments on commit 918cb84

Please sign in to comment.