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

Add further documentation for Logstash volumes #7022

Merged
merged 7 commits into from Jul 20, 2023

Conversation

robbavey
Copy link
Member

This commit adds some further details, examples and a recipe to document the use of Logstash volumes.

This commit also updates examples using the logstash elasticsearch output to use updated SSL settings after SSL standardization effort

`cacert` and `ssl` were recently deprecated in favor of `ssl_certificate_authorities` and `ssl_enabled`
respectively. This commit updates the recipes and docs to reflect that.
@robbavey robbavey requested a review from karenzone July 14, 2023 14:16
@botelastic botelastic bot added the triage label Jul 14, 2023
@pebrc pebrc added the >docs Documentation label Jul 17, 2023
@botelastic botelastic bot removed the triage label Jul 17, 2023
@thbkrkr thbkrkr removed the triage label Jul 17, 2023
Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

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

Looks really good!

Copy link
Contributor

@thbkrkr thbkrkr left a comment

Choose a reason for hiding this comment

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

Nice reading! Left some nits.

Co-authored-by: Thibault Richard <thbkrkr@users.noreply.github.com>
@thbkrkr thbkrkr merged commit d2e915f into elastic:main Jul 20, 2023
5 checks passed
thbkrkr added a commit to thbkrkr/cloud-on-k8s that referenced this pull request Jul 20, 2023
* Add documentation for Logstash persistent storage
* Update recipes and examples to use new settings for Elasticsearch output

---------

Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com>
Co-authored-by: Thibault Richard <thbkrkr@users.noreply.github.com>
thbkrkr added a commit that referenced this pull request Jul 20, 2023
* Add documentation for Logstash persistent storage
* Update recipes and examples to use new settings for Elasticsearch output

---------

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com>
Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

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

Nice work! I left some comments inline for consideration, mostly around using attribute (such as {ls} and {k8s} for consistency) and being through and consistent in the way we reference "persistent queue" and "PQ, and "dead letter queue" and "DLQ for users who search on one term or the other.

@@ -290,8 +291,16 @@ added:[2.9.0]

WARNING: Volume support for Logstash is a breaking change to earlier versions of ECK and requires you to recreate your Logstash objects.


[float]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[float]
[id="{p}-volume-claim-settings"]
[discrete]

Copy link
Contributor

Choose a reason for hiding this comment

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

Or, an assigned ID of your choosing. We have more control when we set IDs rather than allowing the system to generate them.

@@ -312,7 +321,10 @@ spec:
----


Separate storage, for example for Logstash configurations using persistent queues (PQ) and/or dead letter queues (DLQ), can be added by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume, as shown in the following example:
Separate storage, for example for Logstash configurations using persistent queues (PQ) and/or dead letter queues (DLQ), can be added by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Separate storage, for example for Logstash configurations using persistent queues (PQ) and/or dead letter queues (DLQ), can be added by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume.
You can add separate storage by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume.
{ls} configurations using persistent queues (PQs) and/or dead letter queues (DLQs) are examples where you might want to add separate storage.

Copy link
Contributor

Choose a reason for hiding this comment

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

^^ That's more words, but it seems easier to parse.

For clarification: Is adding separate storage a decision or a "must" in the examples given?

Separate storage, for example for Logstash configurations using persistent queues (PQ) and/or dead letter queues (DLQ), can be added by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume, as shown in the following example:
Separate storage, for example for Logstash configurations using persistent queues (PQ) and/or dead letter queues (DLQ), can be added by including an additional `spec.volumeClaimTemplate` along with a corresponding `spec.podTemplate.spec.containers.volumeMount` for each requested volume.

The following example shows how to setup separate storage for a PQ:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following example shows how to setup separate storage for a PQ:
This example shows how to setup separate storage for a PQ:

<2> Set the `path.queue` setting in the configuration to match the `mountPath` in the `volumeMount`.


The following example shows how to configure Logstash with a Dead Letter Queue setup on the main pipeline, and a separate pipeline to read items from the DLQ.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following example shows how to configure Logstash with a Dead Letter Queue setup on the main pipeline, and a separate pipeline to read items from the DLQ.
This example shows how to configure {ls} with a Dead Letter Queue setup on the main pipeline, and a separate pipeline to read items from the DLQ.

@@ -597,6 +735,16 @@ kubectl apply -f {logstash_recipes}/logstash-es-role.yaml

Deploys Logstash and Elasticsearch, and creates an updated version of the `eck_logstash_user_role` to write to a user specified index.

[id="{p}-logstash-configuration-pq-dlq"]
=== Creating persitent volumes for PQ and DLQ
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
=== Creating persitent volumes for PQ and DLQ
=== Creating persistent volumes for PQ and DLQ

kubectl apply -f {logstash_recipes}/logstash-volumes.yaml
----

