Skip to content

Commit 67dc743

Browse files
committed
fix: support some missing configs on console, vault and grafana components (#1193)
* fix: support some missting configs Signed-off-by: ericsyh <ericshenyuhao@outlook.com> * update Signed-off-by: ericsyh <ericshenyuhao@outlook.com> * apply on sn-platform Signed-off-by: ericsyh <ericshenyuhao@outlook.com> * support vault init jobs Signed-off-by: ericsyh <ericshenyuhao@outlook.com> * fix lint Signed-off-by: ericsyh <ericshenyuhao@outlook.com> --------- Signed-off-by: ericsyh <ericshenyuhao@outlook.com> (cherry picked from commit f82fc0a)
1 parent 704aaf2 commit 67dc743

10 files changed

+77
-2
lines changed

charts/sn-platform-slim/templates/grafana/grafana-deployment.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ spec:
6565
tolerations:
6666
{{ toYaml .Values.grafana.tolerations | indent 8 }}
6767
{{- end }}
68+
affinity:
69+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.grafana.affinity "Component" .Values.grafana.component "Release" .Release "Chart" .Chart) | indent 8 }}
6870
terminationGracePeriodSeconds: {{ .Values.grafana.gracePeriod }}
6971
containers:
7072
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"

charts/sn-platform-slim/templates/streamnative-console/streamnative-console-initialize.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ spec:
3636
{{- if .Values.global.imagePullSecrets }}
3737
imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
3838
{{- end }}
39+
{{- if .Values.streamnative_console.nodeSelector }}
40+
nodeSelector: {{- toYaml .Values.streamnative_console.nodeSelector | nindent 8 }}
41+
{{- end }}
42+
{{- if .Values.streamnative_console.tolerations }}
43+
tolerations: {{- toYaml .Values.streamnative_console.tolerations | nindent 8 }}
44+
{{- end }}
45+
affinity:
46+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }}
3947
{{- if not .Values.istio.enabled }}
4048
initContainers:
4149
# This init container will wait for broker to be ready before

charts/sn-platform-slim/templates/streamnative-console/streamnative-console-statefulset.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ spec:
6767
tolerations:
6868
{{ toYaml .Values.streamnative_console.tolerations | indent 8 }}
6969
{{- end }}
70+
affinity:
71+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }}
7072
terminationGracePeriodSeconds: {{ .Values.streamnative_console.gracePeriod }}
7173
{{- if not .Values.istio.enabled }}
7274
initContainers:

charts/sn-platform-slim/values.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1725,14 +1725,14 @@ prometheus:
17251725
requests:
17261726
memory: 256Mi
17271727
cpu: 0.1
1728-
# Definition of the serviceAccount used to run brokers.
17291728
affinity:
17301729
anti_affinity: true
17311730
zone_anti_affinity: true
17321731
# Set the anti affinity type. Valid values:
17331732
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
17341733
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
17351734
type: preferredDuringSchedulingIgnoredDuringExecution
1735+
# Definition of the serviceAccount used to run brokers.
17361736
serviceAccount:
17371737
# Specifies whether to use a service account to run this component
17381738
use: true
@@ -1885,6 +1885,13 @@ grafana:
18851885
requests:
18861886
memory: 250Mi
18871887
cpu: 0.1
1888+
affinity:
1889+
anti_affinity: true
1890+
zone_anti_affinity: true
1891+
# Set the anti affinity type. Valid values:
1892+
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
1893+
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
1894+
type: preferredDuringSchedulingIgnoredDuringExecution
18881895
volumes:
18891896
# use a persistent volume or emptyDir
18901897
persistence: true
@@ -2040,6 +2047,13 @@ streamnative_console:
20402047
limits: {}
20412048
# memory: "1Gi"
20422049
# cpu: "0.4"
2050+
affinity:
2051+
anti_affinity: true
2052+
zone_anti_affinity: true
2053+
# Set the anti affinity type. Valid values:
2054+
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
2055+
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
2056+
type: preferredDuringSchedulingIgnoredDuringExecution
20432057
volumes:
20442058
# use a persistent volume or emptyDir
20452059
persistence: true

charts/sn-platform/templates/grafana/grafana-statefulset.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ spec:
6363
tolerations:
6464
{{ toYaml .Values.grafana.tolerations | indent 8 }}
6565
{{- end }}
66+
affinity:
67+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.grafana.affinity "Component" .Values.grafana.component "Release" .Release "Chart" .Chart) | indent 8 }}
6668
terminationGracePeriodSeconds: {{ .Values.grafana.gracePeriod }}
6769
{{- if .Values.grafana.volumes.securityContext }}
6870
securityContext:

