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

feat(helm): add option to set resources for initHelper #865

Merged
Merged
Changes from 1 commit
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
21 changes: 21 additions & 0 deletions charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ spec:
imagePullSecrets:
{{ toYaml .Values.opensearchCluster.initHelper.imagePullSecrets | nindent 6 }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources }}
resources:
{{- if .Values.opensearchCluster.initHelper.resources.requests }}
requests:
{{- if .Values.opensearchCluster.initHelper.resources.requests.memory }}
memory: {{ .Values.opensearchCluster.initHelper.resources.requests.memory }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.requests.cpu }}
cpu: {{ .Values.opensearchCluster.initHelper.resources.requests.cpu }}
{{- end }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.limits }}
limits:
{{- if .Values.opensearchCluster.initHelper.resources.limits.memory }}
memory: {{ .Values.opensearchCluster.initHelper.resources.limits.memory }}
{{- end }}
{{- if .Values.opensearchCluster.initHelper.resources.limits.cpu }}
cpu: {{ .Values.opensearchCluster.initHelper.resources.limits.cpu }}
{{- end }}
{{- end }}
{{- end }}
Copy link
Collaborator

@swoehrl-mw swoehrl-mw Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified like this:

{{- if .Values.opensearchCluster.initHelper.resources }}
resources:
  {{- toYaml .Values.opensearchCluster.initHelper.resources | nindent 6 }}
{{- end }}

Copy link
Contributor Author

@guilhermeoki guilhermeoki Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I know you only added the resources part, but could you please add the entire initHelper struct to the values.yaml of the chart to show that it is possible to set it?

Sure! I will add the struct to the values.yaml

Copy link
Contributor Author

@guilhermeoki guilhermeoki Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be simplified like this:

Ok! I will simplify that part.

{{- end }}
general:
{{- if .Values.opensearchCluster.general.version }}
Expand Down
Loading