Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-facing documentation for Logstash on ECK #6743

Merged
merged 53 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
47beb32
Initial Commit of Basic Operator for Logstash (#6404)
robbavey Mar 6, 2023
fa2b9e5
Stack monitoring for Logstash (#6436)
kaisecheng Mar 22, 2023
450e61c
Merge remote-tracking branch 'upstream/main' into feature/logstash
robbavey Mar 22, 2023
7ce5d9a
Logstash pipelines (#6480)
kaisecheng Apr 6, 2023
a930555
Merge remote-tracking branch 'upstream/main' into feature/logstash
robbavey Apr 6, 2023
797f1c9
Logstash controller unit and integration tests (#6575)
robbavey Apr 11, 2023
f984355
Logstash - add ability to reload pipeline(s) without triggering full …
robbavey Apr 21, 2023
adca107
Add Logstash Telemetry (#6562)
robbavey Apr 21, 2023
2b22aee
Fix service tests (#6720)
robbavey Apr 24, 2023
69b5ef9
Logstash add ElasticsearchRefs (#6662)
kaisecheng Apr 26, 2023
5811a64
Merge remote-tracking branch 'upstream/main' into feature/logstash
robbavey Apr 26, 2023
169f79d
Update all-crds.yml
robbavey Apr 26, 2023
f03aa79
Fix the sample tests for logstash service and stack monitoring (#6731)
robbavey Apr 27, 2023
ba98590
Update pkg/apis/logstash/v1alpha1/logstash_types.go
robbavey Apr 28, 2023
c1930a2
Add comment to `clusterName`
robbavey Apr 28, 2023
4186efb
Regenerate after comments
robbavey Apr 28, 2023
0b7a58a
First pass
robbavey Mar 21, 2023
4f1b102
Added more logstash docs
robbavey Mar 24, 2023
b2e00d4
Add Logstash Recipes
robbavey Mar 24, 2023
90683af
Tidy up readme
robbavey Mar 24, 2023
9ecb8cd
Added more doc
robbavey Mar 28, 2023
d14faf0
Improvements
robbavey Mar 28, 2023
f9ba1ff
add recipes for ElasticsearchRefs
kaisecheng Apr 20, 2023
38de4dd
Responded to code review comments
robbavey Apr 3, 2023
a29d9f0
Updates for elasticsearchRef. A little tidying
robbavey Apr 24, 2023
f07d6ce
Add role information to elasticsearch integration
robbavey Apr 24, 2023
2f45d19
Fix env variable names in example snippets
robbavey Apr 24, 2023
add2f2c
Fix recipes
robbavey Apr 25, 2023
7aa2a6c
Add intro to elasticsearchref example
robbavey Apr 25, 2023
5872086
Remove duplicate recipe reference.
robbavey Apr 26, 2023
6ceb4f9
Add the new file to the landing page
alaudazzi Apr 28, 2023
e98acfe
Apply suggestions from code review
robbavey Apr 28, 2023
301a554
Tidy up recipes after code review comments
robbavey Apr 28, 2023
232d61b
More code review suggestions
robbavey Apr 28, 2023
c3b9007
Missed capitalization
robbavey Apr 28, 2023
353cac7
Merge remote-tracking branch 'upstream/main' into logstash_doc
robbavey Apr 28, 2023
c0b8715
Apply suggestions from code review
robbavey May 1, 2023
4cbc1d9
Reformatting changes
robbavey May 1, 2023
2364f6b
Add close to [NOTE]
robbavey May 1, 2023
a626eaa
Add anchors to examples, point ES role note to point to specific example
robbavey May 1, 2023
0ddfbda
Add reference to logstash-multi.yaml to readme
robbavey May 1, 2023
3a5e530
Add Logstash references to parts of the doc where other stack compone…
robbavey May 2, 2023
00b91b7
Fix uses of logstash constant
robbavey May 2, 2023
18453d4
Simplify multi.yaml recipe
robbavey May 2, 2023
81b1812
Apply suggestions from code review
robbavey May 3, 2023
3ba64b9
Updated based on code review comments.
robbavey May 3, 2023
7787e33
Apply suggestions from code review
robbavey May 4, 2023
957b3ce
Merge branch 'logstash_doc' of https://github.com/robbavey/cloud-on-k…
karenzone May 8, 2023
566242d
Reformat limitations
karenzone May 8, 2023
66f90bd
Merge remote-tracking branch 'upstream/main' into logstash_doc
robbavey May 8, 2023
b9683e7
Merge remote-tracking branch 'origin/logstash_doc' into logstash_doc
robbavey May 8, 2023
8c7ea13
Add 'experimental' header to child pages
robbavey May 8, 2023
6f12385
Apply suggestions from code review
robbavey May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions config/recipes/logstash/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@ endif::[]

= Using Logstash with ECK

This recipe demonstrates how to run the link:https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html[Logstash log parsing example] on Kubernetes with Elasticsearch, Kibana and Filebeat deployed via ECK.
These recipes demonstrate how to run Logstash, Elasticsearch, Kibana and Filebeat deployed via ECK, using the link:https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html[Logstash log parsing example] as a starting point.

===== Inline Pipeline usage - `logstash-eck.yaml`

Deploys Logstash with the pipeline defined inline in the CRD.

===== Pipeline as Secret - `logstash-pipeline-as-secret.yaml`

Deploys Logstash with the pipeline defined in a Secret and referred to via `pipelinesRef`.

===== Pipeline as mounted volume - `logstash-pipeline-as-volume.yaml`
Copy link

Choose a reason for hiding this comment

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

Can we also add a section for logstash-multi.yaml?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good spot! I didn't realize it hadn't been added to the readme.

Done

Copy link

Choose a reason for hiding this comment

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

🙈 Refreshed the page but I still don't see it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, missed a git push 🤦‍♂️


Deploys Logstash with the pipeline details defined in the CRD, and the pipeline itself mounted as a volume.

===== Logstash with multiple pipelines and multiple elasticsearchRefs - `logstash-multi.yaml`

Deploys Logstash with multiple pipelines, each of which sends to a separate Elasticsearch cluster.

===== Logstash with Stack Monitoring - `logstash-monitored.yaml`

Deploys Logstash and a dedicated Elasticsearch and Kibana monitoring cluster, and sends Logstash monitoring data to that cluster.

===== Logstash and Elasticsearch with custom role - `logstash-es-role.yaml`

Deploys Logstash and Elasticsearch and a Secret to customize Elasticsearch role `eck_logstash_user_role`. The role is essential for Logstash to have privileges to write document to custom index "my-index".

CAUTION: These recipes use the `node.store.allow_mmap: false` configuration value to avoid configuring memory mapping settings on the underlying host. This could have a significant performance impact on your Elasticsearch cluster and should not be used in production without careful consideration. See https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html for more information.

CAUTION: This recipe uses the `node.store.allow_mmap: false` configuration value to avoid configuring memory mapping settings on the underlying host. This could have a significant performance impact on your Elasticsearch cluster and should not be used in production without careful consideration. See https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html for more information.
108 changes: 108 additions & 0 deletions config/recipes/logstash/logstash-eck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.7.0
nodeSets:
- name: default
count: 3
config:
# This setting has performance implications. See the README for more details.
node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana
spec:
version: 8.7.0
count: 1
elasticsearchRef:
name: elasticsearch
---
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: filebeat
spec:
type: filebeat
version: 8.7.0
config:
filebeat.inputs:
- type: log
paths:
- /data/logstash-tutorial.log
output.logstash:
hosts: ["logstash-ls-beats:5044"]
deployment:
podTemplate:
spec:
automountServiceAccountToken: true
initContainers:
- name: download-tutorial
image: curlimages/curl
command: ["/bin/sh"]
args: ["-c", "curl -L https://download.elastic.co/demos/logstash/gettingstarted/logstash-tutorial.log.gz | gunzip -c > /data/logstash-tutorial.log"]
volumeMounts:
- name: data
mountPath: /data
containers:
- name: filebeat
volumeMounts:
- name: data
mountPath: /data
- name: beat-data
mountPath: /usr/share/filebeat/data
volumes:
- name: data
emptydir: {}
- name: beat-data
emptydir: {}
---
apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
name: logstash
spec:
count: 1
version: 8.7.0
elasticsearchRefs:
- clusterName: eck
name: elasticsearch
pipelines:
- pipeline.id: main
config.string: |
input {
beats {
port => 5044
}
}
filter {
grok {
match => { "message" => "%{HTTPD_COMMONLOG}"}
}
geoip {
source => "[source][address]"
target => "[source]"
}
}
output {
elasticsearch {
hosts => [ "${ECK_ES_HOSTS}" ]
user => "${ECK_ES_USER}"
password => "${ECK_ES_PASSWORD}"
cacert => "${ECK_ES_SSL_CERTIFICATE_AUTHORITY}"
}
}
services:
- name: beats
service:
spec:
type: ClusterIP
ports:
- port: 5044
name: "filebeat"
protocol: TCP
targetPort: 5044
55 changes: 55 additions & 0 deletions config/recipes/logstash/logstash-es-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
kind: Secret
apiVersion: v1
metadata:
name: my-roles-secret
stringData:
roles.yml: |-
eck_logstash_user_role:
cluster: [ "monitor", "manage_ilm", "read_ilm", "manage_logstash_pipelines", "manage_index_templates", "cluster:admin/ingest/pipeline/get"]
indices:
- names: [ "my-index", "logstash", "logstash-*", "ecs-logstash", "ecs-logstash-*", "logs-*", "metrics-*", "synthetics-*", "traces-*" ]
privileges: [ "manage", "write", "create_index", "read", "view_index_metadata" ]
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.7.0
auth:
roles:
- secretName: my-roles-secret
nodeSets:
- name: default
count: 3
config:
node.store.allow_mmap: false
---
apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
name: logstash
spec:
count: 1
version: 8.7.0
elasticsearchRefs:
- name: elasticsearch
clusterName: eck
pipelines:
- pipeline.id: main
config.string: |
input { exec { command => "uptime" interval => 10 } }
output {
elasticsearch {
hosts => [ "${ECK_ES_HOSTS}" ]
ssl => true
cacert => "${ECK_ES_SSL_CERTIFICATE_AUTHORITY}"
user => "${ECK_ES_USER}"
password => "${ECK_ES_PASSWORD}"
index => "my-index"
data_stream => false
ilm_enabled => false
manage_template => false
}
}
---
134 changes: 134 additions & 0 deletions config/recipes/logstash/logstash-monitored.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.7.0
nodeSets:
- name: default
count: 3
config:
# This setting has performance implications. See the README for more details.
node.store.allow_mmap: false
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: it will be great to also see elasticsearch and kibana metrics in stack monitoring. This also makes sure Logstash metrics show in UI

---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana
spec:
version: 8.7.0
count: 1
elasticsearchRef:
name: elasticsearch
---
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: filebeat
spec:
type: filebeat
version: 8.7.0
config:
filebeat.inputs:
- type: log
paths:
- /data/logstash-tutorial.log
output.logstash:
hosts: ["logstash-ls-beats:5044"]
deployment:
podTemplate:
spec:
automountServiceAccountToken: true
initContainers:
- name: download-tutorial
image: curlimages/curl
command: ["/bin/sh"]
args: ["-c", "curl -L https://download.elastic.co/demos/logstash/gettingstarted/logstash-tutorial.log.gz | gunzip -c > /data/logstash-tutorial.log"]
volumeMounts:
- name: data
mountPath: /data
containers:
- name: filebeat
volumeMounts:
- name: data
mountPath: /data
- name: beat-data
mountPath: /usr/share/filebeat/data
volumes:
- name: data
emptydir: {}
- name: beat-data
emptydir: {}
---
apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
name: logstash
spec:
count: 1
version: 8.7.0
elasticsearchRefs:
- clusterName: eck
name: elasticsearch
monitoring:
metrics:
elasticsearchRefs:
- name: elasticsearch-monitoring
pipelines:
- pipeline.id: main
config.string: |
input {
beats {
port => 5044
}
}
filter {
grok {
match => { "message" => "%{HTTPD_COMMONLOG}"}
}
geoip {
source => "[source][address]"
target => "[source]"
}
}
output {
elasticsearch {
hosts => [ "${ECK_ES_HOSTS}" ]
user => "${ECK_ES_USER}"
password => "${ECK_ES_PASSWORD}"
cacert => "${ECK_ES_SSL_CERTIFICATE_AUTHORITY}"
}
}
services:
- name: beats
service:
spec:
type: ClusterIP
ports:
- port: 5044
name: "filebeat"
protocol: TCP
targetPort: 5044
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch-monitoring
spec:
version: 8.7.0
nodeSets:
- name: default
count: 3
config:
node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana-monitoring
spec:
version: 8.7.0
count: 1
elasticsearchRef:
name: elasticsearch-monitoring
Loading