diff --git a/incubator/logstash/Chart.yaml b/incubator/logstash/Chart.yaml index 6db83cc22d26..c74c857562bb 100644 --- a/incubator/logstash/Chart.yaml +++ b/incubator/logstash/Chart.yaml @@ -1,17 +1,12 @@ +# moved to stable +deprecated: true apiVersion: v1 -description: Logstash is an open source, server-side data processing pipeline +description: DEPRECATED Logstash is an open source, server-side data processing pipeline icon: https://www.elastic.co/assets/blt86e4472872eed314/logo-elastic-logstash-lt.svg home: https://www.elastic.co/products/logstash name: logstash -version: 0.9.5 +version: 0.9.6 appVersion: 6.4.2 sources: - https://www.docker.elastic.co - https://www.elastic.co/guide/en/logstash/current/index.html -maintainers: -- name: rendhalver - email: pete.brown@powerhrg.com -- name: jar361 - email: jrodgers@powerhrg.com -- name: christian-roggia - email: christian.roggia@gmail.com diff --git a/incubator/logstash/README.md b/incubator/logstash/README.md index 0f177ed2a2f4..13ffe57f40d0 100644 --- a/incubator/logstash/README.md +++ b/incubator/logstash/README.md @@ -1,5 +1,7 @@ # Logstash +**Note - this chart has been deprecated and [moved to stable](../../stable/logstash)**. + [Logstash](https://www.elastic.co/products/logstash) is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite “stash.” ## TL;DR; diff --git a/incubator/logstash/templates/NOTES.txt b/incubator/logstash/templates/NOTES.txt index 6fc698888fa2..db6a7ad063e6 100644 --- a/incubator/logstash/templates/NOTES.txt +++ b/incubator/logstash/templates/NOTES.txt @@ -1,4 +1,10 @@ {{- if .Values.service.ports.http }} + +*** +Please note that this chart has been deprecated and moved to stable. +Going forward please use the stable version of this chart. +*** + Get the Logstash HTTP Input URL by running these commands: {{- if .Values.ingress.enabled }} {{- range .Values.ingress.hosts }} diff --git a/stable/logstash/.helmignore b/stable/logstash/.helmignore new file mode 100644 index 000000000000..f0c131944441 --- /dev/null +++ b/stable/logstash/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/stable/logstash/Chart.yaml b/stable/logstash/Chart.yaml new file mode 100644 index 000000000000..93b65b25ab87 --- /dev/null +++ b/stable/logstash/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +description: Logstash is an open source, server-side data processing pipeline +icon: https://www.elastic.co/assets/blt86e4472872eed314/logo-elastic-logstash-lt.svg +home: https://www.elastic.co/products/logstash +name: logstash +version: 1.0.0 +appVersion: 6.4.2 +sources: +- https://www.docker.elastic.co +- https://www.elastic.co/guide/en/logstash/current/index.html +maintainers: +- name: rendhalver + email: pete.brown@powerhrg.com +- name: jar361 + email: jrodgers@powerhrg.com +- name: christian-roggia + email: christian.roggia@gmail.com diff --git a/stable/logstash/OWNERS b/stable/logstash/OWNERS new file mode 100644 index 000000000000..ee2cba86a8ae --- /dev/null +++ b/stable/logstash/OWNERS @@ -0,0 +1,6 @@ +approvers: +- christian-roggia +- rendhalver +reviewers: +- christian-roggia +- rendhalver diff --git a/stable/logstash/README.md b/stable/logstash/README.md new file mode 100644 index 000000000000..bd775e1995b1 --- /dev/null +++ b/stable/logstash/README.md @@ -0,0 +1,114 @@ +# Logstash + +[Logstash](https://www.elastic.co/products/logstash) is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite “stash.” + +## TL;DR; + +```console +$ helm install stable/logstash +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release stable/logstash +``` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +$ helm delete my-release +``` + +The command removes nearly all the Kubernetes components associated with the +chart and deletes the release. + +## Best Practices + +### Release and tune this chart once per Logstash pipeline + +To achieve multiple pipelines with this chart, current best practice is to +maintain one pipeline per chart release. In this way configuration is +simplified and pipelines are more isolated from one another. + +### Default Pipeline: Beats Input -> Elasticsearch Output + +Current best practice for ELK logging is to ship logs from hosts using Filebeat +to logstash where persistent queues are enabled. Filebeat supports structured +(e.g. JSON) and unstructured (e.g. log lines) log shipment. + +### Load Beats-generated index template into Elasticsearch + +To best utilize the combination of Beats, Logstash and Elasticsearch, +load Beats-generated index templates into Elasticsearch as described [here]( +https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-template.html). + +On a remote-to-Kubernetes Linux instance you might run the following command to +load that instance's Beats-generated index template into Elasticsearch +(Elasticsearch hostname will vary). + +``` +filebeat setup --template -E output.logstash.enabled=false \ + -E 'output.elasticsearch.hosts=["elasticsearch.cluster.local:9200"]' +``` + +### Links + +Please review the following links that expound on current best practices. + +- https://www.elastic.co/blog/structured-logging-filebeat +- https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-template.html +- https://www.elastic.co/guide/en/logstash/current/deploying-and-scaling.html +- https://www.elastic.co/guide/en/logstash/current/persistent-queues.html + +## Configuration + +The following table lists the configurable parameters of the chart and its default values. + +| Parameter | Description | Default | +| --------------------------- | -------------------------------------------------- | ------------------------------------------------ | +| `replicaCount` | Number of replicas | `1` | +| `podDisruptionBudget` | Pod disruption budget | `maxUnavailable: 1` | +| `updateStrategy` | Update strategy | `type: RollingUpdate` | +| `image.repository` | Container image name | `docker.elastic.co/logstash/logstash-oss` | +| `image.tag` | Container image tag | `6.4.2` | +| `image.pullPolicy` | Container image pull policy | `IfNotPresent` | +| `service.type` | Service type (ClusterIP, NodePort or LoadBalancer) | `ClusterIP` | +| `service.annotations` | Service annotations | `{}` | +| `service.ports` | Ports exposed by service | beats | +| `service.loadBalancerIP` | The load balancer IP for the service | unset | +| `service.clusterIP` | The cluster IP for the service | unset | +| `ports` | Ports exposed by logstash container | beats | +| `ingress.enabled` | Enables Ingress | `false` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.path` | Ingress path | `/` | +| `ingress.hosts` | Ingress accepted hostnames | `["logstash.cluster.local"]` | +| `ingress.tls` | Ingress TLS configuration | `[]` | +| `resources` | Pod resource requests & limits | `{}` | +| `nodeSelector` | Node selector | `{}` | +| `tolerations` | Tolerations | `[]` | +| `affinity` | Affinity or Anti-Affinity | `{}` | +| `podAnnotations` | Pod annotations | `{}` | +| `podLabels` | Pod labels | `{}` | +| `livenessProbe` | Liveness probe settings for logstash container | (see `values.yaml`) | +| `readinessProbe` | Readiness probe settings for logstash container | (see `values.yaml`) | +| `persistence.enabled` | Enable persistence | `true` | +| `persistence.storageClass` | Storage class for PVCs | unset | +| `persistence.accessMode` | Access mode for PVCs | `ReadWriteOnce` | +| `persistence.size` | Size for PVCs | `2Gi` | +| `volumeMounts` | Volume mounts to configure for logstash container | (see `values.yaml`) | +| `volumes` | Volumes to configure for logstash container | [] | +| `terminationGracePeriodSeconds` | Duration the pod needs to terminate gracefully | `30` +| `exporter.logstash` | Prometheus logstash-exporter settings | (see `values.yaml`) | +| `exporter.logstash.enabled` | Enables Prometheus logstash-exporter | `false` | +| `elasticsearch.host` | ElasticSearch hostname | `elasticsearch-client.default.svc.cluster.local` | +| `elasticsearch.port` | ElasticSearch port | `9200` | +| `config` | Logstash configuration key-values | (see `values.yaml`) | +| `patterns` | Logstash patterns configuration | `nil` | +| `inputs` | Logstash inputs configuration | beats | +| `filters` | Logstash filters configuration | `nil` | +| `outputs` | Logstash outputs configuration | elasticsearch | diff --git a/stable/logstash/templates/NOTES.txt b/stable/logstash/templates/NOTES.txt new file mode 100644 index 000000000000..6fc698888fa2 --- /dev/null +++ b/stable/logstash/templates/NOTES.txt @@ -0,0 +1,21 @@ +{{- if .Values.service.ports.http }} +Get the Logstash HTTP Input URL by running these commands: + {{- if .Values.ingress.enabled }} + {{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} + {{- end }} + {{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "logstash.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT + {{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "logstash.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "logstash.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.ports.http.port }} + {{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "logstash.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.ports.http.port }} + {{- end }} +{{- end }} diff --git a/stable/logstash/templates/_helpers.tpl b/stable/logstash/templates/_helpers.tpl new file mode 100644 index 000000000000..d88fb24b24dd --- /dev/null +++ b/stable/logstash/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "logstash.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "logstash.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "logstash.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/stable/logstash/templates/ingress.yaml b/stable/logstash/templates/ingress.yaml new file mode 100644 index 000000000000..d92450440755 --- /dev/null +++ b/stable/logstash/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "logstash.fullname" . -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/stable/logstash/templates/patterns-config.yaml b/stable/logstash/templates/patterns-config.yaml new file mode 100644 index 000000000000..5149ffa171e6 --- /dev/null +++ b/stable/logstash/templates/patterns-config.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "logstash.fullname" . }}-patterns + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- range $key, $value := .Values.patterns }} + {{ $key }}: |- +{{ $value | indent 4 }} +{{- end }} diff --git a/stable/logstash/templates/pipeline-config.yaml b/stable/logstash/templates/pipeline-config.yaml new file mode 100644 index 000000000000..2aea32297664 --- /dev/null +++ b/stable/logstash/templates/pipeline-config.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "logstash.fullname" . }}-pipeline + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- range $key, $value := .Values.inputs }} + input_{{ $key }}: |- +{{ $value | indent 4 }} +{{- end }} + +{{- range $key, $value := .Values.filters }} + filter_{{ $key }}: |- +{{ $value | indent 4 }} +{{- end }} + +{{- range $key, $value := .Values.outputs }} + output_{{ $key }}: |- +{{ $value | indent 4 }} +{{- end }} diff --git a/stable/logstash/templates/poddisruptionbudget.yaml b/stable/logstash/templates/poddisruptionbudget.yaml new file mode 100644 index 000000000000..f3c37ebd6606 --- /dev/null +++ b/stable/logstash/templates/poddisruptionbudget.yaml @@ -0,0 +1,15 @@ +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "logstash.fullname" . }} + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + matchLabels: + app: {{ template "logstash.name" . }} + release: {{ .Release.Name }} +{{ toYaml .Values.podDisruptionBudget | indent 2 }} diff --git a/stable/logstash/templates/service.yaml b/stable/logstash/templates/service.yaml new file mode 100644 index 000000000000..e7ae10ee45ac --- /dev/null +++ b/stable/logstash/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "logstash.fullname" . }} + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +{{- with .Values.service.annotations }} +{{ toYaml . | indent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} + ports: + {{- range $key, $value := .Values.service.ports }} + - name: {{ $key }} +{{ toYaml $value | indent 6 }} + {{- end }} + selector: + app: {{ template "logstash.name" . }} + release: {{ .Release.Name }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} +{{- if .Values.service.clusterIP }} + clusterIP: {{ .Values.service.clusterIP }} +{{- end }} diff --git a/stable/logstash/templates/statefulset.yaml b/stable/logstash/templates/statefulset.yaml new file mode 100644 index 000000000000..8d8f10ac8604 --- /dev/null +++ b/stable/logstash/templates/statefulset.yaml @@ -0,0 +1,156 @@ +apiVersion: apps/v1beta2 +kind: StatefulSet +metadata: + name: {{ template "logstash.fullname" . }} + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + serviceName: {{ template "logstash.fullname" . }} + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "logstash.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "logstash.name" . }} + release: {{ .Release.Name }} + {{- if .Values.podLabels }} + ## Custom pod labels + {{- range $key, $value := .Values.podLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + annotations: + checksum/patterns: {{ include (print $.Template.BasePath "/patterns-config.yaml") . | sha256sum }} + checksum/pipeline: {{ include (print $.Template.BasePath "/pipeline-config.yaml") . | sha256sum }} + {{- if .Values.podAnnotations }} + ## Custom pod annotations + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + spec: + securityContext: + runAsUser: 1000 + fsGroup: 1000 + {{- if .Values.image.pullSecrets }} + imagePullSecrets: +{{ toYaml .Values.image.pullSecrets | indent 8 }} + {{- end }} + containers: + + ## logstash + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: monitor + containerPort: {{ .Values.exporter.logstash.target.port }} + protocol: TCP +{{ toYaml .Values.ports | indent 12 }} + livenessProbe: +{{ toYaml .Values.livenessProbe | indent 12 }} + readinessProbe: +{{ toYaml .Values.readinessProbe | indent 12 }} + env: + ## Logstash monitoring API host and port env vars + - name: HTTP_HOST + value: "0.0.0.0" + - name: HTTP_PORT + value: {{ .Values.exporter.logstash.target.port | quote }} + ## Elasticsearch output + - name: ELASTICSEARCH_HOST + value: {{ .Values.elasticsearch.host | quote }} + - name: ELASTICSEARCH_PORT + value: {{ .Values.elasticsearch.port | quote }} + ## Additional env vars + {{- range $key, $value := .Values.config }} + - name: {{ $key | upper | replace "." "_" }} + value: {{ $value | quote }} + {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} + volumeMounts: +{{ toYaml .Values.volumeMounts | indent 12 }} + +{{- if .Values.exporter.logstash.enabled }} + ## logstash-exporter + - name: {{ .Chart.Name }}-exporter + image: "{{ .Values.exporter.logstash.image.repository }}:{{ .Values.exporter.logstash.image.tag }}" + imagePullPolicy: {{ .Values.exporter.logstash.image.pullPolicy }} + command: ["/bin/sh", "-c"] + ## Delay start of logstash-exporter to give logstash more time to come online. + args: + - >- + sleep 60; + exec /logstash_exporter + --logstash.endpoint=http://localhost:{{ .Values.exporter.logstash.target.port }} + --web.listen-address=:{{ .Values.exporter.logstash.port }} + ports: + - name: ls-exporter + containerPort: {{ .Values.exporter.logstash.port }} + protocol: TCP + livenessProbe: +{{ toYaml .Values.exporter.logstash.livenessProbe | indent 12 }} + readinessProbe: +{{ toYaml .Values.exporter.logstash.readinessProbe | indent 12 }} + {{- with .Values.exporter.logstash.config }} + env: + {{- range $key, $value := . }} + - name: {{ $key | upper | replace "." "_" }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + resources: +{{ toYaml .Values.exporter.logstash.resources | indent 12 }} +{{- end }} + + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + volumes: + - name: patterns + configMap: + name: {{ template "logstash.fullname" . }}-patterns + - name: pipeline + configMap: + name: {{ template "logstash.fullname" . }}-pipeline + {{- with .Values.volumes }} +{{ toYaml . | indent 8 }} + {{- end }} +{{- if not .Values.persistence.enabled }} + - name: data + emptyDir: {} +{{- else }} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" + {{- end }} + {{- end }} +{{- end }} diff --git a/stable/logstash/values.yaml b/stable/logstash/values.yaml new file mode 100644 index 000000000000..4c65159dc55c --- /dev/null +++ b/stable/logstash/values.yaml @@ -0,0 +1,264 @@ +replicaCount: 1 + +podDisruptionBudget: + maxUnavailable: 1 + +updateStrategy: + type: RollingUpdate + +terminationGracePeriodSeconds: 30 + +image: + repository: docker.elastic.co/logstash/logstash-oss + tag: 6.4.2 + pullPolicy: IfNotPresent + ## Add secrets manually via kubectl on kubernetes cluster and reference here + # pullSecrets: + # - name: "myKubernetesSecret" + +service: + type: ClusterIP + # clusterIP: None + annotations: {} + ## AWS example for use with LoadBalancer service type. + # external-dns.alpha.kubernetes.io/hostname: logstash.cluster.local + # service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true" + # service.beta.kubernetes.io/aws-load-balancer-internal: "true" + ports: + # syslog-udp: + # port: 1514 + # targetPort: syslog-udp + # protocol: UDP + # syslog-tcp: + # port: 1514 + # targetPort: syslog-tcp + # protocol: TCP + beats: + port: 5044 + targetPort: beats + protocol: TCP + # http: + # port: 8080 + # targetPort: http + # protocol: TCP + # loadBalancerIP: 10.0.0.1 +ports: + # - name: syslog-udp + # containerPort: 1514 + # protocol: UDP + # - name: syslog-tcp + # containerPort: 1514 + # protocol: TCP + - name: beats + containerPort: 5044 + protocol: TCP + # - name: http + # containerPort: 8080 + # protocol: TCP + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - logstash.cluster.local + tls: [] + # - secretName: logstash-tls + # hosts: + # - logstash.cluster.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - topologyKey: "kubernetes.io/hostname" + # labelSelector: + # matchLabels: + # release: logstash + +podAnnotations: {} + # iam.amazonaws.com/role: "logstash-role" + # prometheus.io/scrape: "true" + # prometheus.io/path: "/metrics" + # prometheus.io/port: "9198" + +podLabels: {} + # team: "developers" + # service: "logstash" + +livenessProbe: + httpGet: + path: / + port: monitor + initialDelaySeconds: 20 + # periodSeconds: 30 + # timeoutSeconds: 30 + # failureThreshold: 6 + # successThreshold: 1 + +readinessProbe: + httpGet: + path: / + port: monitor + initialDelaySeconds: 20 + # periodSeconds: 30 + # timeoutSeconds: 30 + # failureThreshold: 6 + # successThreshold: 1 + +persistence: + enabled: true + ## logstash data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 2Gi + +volumeMounts: + - name: data + mountPath: /usr/share/logstash/data + - name: patterns + mountPath: /usr/share/logstash/patterns + - name: pipeline + mountPath: /usr/share/logstash/pipeline + +volumes: [] + # - name: tls + # secret: + # secretName: logstash-tls + # - name: pipeline + # configMap: + # name: logstash-pipeline + # - name: certs + # hostPath: + # path: /tmp + +exporter: + logstash: + enabled: false + image: + repository: bonniernews/logstash_exporter + tag: v0.1.2 + pullPolicy: IfNotPresent + env: {} + resources: {} + path: /metrics + port: 9198 + target: + port: 9600 + path: /metrics + livenessProbe: + httpGet: + path: /metrics + port: ls-exporter + periodSeconds: 15 + timeoutSeconds: 60 + failureThreshold: 8 + successThreshold: 1 + readinessProbe: + httpGet: + path: /metrics + port: ls-exporter + periodSeconds: 15 + timeoutSeconds: 60 + failureThreshold: 8 + successThreshold: 1 + +elasticsearch: + host: elasticsearch-client.default.svc.cluster.local + port: 9200 + +## ref: https://github.com/elastic/logstash-docker/blob/master/build/logstash/env2yaml/env2yaml.go +config: + config.reload.automatic: "true" + path.config: /usr/share/logstash/pipeline + path.data: /usr/share/logstash/data + + ## ref: https://www.elastic.co/guide/en/logstash/current/persistent-queues.html + queue.checkpoint.writes: 1 + queue.drain: "true" + queue.max_bytes: 1gb # disk capacity must be greater than the value of `queue.max_bytes` + queue.type: persisted + +## Patterns for filters. +## Each YAML heredoc will become a separate pattern file. +patterns: + # main: |- + # TESTING {"foo":.*}$ + +## NOTE: To achieve multiple pipelines with this chart, current best practice +## is to maintain one pipeline per chart release. In this way configuration is +## simplified and pipelines are more isolated from one another. + +inputs: + main: |- + input { + # udp { + # port => 1514 + # type => syslog + # } + # tcp { + # port => 1514 + # type => syslog + # } + beats { + port => 5044 + } + # http { + # port => 8080 + # } + # kafka { + # ## ref: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-kafka.html + # bootstrap_servers => "kafka-input:9092" + # codec => json { charset => "UTF-8" } + # consumer_threads => 1 + # topics => ["source"] + # type => "example" + # } + } + +filters: + # main: |- + # filter { + # } + +outputs: + main: |- + output { + # stdout { codec => rubydebug } + elasticsearch { + hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"] + manage_template => false + index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}" + document_type => "%{[@metadata][type]}" + } + # kafka { + # ## ref: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-kafka.html + # bootstrap_servers => "kafka-output:9092" + # codec => json { charset => "UTF-8" } + # compression_type => "lz4" + # topic_id => "destination" + # } + }