Deploys Logstash, Beats and Elasticsearch. Logstash is configured with two pipelines - a main pipeline for reading from the Beats instance, which will send to the DLQ if it is unable to write to Elasticsearch, and a second pipeline, that will read from the DLQ. In addition, persistent queues are set up. This example shows how to configure persistent volumes outside of the default `logstash-data` persistent volume.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Deploys Logstash, Beats and Elasticsearch. Logstash is configured with two pipelines - a main pipeline for reading from the Beats instance, which will send to the DLQ if it is unable to write to Elasticsearch, and a second pipeline, that will read from the DLQ. In addition, persistent queues are set up. This example shows how to configure persistent volumes outside of the default `logstash-data` persistent volume.
Deploys {ls], [beats] and {es]. {ls] is configured with two pipelines:
* a main pipeline for reading from the {beats} instance, which will send to the DLQ if it is unable to write to Elasticsearch
* a second pipeline, that will read from the DLQ.
In addition, persistent queues are set up.
This example shows how to configure persistent volumes outside of the default `logstash-data` persistent volume.

=== No integrated support for persistence
The operator provides no integrated support for persistence, including PQ, DLQ support and plugins that may require persistent storage to keep track of state - any persistence should be added manually.
=== Experimental support for persistence
NOTE: This is a breaking change from version 2.8.0 of the ECK operator and requires re-creation of existing Logstash objects.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
NOTE: This is a breaking change from version 2.8.0 of the ECK operator and requires re-creation of existing Logstash objects.
NOTE: Persistence (experimental) is a breaking change from version 2.8.0 of the ECK operator and requires re-creation of existing {ls} objects.

=== Experimental support for persistence
NOTE: This is a breaking change from version 2.8.0 of the ECK operator and requires re-creation of existing Logstash objects.

The operator now includes support for persistence, with a small (`1Gi`) default `PersistentVolume` called `logstash-data` created, that maps to `/usr/share/logstash/data`, which should be typically used for storage from plugins. The default volume can be overridden by adding a `spec.volumeClaimTemplate` section named `logstash-data` to add more storage, or to use a different `storageClass` from the default, for example. Additional `persistentVolumeClaims` can also be defined in `spec.volumeClaimTemplate` for use with PQ, or DLQ, for example.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The operator now includes support for persistence, with a small (`1Gi`) default `PersistentVolume` called `logstash-data` created, that maps to `/usr/share/logstash/data`, which should be typically used for storage from plugins. The default volume can be overridden by adding a `spec.volumeClaimTemplate` section named `logstash-data` to add more storage, or to use a different `storageClass` from the default, for example. Additional `persistentVolumeClaims` can also be defined in `spec.volumeClaimTemplate` for use with PQ, or DLQ, for example.
The operator now includes support for persistence.
It creates a small (`1Gi`) default `PersistentVolume` called `logstash-data` that maps to `/usr/share/logstash/data`, typically used for storage from plugins.
The default volume can be overridden by adding a `spec.volumeClaimTemplate` section named `logstash-data` to add more storage, or to use a different `storageClass` from the default, for example.
You can define additional `persistentVolumeClaims` in `spec.volumeClaimTemplate` for use with PQ, or DLQ, for example.


The operator now includes support for persistence, with a small (`1Gi`) default `PersistentVolume` called `logstash-data` created, that maps to `/usr/share/logstash/data`, which should be typically used for storage from plugins. The default volume can be overridden by adding a `spec.volumeClaimTemplate` section named `logstash-data` to add more storage, or to use a different `storageClass` from the default, for example. Additional `persistentVolumeClaims` can also be defined in `spec.volumeClaimTemplate` for use with PQ, or DLQ, for example.

The current implementation does not allow resizing of volumes even if your chosen storage class would support it. To resize a volume you have to fully delete the Logstash object, delete and recreate or resize the volume and create a new Logstash object. Also note that volume claims will not be deleted when you delete the Logstash resource and have to be deleted manually. This behaviour might change in future versions of the ECK operator.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The current implementation does not allow resizing of volumes even if your chosen storage class would support it. To resize a volume you have to fully delete the Logstash object, delete and recreate or resize the volume and create a new Logstash object. Also note that volume claims will not be deleted when you delete the Logstash resource and have to be deleted manually. This behaviour might change in future versions of the ECK operator.
The current implementation does not allow resizing of volumes, even if your chosen storage class would support it.
To resize a volume, delete the {ls] object, delete and recreate (or resize) the volume, and create a new {ls} object.
Note that volume claims will not be deleted when you delete the {ls} resource, and must be deleted manually.
This behavior might change in future versions of the ECK operator.

@karenzone karenzone self-assigned this Jul 20, 2023
@thbkrkr
Copy link
Contributor

thbkrkr commented Jul 24, 2023

I will open a new PR with Karen's review feebacks.

Edit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs Documentation v2.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants