From 1b8226650ca0d1ef93ea2d6ee07a3b65671d08ce Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Mon, 16 Mar 2020 11:04:06 +0100 Subject: [PATCH] [logstash] make service mandatory for helm 3 --- logstash/README.md | 3 +++ logstash/templates/service.yaml | 2 -- logstash/templates/statefulset.yaml | 2 -- logstash/tests/logstash_test.py | 2 +- logstash/values.yaml | 16 ++++++++-------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/logstash/README.md b/logstash/README.md index 80e10fec6..e7430af22 100644 --- a/logstash/README.md +++ b/logstash/README.md @@ -96,6 +96,9 @@ helm install logstash elastic/logstash --set imageTag=7.6.1 | `schedulerName` | Name of the [alternate scheduler](https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/#specify-schedulers-for-pods) | `""` | | `secretMounts` | Allows you easily mount a secret as a file inside the statefulset. Useful for mounting certificates and other secrets. See [values.yaml](https://github.com/elastic/helm-charts/tree/master/logstash/values.yaml) for an example | `[]` | | `securityContext` | Allows you to set the [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) for the container | `capabilities.drop:[ALL]`
`runAsNonRoot: true`
`runAsUser: 1000` | +| `service.type` | Type of elasticsearch service. [Service Types](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | `ClusterIP` | +| `service.ports` | FIXME | `` | +| `service.annotations` | Annotations that Kubernetes will use for the service. This will configure load balancer if `service.type` is `LoadBalancer` [Annotations](https://kubernetes.io/docs/concepts/services-networking/service/#ssl-support-on-aws) | `{}` | | `terminationGracePeriod` | The [terminationGracePeriod](https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods) in seconds used when trying to stop the pod | `120` | | `tolerations` | Configurable [tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` | | `updateStrategy` | The [updateStrategy](https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets) for the statefulset. By default Kubernetes will wait for the cluster to be green after upgrading each pod. Setting this to `OnDelete` will allow you to manually delete each pod during upgrades | `RollingUpdate` | diff --git a/logstash/templates/service.yaml b/logstash/templates/service.yaml index 6cbca1ee4..d207300f1 100644 --- a/logstash/templates/service.yaml +++ b/logstash/templates/service.yaml @@ -1,4 +1,3 @@ -{{- if .Values.service }} --- kind: Service apiVersion: v1 @@ -20,4 +19,3 @@ spec: release: {{ .Release.Name | quote }} ports: {{ toYaml .Values.service.ports | indent 4 }} -{{- end }} diff --git a/logstash/templates/statefulset.yaml b/logstash/templates/statefulset.yaml index 6c9838d3a..9ad772692 100644 --- a/logstash/templates/statefulset.yaml +++ b/logstash/templates/statefulset.yaml @@ -12,9 +12,7 @@ metadata: {{ $key }}: {{ $value | quote }} {{- end }} spec: - {{- if .Values.service }} serviceName: {{ template "logstash.fullname" . }} - {{- end }} selector: matchLabels: app: "{{ template "logstash.fullname" . }}" diff --git a/logstash/tests/logstash_test.py b/logstash/tests/logstash_test.py index ed798a496..60507ac54 100755 --- a/logstash/tests/logstash_test.py +++ b/logstash/tests/logstash_test.py @@ -78,7 +78,7 @@ def test_defaults(): ) # Service - assert "serviceName" not in r["statefulset"][name]["spec"] + assert "serviceName" in r["statefulset"][name]["spec"] assert "service" not in r # Other diff --git a/logstash/values.yaml b/logstash/values.yaml index fae3b75e6..2ba6c00e0 100755 --- a/logstash/values.yaml +++ b/logstash/values.yaml @@ -191,15 +191,15 @@ lifecycle: {} # exec: # command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] -service: {} -# annotations: {} -# type: ClusterIP -# ports: +service: + annotations: {} + type: ClusterIP + ports: # - name: beats # port: 5044 # protocol: TCP # targetPort: 5044 -# - name: http -# port: 8080 -# protocol: TCP -# targetPort: 8080 + - name: http + port: 8080 + protocol: TCP + targetPort: 8080