charts/sn-platform/templates/streamnative-console/streamnative-console-initialize.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ spec:
3636
{{- if .Values.global.imagePullSecrets }}
3737
imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
3838
{{- end }}
39+
{{- if .Values.streamnative_console.nodeSelector }}
40+
nodeSelector: {{- toYaml .Values.streamnative_console.nodeSelector | nindent 8 }}
41+
{{- end }}
42+
{{- if .Values.streamnative_console.tolerations }}
43+
tolerations: {{- toYaml .Values.streamnative_console.tolerations | nindent 8 }}
44+
{{- end }}
45+
affinity:
46+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }}
3947
{{- if not .Values.istio.enabled }}
4048
initContainers:
4149
# This init container will wait for broker to be ready before

charts/sn-platform/templates/streamnative-console/streamnative-console-statefulset.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ spec:
6767
tolerations:
6868
{{ toYaml .Values.streamnative_console.tolerations | indent 8 }}
6969
{{- end }}
70+
affinity:
71+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.streamnative_console.affinity "Component" .Values.streamnative_console.component "Release" .Release "Chart" .Chart) | indent 8 }}
7072
terminationGracePeriodSeconds: {{ .Values.streamnative_console.gracePeriod }}
7173
{{- if not .Values.istio.enabled }}
7274
initContainers:

charts/sn-platform/templates/vault/vault-initialize-public-key.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ spec:
4141
{{- end }}
4242
spec:
4343
serviceAccountName: {{ template "pulsar.vault.serviceAccount" . }}
44+
{{- if .Values.global.imagePullSecrets }}
45+
imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
46+
{{- end }}
47+
{{- if .Values.vault.tolerations }}
48+
tolerations:
49+
{{ toYaml .Values.vault.tolerations | indent 8 }}
50+
{{- end }}
51+
{{- if .Values.vault.nodeSelector }}
52+
nodeSelector:
53+
{{ toYaml .Values.vault.nodeSelector | indent 8 }}
54+
{{- end }}
55+
affinity:
56+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.vault.affinity "Component" .Values.vault.component "Release" .Release "Chart" .Chart) | indent 8 }}
4457
containers:
4558
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.vault.component }}-init"
4659
image: "{{ .Values.images.vault_init.repository }}:{{ .Values.images.vault_init.tag }}"

charts/sn-platform/templates/vault/vault-initialize.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ spec:
4444
{{- if .Values.global.imagePullSecrets }}
4545
imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
4646
{{- end }}
47+
{{- if .Values.vault.tolerations }}
48+
tolerations:
49+
{{ toYaml .Values.vault.tolerations | indent 8 }}
50+
{{- end }}
51+
{{- if .Values.vault.nodeSelector }}
52+
nodeSelector:
53+
{{ toYaml .Values.vault.nodeSelector | indent 8 }}
54+
{{- end }}
55+
affinity:
56+
{{- include "pulsar.antiAffinityRules" (dict "Values" .Values "thisAffinity" .Values.vault.affinity "Component" .Values.vault.component "Release" .Release "Chart" .Chart) | indent 8 }}
4757
containers:
4858
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.vault.component }}-init"
4959
image: "{{ .Values.images.vault_init.repository }}:{{ .Values.images.vault_init.tag }}"

charts/sn-platform/values.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1807,14 +1807,14 @@ prometheus:
18071807
requests:
18081808
memory: 256Mi
18091809
cpu: 0.1
1810-
# Definition of the serviceAccount used to run brokers.
18111810
affinity:
18121811
anti_affinity: true
18131812
zone_anti_affinity: true
18141813
# Set the anti affinity type. Valid values:
18151814
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
18161815
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
18171816
type: preferredDuringSchedulingIgnoredDuringExecution
1817+
# Definition of the serviceAccount used to run brokers.
18181818
serviceAccount:
18191819
# Specifies whether to use a service account to run this component
18201820
use: true
@@ -1966,6 +1966,13 @@ grafana:
19661966
labels: {}
19671967
annotations: {}
19681968
tolerations: []
1969+
affinity:
1970+
anti_affinity: true
1971+
zone_anti_affinity: true
1972+
# Set the anti affinity type. Valid values:
1973+
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
1974+
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
1975+
type: preferredDuringSchedulingIgnoredDuringExecution
19691976
gracePeriod: 0
19701977
port: 3000
19711978
resources:
@@ -2119,6 +2126,13 @@ streamnative_console:
21192126
podLabels: {}
21202127
podAnnotations: {}
21212128
tolerations: []
2129+
affinity:
2130+
anti_affinity: true
2131+
zone_anti_affinity: true
2132+
# Set the anti affinity type. Valid values:
2133+
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
2134+
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
2135+
type: preferredDuringSchedulingIgnoredDuringExecution
21222136
gracePeriod: 0
21232137
# Resources requests/limits for both init containers and app containers
21242138
# See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#resources

0 commit comments

Comments
 (0)