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

Commit

Permalink
[stable/logstash] Create a ServiceAccount and add arguments (#14536)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Sensenich <[email protected]>
  • Loading branch information
marc-sensenich authored and k8s-ci-robot committed Jun 27, 2019
1 parent 8f3f909 commit cd063f6
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stable/logstash/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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: 2.0.0
version: 2.1.0
appVersion: 7.1.1
sources:
- https://www.docker.elastic.co
Expand Down
17 changes: 10 additions & 7 deletions stable/logstash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Please review the following links that expound on current best practices.

The following table lists the configurable parameters of the chart and its default values.

| Parameter | Description | Default |
| --------------------------- | -------------------------------------------------- | ------------------------------------------------ |
| Parameter | Description | Default |
| ------------------------------- | -------------------------------------------------- | ------------------------------------------------ |
| `replicaCount` | Number of replicas | `1` |
| `podDisruptionBudget` | Pod disruption budget | `maxUnavailable: 1` |
| `updateStrategy` | Update strategy | `type: RollingUpdate` |
Expand Down Expand Up @@ -101,16 +101,16 @@ The following table lists the configurable parameters of the chart and its defau
| `podLabels` | Pod labels | `{}` |
| `extraEnv` | Extra pod environment variables | `[]` |
| `extraInitContainers` | Add additional initContainers | `[]` |
| `podManagementPolicy` | podManagementPolicy of the StatefulSet | `OrderedReady` |
| `podManagementPolicy` | podManagementPolicy of the StatefulSet | `OrderedReady` |
| `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`
| `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` |
Expand All @@ -122,5 +122,8 @@ The following table lists the configurable parameters of the chart and its defau
| `inputs` | Logstash inputs configuration | beats |
| `filters` | Logstash filters configuration | `nil` |
| `outputs` | Logstash outputs configuration | elasticsearch |
| `securityContext.fsGroup` | Group ID for the container | `1000` |
| `securityContext.runAsUser` | User ID for the container | `1000` |
| `securityContext.fsGroup` | Group ID for the container | `1000` |
| `securityContext.runAsUser` | User ID for the container | `1000` |
| `args` | Additional arguments to pass to Logstash | `1000` |
| `serviceAccount.create` | Specifies if a ServiceAccount should be created | `true` |
| `serviceAccount.name` | The name of the ServiceAccount to use | `""` |
Empty file.
11 changes: 11 additions & 0 deletions stable/logstash/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ 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 -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "logstash.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "logstash.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
11 changes: 11 additions & 0 deletions stable/logstash/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "logstash.serviceAccountName" . }}
labels:
app: {{ template "logstash.name" . }}
chart: {{ template "logstash.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end -}}
5 changes: 5 additions & 0 deletions stable/logstash/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ spec:
{{ toYaml .Values.livenessProbe | indent 12 }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 12 }}
{{- if .Values.args }}
args:
{{ .Values.args | toYaml | indent 12 }}
{{- end }}
env:
## Logstash monitoring API host and port env vars
- name: HTTP_HOST
Expand Down Expand Up @@ -137,6 +141,7 @@ spec:
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
serviceAccountName: {{ template "logstash.serviceAccountName" . }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
volumes:
- name: patterns
Expand Down
11 changes: 11 additions & 0 deletions stable/logstash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,14 @@ outputs:
# topic_id => "destination"
# }
}
serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:

## Additional arguments to pass to the Logstash entrypoint
# args:
# - fizz

1 comment on commit cd063f6

@darenjacobstellic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'm trying to use this with GKE. Having issues with it. I'm have modified the values.yaml to use service type LoadBalancer to get an external IP. I have Ingress enabled. I can telnet to the public IP but I cannot connect via filebeat. I get an instant disconnect. I have tried putting output to file and output to stdout but I cannot get any output / information from logstash. Any assistance would be greatly appreciated.

Please sign in to comment.