From c562335178b80174772336048fabd54988ab6e98 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Wed, 14 Oct 2020 09:23:30 +0200 Subject: [PATCH] [logstash] use only httpPort in headless service This commit fix an issue introduced in 8ed75a9 where helm install/upgrade is failing if a NodePort service is defined (see [0] for more details). Logstash headless service used to manage Statefulset does not anymore include `.Values.service.ports` and include only Logstash httpPort. This is done because headless service `ports` doesn't accept `nodePort` values that can be included in `.Values.service.ports` when adding a NodePort service. [0]: https://github.com/elastic/helm-charts/issues/807 --- logstash/templates/service-headless.yaml | 4 ---- logstash/tests/logstash_test.py | 7 ------- 2 files changed, 11 deletions(-) diff --git a/logstash/templates/service-headless.yaml b/logstash/templates/service-headless.yaml index 157e4a66f..47148dfb0 100644 --- a/logstash/templates/service-headless.yaml +++ b/logstash/templates/service-headless.yaml @@ -16,9 +16,5 @@ spec: selector: app: "{{ template "logstash.fullname" . }}" ports: -{{- if .Values.service }} -{{ toYaml .Values.service.ports | indent 4 }} -{{- else }} - name: http port: {{ .Values.httpPort }} -{{- end }} diff --git a/logstash/tests/logstash_test.py b/logstash/tests/logstash_test.py index a96ce0a20..6b29dacdf 100755 --- a/logstash/tests/logstash_test.py +++ b/logstash/tests/logstash_test.py @@ -860,13 +860,6 @@ def test_adding_a_service(): "protocol": "TCP", "targetPort": 5044, } - h = r["service"][name + "-headless"] - assert h["spec"]["ports"][0] == { - "name": "beats", - "port": 5044, - "protocol": "TCP", - "targetPort": 5044, - } def test_setting_fullnameOverride():