Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[logstash] make service mandatory for helm 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlrt committed Mar 16, 2020
1 parent d039430 commit 1b82266
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
3 changes: 3 additions & 0 deletions logstash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`<br>`runAsNonRoot: true`<br>`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` |
Expand Down
2 changes: 0 additions & 2 deletions logstash/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.service }}
---
kind: Service
apiVersion: v1
Expand All @@ -20,4 +19,3 @@ spec:
release: {{ .Release.Name | quote }}
ports:
{{ toYaml .Values.service.ports | indent 4 }}
{{- end }}
2 changes: 0 additions & 2 deletions logstash/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.service }}
serviceName: {{ template "logstash.fullname" . }}
{{- end }}
selector:
matchLabels:
app: "{{ template "logstash.fullname" . }}"
Expand Down
2 changes: 1 addition & 1 deletion logstash/tests/logstash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions logstash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1b82266

Please sign in to comment.