Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Promote logstash to stable (#8479)
Browse files Browse the repository at this point in the history
* Promote logstash to stable

Redo of #7222

Signed-off-by: Pete Brown <pete.brown@powerhrg.com>

* Update version of logstash

Fix references in readme

Signed-off-by: Pete Brown <pete.brown@powerhrg.com>
  • Loading branch information
rendhalver authored and k8s-ci-robot committed Oct 16, 2018
1 parent 4f88c32 commit 0eaf498
Show file tree
Hide file tree
Showing 16 changed files with 763 additions and 9 deletions.
13 changes: 4 additions & 9 deletions 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
2 changes: 2 additions & 0 deletions 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;
Expand Down
6 changes: 6 additions & 0 deletions 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 }}
Expand Down
21 changes: 21 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions 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
6 changes: 6 additions & 0 deletions stable/logstash/OWNERS
@@ -0,0 +1,6 @@
approvers:
- christian-roggia
- rendhalver
reviewers:
- christian-roggia
- rendhalver
114 changes: 114 additions & 0 deletions 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 |
21 changes: 21 additions & 0 deletions 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 }}
32 changes: 32 additions & 0 deletions 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 -}}
38 changes: 38 additions & 0 deletions 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 }}
14 changes: 14 additions & 0 deletions 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 }}
24 changes: 24 additions & 0 deletions 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 }}
15 changes: 15 additions & 0 deletions 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 }}
29 changes: 29 additions & 0 deletions 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 }}

0 comments on commit 0eaf498

Please sign in to comment.