Logstash pipelines#6480
Merged
kaisecheng merged 164 commits intoelastic:feature/logstashfrom Apr 6, 2023
Merged
Conversation
Initial commit of a simple operator. The first operator will create: * A Service exposing the logstash metrics API, so it can be used for monitoring purposes * Secrets holding logstash.yml * A StatefulSet deploying the logstash pods * Pods with default liveness and readiness probes The sample logstash yml file as located in config/samples/logstash/logstash.yaml will create: ``` ✗ kubectl tree logstash logstash-sample NAMESPACE NAME READY REASON AGE default Logstash/logstash-sample - 4m5s default ├─Secret/logstash-sample-ls-config - 4m4s default ├─Service/logstash-sample-ls-http - 4m5s default │ └─EndpointSlice/logstash-sample-ls-http-kwfsg - 4m5s default └─StatefulSet/logstash-sample-ls - 4m4s default ├─ControllerRevision/logstash-sample-ls-79bd59f869 - 4m4s default ├─Pod/logstash-sample-ls-0 True 3m59s default ├─Pod/logstash-sample-ls-1 True 3m59s default └─Pod/logstash-sample-ls-2 True 3m59s ``` And shows status: ``` ✗ kubectl get logstash logstash-sample NAME AVAILABLE EXPECTED AGE VERSION logstash-sample 3 3 9m1s 8.6.1 ``` Still TODO: * Unit Tests * End to end Tests * Certificate handling on the HTTP Metrics API Tidy up Co-authored-by: Kaise Cheng <kaise.cheng@elastic.co>
Rudimentary tests for validation and naming
This reverts commit 6eabf4c.
This reverts commit 8016b7b. Remving e2e tests to get e2e tests prior to logstash working
This reverts commit b5c775e. And re-adds the e2e tests
This reverts commit d4908b7.
Add a test to make sure that Logstash is running, by testing the metrics API endpoint and checking that the value of status is "green"
This commit fixes the readiness probe, by setting the default visibility of the logstash API to 0.0.0.0, allowing access to the metrics API to the probe
fix syntax
barkbay
reviewed
Apr 4, 2023
barkbay
reviewed
Apr 4, 2023
barkbay
reviewed
Apr 4, 2023
barkbay
reviewed
Apr 4, 2023
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
add comment to e2e
robbavey
reviewed
Apr 5, 2023
Member
robbavey
left a comment
There was a problem hiding this comment.
Great stuff, just a couple of nits/suggestions around clarifying naming around PipelinesRef and ConfigRef
| } | ||
|
|
||
| // MustParse parses the given pipeline content into a Pipelines. | ||
| // Expects content to be in YAML format. Panics on error. |
Member
There was a problem hiding this comment.
Nit: Add comment to state that this should be used in tests only
| ) | ||
|
|
||
| // ConfigRefWatchName returns the name of the watch registered on the secret referenced in `pipelinesRef`. | ||
| func ConfigRefWatchName(resource types.NamespacedName) string { |
Member
There was a problem hiding this comment.
Nit: Maybe PipelinesRef instead of ConfigRef?
Maybe for the filename here too
Suggested change
| func ConfigRefWatchName(resource types.NamespacedName) string { | |
| func PipelinesRefWatchName(resource types.NamespacedName) string { |
Contributor
Author
There was a problem hiding this comment.
lint suggested not to use Pipelines prefix. Renamed to ref.go and RefWatchName()
|
|
||
| // ParseConfigRef retrieves the content of a secret referenced in `pipelinesRef`, sets up dynamic watches for that secret, | ||
| // and parses the secret content into a PipelinesConfig. | ||
| func ParseConfigRef( |
Member
There was a problem hiding this comment.
Nit:
Suggested change
| func ParseConfigRef( | |
| func ParsePipelinesRef( |
Contributor
Author
|
@barkbay I think it is ready 2nd round |
barkbay
approved these changes
Apr 6, 2023
test/e2e/test/logstash/checks.go
Outdated
| "encoding/json" | ||
| "fmt" | ||
|
|
||
| "github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/settings" |
Contributor
There was a problem hiding this comment.
nit: import grouping seems off
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Co-authored-by: Michael Morello <michael.morello@gmail.com>
Member
|
#6674 adds pipeline reload functionality |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows configuration of Logstash
pipeline.ymlin CRD.pipeline.ymlis an array of map of string/interface{} defining multiple pipelines..in between the key is treated as string.Pipelines can be set from either inline in
Pipelinesor secret referencing inPipelinesRef.This PR includes tests
TestPipelineConfigRefLogstash,TestPipelineConfigLogstash