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

Expose all fields below spec in eck-elasticsearch Helm chart #6492

Merged

Conversation

thbkrkr
Copy link
Contributor

@thbkrkr thbkrkr commented Mar 7, 2023

This exposes the 4 fields image, podDisruptionBudget, serviceAccountName and revisionHistoryLimit in the eck-elasticsearch Helm chart.

Relates to #6451.

@thbkrkr thbkrkr added >enhancement Enhancement of existing functionality v2.7.0 labels Mar 7, 2023
@thbkrkr thbkrkr requested a review from naemono March 7, 2023 14:19
@naemono
Copy link
Contributor

naemono commented Mar 7, 2023

I believe there's a slight issue in the templating

  image:
    my.registry.com/elastic/elasticsearch:8.7.0
  podDisruptionBudget:
    spec:
      minAvailable: 2
      selector:
        matchLabels:
          elasticsearch.k8s.elastic.co/cluster-name: quickstart
  serviceAccountName:
    my-serviceaccount
  revisionHistoryLimit:
    2

I think this fixes it

diff --git a/deploy/eck-elasticsearch/templates/elasticsearch.yaml b/deploy/eck-elasticsearch/templates/elasticsearch.yaml
index 43c144753..b99b3edc6 100644
--- a/deploy/eck-elasticsearch/templates/elasticsearch.yaml
+++ b/deploy/eck-elasticsearch/templates/elasticsearch.yaml
@@ -53,18 +53,15 @@ spec:
   nodeSets:
 {{ toYaml .Values.nodeSets | nindent 4 }}
   {{- if .Values.image }}
-  image:
-    {{- toYaml .Values.image | nindent 4 }}
+  image: {{ .Values.image }}
   {{- end }}
   {{- if .Values.podDisruptionBudget }}
   podDisruptionBudget:
     {{- toYaml .Values.podDisruptionBudget | nindent 4 }}
   {{- end }}
   {{- if .Values.serviceAccountName }}
-  serviceAccountName:
-    {{- toYaml .Values.serviceAccountName | nindent 4 }}
+  serviceAccountName: {{ .Values.serviceAccountName }}
   {{- end }}
   {{- if .Values.revisionHistoryLimit }}
-  revisionHistoryLimit:
-    {{- toYaml .Values.revisionHistoryLimit | nindent 4 }}
+  revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
   {{- end }}

After changes:

❯ helm template eck-elasticsearch . --values ~/tmp/test-values.yaml -s templates/elasticsearch.yaml | yq e '.spec' -
version: 8.6.1
nodeSets:
  - config:
      node.store.allow_mmap: false
    count: 1
    name: default
    podTemplate:
      spec:
        containers:
          - name: elasticsearch
            resources:
              limits:
                memory: 2Gi
              requests:
                memory: 2Gi
image: my.registry.com/elastic/elasticsearch:8.7.0
podDisruptionBudget:
  spec:
    minAvailable: 2
    selector:
      matchLabels:
        elasticsearch.k8s.elastic.co/cluster-name: quickstart
serviceAccountName: my-serviceaccount
revisionHistoryLimit: 2

@thbkrkr
Copy link
Contributor Author

thbkrkr commented Mar 7, 2023

I believe there's a slight issue in the templating

Indeed, thanks. This is what happens when you copy paste stupidly 🤦 .

Copy link
Contributor

@naemono naemono left a comment

Choose a reason for hiding this comment

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

yep, verified here as well. lgtm

@thbkrkr thbkrkr merged commit ef0d718 into elastic:main Mar 7, 2023
@thbkrkr thbkrkr deleted the expose-fields-in-eck-elasticsearch-helm-chart branch March 14, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v2.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants