Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] support use map to define feEnvVars/beEnvVars to do merge on multiple values files #396

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,21 @@ spec:
key: password
{{- end }}
{{- if .Values.starrocksFESpec.feEnvVars }}
{{- /* if it is a map, we use range to iterate to merge environment variables */}}
{{- if eq (kindOf .Values.starrocksFESpec.feEnvVars) "map" }}
{{- range $key, $value := .Values.starrocksFESpec.feEnvVars }}
- name: {{ $key }}
{{- if eq (kindOf $value) "string" }}
value: {{ $value | quote }}
{{- else }}
{{- toYaml $value | nindent 8 }}
{{- end }}
{{- end }}
{{- else }}
{{- /* the default kind is slice, we keep backward compatibility */}}
{{- toYaml .Values.starrocksFESpec.feEnvVars | nindent 6 }}
{{- end }}

{{- end }}
{{- if .Values.starrocksFESpec.affinity }}
affinity:
{{ toYaml .Values.starrocksFESpec.affinity | indent 6 }}
Expand Down Expand Up @@ -239,9 +251,21 @@ spec:
key: password
{{- end }}
{{- if .Values.starrocksBeSpec.beEnvVars }}
{{- /* if it is a map, we use range to iterate to merge environment variables */}}
{{- if eq (kindOf .Values.starrocksBeSpec.beEnvVars) "map" }}
{{- range $key, $value := .Values.starrocksBeSpec.beEnvVars }}
- name: {{ $key }}
{{- if eq (kindOf $value) "string" }}
value: {{ $value | quote }}
{{- else }}
{{- toYaml $value | nindent 8 }}
{{- end }}
{{- end }}
{{- else }}
{{- /* the default kind is slice, we keep backward compatibility */}}
{{- toYaml .Values.starrocksBeSpec.beEnvVars | nindent 6 }}
{{- end }}

{{- end }}
{{- if .Values.starrocksBeSpec.affinity }}
affinity:
{{ toYaml .Values.starrocksBeSpec.affinity | indent 6 }}
Expand Down Expand Up @@ -340,8 +364,22 @@ spec:
key: password
{{- end }}
{{- if .Values.starrocksCnSpec.cnEnvVars }}
{{- /* if it is a map, we use range to iterate to merge environment variables */}}
{{- if eq (kindOf .Values.starrocksCnSpec.cnEnvVars) "map" }}
{{- range $key, $value := .Values.starrocksCnSpec.cnEnvVars }}
- name: {{ $key }}
{{- if eq (kindOf $value) "string" }}
value: {{ $value | quote }}
{{- else }}
{{- toYaml $value | nindent 8 }}
{{- end }}
{{- end }}
{{- else }}
{{- /* the default kind is slice, we keep backward compatibility */}}
{{- toYaml .Values.starrocksCnSpec.cnEnvVars | nindent 6 }}
{{- end }}
{{- end }}

{{- if .Values.starrocksCnSpec.affinity }}
affinity:
{{ toYaml .Values.starrocksCnSpec.affinity | indent 6 }}
Expand Down
31 changes: 18 additions & 13 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ starrocksFESpec:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for your pods.
schedulerName: ""
# Additional fe container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional fe container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
feEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down Expand Up @@ -262,11 +264,13 @@ starrocksCnSpec:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for the pod
schedulerName: ""
# Additional cn container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional cn container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
cnEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down Expand Up @@ -435,12 +439,13 @@ starrocksBeSpec:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for the pod
schedulerName: ""

# Additional be container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional be container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
beEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down
31 changes: 18 additions & 13 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,13 @@ starrocks:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for your pods.
schedulerName: ""
# Additional fe container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional fe container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
feEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down Expand Up @@ -342,11 +344,13 @@ starrocks:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for the pod
schedulerName: ""
# Additional cn container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional cn container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
cnEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down Expand Up @@ -515,12 +519,13 @@ starrocks:
# - "example.com"
# schedulerName allows you to specify which scheduler will be used for the pod
schedulerName: ""

# Additional be container environment variables
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# Additional be container environment variables.
# See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables.
# Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect.
# If you use map to define environment variables, and if there are multiple values files, the values in the last values file will be merged.
# You can only use one of slice and map to define environment variables.
beEnvVars: []
# define environment variables by slice.
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
Expand Down
Loading