Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
99d86cf
Initial Commit of ECK for Logstash
robbavey Feb 10, 2023
11f0f79
Comment out certs for HTTPS for now
robbavey Feb 10, 2023
7414098
Fix up linter issus
robbavey Feb 10, 2023
2304fa3
Generate API docs
robbavey Feb 10, 2023
9459a70
First set of unit tests
robbavey Feb 13, 2023
285c7bf
Fix goimports
robbavey Feb 13, 2023
d6e7ef2
Add version check
robbavey Feb 13, 2023
8016b7b
Add e2e tests
robbavey Feb 14, 2023
6eabf4c
Temporarily take out probes
robbavey Feb 14, 2023
d4908b7
Revert "Temporarily take out probes"
robbavey Feb 15, 2023
b5c775e
Revert "Add e2e tests"
robbavey Feb 15, 2023
33371ad
Fix linter
robbavey Feb 15, 2023
8e6e707
Add logstash config details
robbavey Feb 15, 2023
4afe0de
Fix up typos
robbavey Feb 15, 2023
5f9040f
Revert "Revert "Add e2e tests""
robbavey Feb 15, 2023
803b9ab
Revert "Revert "Temporarily take out probes""
robbavey Feb 15, 2023
0d79bc9
Tidying up
robbavey Feb 16, 2023
4e73a41
Add Logstash to sample and stack tests
robbavey Feb 16, 2023
5713bb4
Added basic logstash verification
robbavey Feb 16, 2023
e66b380
Fix readiness probe
robbavey Feb 16, 2023
9fb1e20
Tidy up
robbavey Feb 16, 2023
34c2aca
add stack monitoring
kaisecheng Feb 16, 2023
131f17c
update test
kaisecheng Feb 21, 2023
b553970
fix sidecar ES ref namespace
kaisecheng Feb 21, 2023
d9f8f90
allow podTemplate update
kaisecheng Feb 21, 2023
f31ba83
fix stack monitoring e2e
kaisecheng Feb 21, 2023
7ff0f46
doc and lint
kaisecheng Feb 22, 2023
9cf60b1
lint
kaisecheng Feb 22, 2023
d7a587e
fix doc gen
kaisecheng Feb 22, 2023
0b41a42
bring back lint
kaisecheng Feb 22, 2023
d96098f
add sample resources for stack monitoring
kaisecheng Feb 23, 2023
8eb21a2
add unit test
kaisecheng Feb 23, 2023
a524216
remove useless NamespacedName as metrics API does not take username a…
kaisecheng Feb 23, 2023
86df8fd
remove useless NamespacedName method
kaisecheng Feb 27, 2023
30aa37b
remove irrelevant es ref
kaisecheng Mar 1, 2023
044b2c9
add issues to track log monitoring
kaisecheng Mar 2, 2023
7e38109
add env LOG_STYLE for log monitoring
kaisecheng Mar 2, 2023
e0699c5
Merge remote-tracking branch 'upstream/feature/logstash' into logstas…
kaisecheng Mar 7, 2023
149a9b7
lint, doc, generate
kaisecheng Mar 7, 2023
b98a36c
update example
kaisecheng Mar 7, 2023
85decbb
add webhook
kaisecheng Mar 7, 2023
ee630d2
add todo
kaisecheng Mar 7, 2023
53aa657
Update pkg/controller/logstash/stackmon/sidecar.go
kaisecheng Mar 8, 2023
3f76e57
Update pkg/apis/logstash/v1alpha1/logstash_types.go
kaisecheng Mar 8, 2023
18609b5
Update pkg/controller/logstash/stackmon/sidecar.go
kaisecheng Mar 8, 2023
9ceef2b
ship deprecation log with filebeat
kaisecheng Mar 8, 2023
ef6437f
add comments
kaisecheng Mar 8, 2023
9c9c12e
use static log4j2.properties
kaisecheng Mar 8, 2023
e4e5d84
rename receiver
kaisecheng Mar 8, 2023
fab33db
remove duplicate container name
kaisecheng Mar 8, 2023
60736da
set minimum es version for test
kaisecheng Mar 8, 2023
0fb3299
add doc for log4j2 requirement
kaisecheng Mar 8, 2023
29c66ff
Revert "set minimum es version for test"
kaisecheng Mar 8, 2023
b5943a4
set minimum es version for test
kaisecheng Mar 9, 2023
48915cf
- refactor version validation
kaisecheng Mar 9, 2023
9c8c999
Update test/e2e/logstash/stack_monitoring_test.go
kaisecheng Mar 20, 2023
76d8756
Update test/e2e/test/logstash/builder.go
kaisecheng Mar 20, 2023
809b32a
Update test/e2e/test/logstash/builder.go
kaisecheng Mar 20, 2023
da2f36e
fix comment
kaisecheng Mar 20, 2023
94e7c75
fix lint and import
kaisecheng Mar 20, 2023
218a1e9
refactor CheckBeatSidecars
kaisecheng Mar 20, 2023
21e3c5b
fix lint
kaisecheng Mar 20, 2023
53ed2df
Update pkg/controller/logstash/driver.go
kaisecheng Mar 21, 2023
ea84d94
Update pkg/apis/logstash/v1alpha1/validations.go
kaisecheng Mar 21, 2023
14563e1
Revert "refactor CheckBeatSidecars"
kaisecheng Mar 21, 2023
62463ac
rename CheckBeatSidecars to CheckBeatSidecarsInElasticsearch
kaisecheng Mar 21, 2023
85bc3e2
lint
kaisecheng Mar 21, 2023
44c9afa
add monitoring status check
kaisecheng Mar 21, 2023
c9d059b
lint
kaisecheng Mar 21, 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
2 changes: 2 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ func registerControllers(mgr manager.Manager, params operator.Parameters, access
{name: "ES-MONITORING", registerFunc: associationctl.AddEsMonitoring},
{name: "KB-MONITORING", registerFunc: associationctl.AddKbMonitoring},
{name: "BEAT-MONITORING", registerFunc: associationctl.AddBeatMonitoring},
{name: "LOGSTASH-MONITORING", registerFunc: associationctl.AddLogstashMonitoring},
}

for _, c := range assocControllers {
Expand Down Expand Up @@ -917,6 +918,7 @@ func garbageCollectUsers(ctx context.Context, cfg *rest.Config, managedNamespace
For(&beatv1beta1.BeatList{}, associationctl.BeatAssociationLabelNamespace, associationctl.BeatAssociationLabelName).
For(&agentv1alpha1.AgentList{}, associationctl.AgentAssociationLabelNamespace, associationctl.AgentAssociationLabelName).
For(&emsv1alpha1.ElasticMapsServerList{}, associationctl.MapsESAssociationLabelNamespace, associationctl.MapsESAssociationLabelName).
For(&logstashv1alpha1.LogstashList{}, associationctl.LogstashAssociationLabelNamespace, associationctl.LogstashAssociationLabelName).
DoGarbageCollection(ctx)
if err != nil {
return fmt.Errorf("user garbage collector failed: %w", err)
Expand Down
109 changes: 109 additions & 0 deletions config/crds/v1/all-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9121,6 +9121,108 @@ spec:
description: Image is the Logstash Docker image to deploy. Version
and Type have to match the Logstash in the image.
type: string
monitoring:
description: Monitoring enables you to collect and ship log and monitoring
data of this Logstash. Metricbeat and Filebeat are deployed in the
same Pod as sidecars and each one sends data to one or two different
Elasticsearch monitoring clusters running in the same Kubernetes
cluster.
properties:
logs:
description: Logs holds references to Elasticsearch clusters which
receive log data from an associated resource.
properties:
elasticsearchRefs:
description: ElasticsearchRefs is a reference to a list of
monitoring Elasticsearch clusters running in the same Kubernetes
cluster. Due to existing limitations, only a single Elasticsearch
cluster is currently supported.
items:
description: ObjectSelector defines a reference to a Kubernetes
object which can be an Elastic resource managed by the
operator or a Secret describing an external Elastic resource
not managed by the operator.
properties:
name:
description: Name of an existing Kubernetes object corresponding
to an Elastic resource managed by ECK.
type: string
namespace:
description: Namespace of the Kubernetes object. If
empty, defaults to the current namespace.
type: string
secretName:
description: 'SecretName is the name of an existing
Kubernetes secret that contains connection information
for associating an Elastic resource not managed by
the operator. The referenced secret must contain the
following: - `url`: the URL to reach the Elastic resource
- `username`: the username of the user to be authenticated
to the Elastic resource - `password`: the password
of the user to be authenticated to the Elastic resource
- `ca.crt`: the CA certificate in PEM format (optional).
This field cannot be used in combination with the
other fields name, namespace or serviceName.'
type: string
serviceName:
description: ServiceName is the name of an existing
Kubernetes service which is used to make requests
to the referenced object. It has to be in the same
namespace as the referenced resource. If left empty,
the default HTTP service of the referenced resource
is used.
type: string
type: object
type: array
type: object
metrics:
description: Metrics holds references to Elasticsearch clusters
which receive monitoring data from this resource.
properties:
elasticsearchRefs:
description: ElasticsearchRefs is a reference to a list of
monitoring Elasticsearch clusters running in the same Kubernetes
cluster. Due to existing limitations, only a single Elasticsearch
cluster is currently supported.
items:
description: ObjectSelector defines a reference to a Kubernetes
object which can be an Elastic resource managed by the
operator or a Secret describing an external Elastic resource
not managed by the operator.
properties:
name:
description: Name of an existing Kubernetes object corresponding
to an Elastic resource managed by ECK.
type: string
namespace:
description: Namespace of the Kubernetes object. If
empty, defaults to the current namespace.
type: string
secretName:
description: 'SecretName is the name of an existing
Kubernetes secret that contains connection information
for associating an Elastic resource not managed by
the operator. The referenced secret must contain the
following: - `url`: the URL to reach the Elastic resource
- `username`: the username of the user to be authenticated
to the Elastic resource - `password`: the password
of the user to be authenticated to the Elastic resource
- `ca.crt`: the CA certificate in PEM format (optional).
This field cannot be used in combination with the
other fields name, namespace or serviceName.'
type: string
serviceName:
description: ServiceName is the name of an existing
Kubernetes service which is used to make requests
to the referenced object. It has to be in the same
namespace as the referenced resource. If left empty,
the default HTTP service of the referenced resource
is used.
type: string
type: object
type: array
type: object
type: object
podTemplate:
description: PodTemplate provides customisation options for the Logstash
pods.
Expand Down Expand Up @@ -9629,6 +9731,13 @@ spec:
expectedNodes:
format: int32
type: integer
monitoringAssociationStatus:
additionalProperties:
description: AssociationStatus is the status of an association resource.
type: string
description: MonitoringAssociationStatus is the status of any auto-linking
to monitoring Elasticsearch clusters.
type: object
observedGeneration:
description: ObservedGeneration is the most recent generation observed
for this Logstash instance. It corresponds to the metadata generation,
Expand Down
109 changes: 109 additions & 0 deletions config/crds/v1/bases/logstash.k8s.elastic.co_logstashes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,108 @@ spec:
description: Image is the Logstash Docker image to deploy. Version
and Type have to match the Logstash in the image.
type: string
monitoring:
description: Monitoring enables you to collect and ship log and monitoring
data of this Logstash. Metricbeat and Filebeat are deployed in the
same Pod as sidecars and each one sends data to one or two different
Elasticsearch monitoring clusters running in the same Kubernetes
cluster.
properties:
logs:
description: Logs holds references to Elasticsearch clusters which
receive log data from an associated resource.
properties:
elasticsearchRefs:
description: ElasticsearchRefs is a reference to a list of
monitoring Elasticsearch clusters running in the same Kubernetes
cluster. Due to existing limitations, only a single Elasticsearch
cluster is currently supported.
items:
description: ObjectSelector defines a reference to a Kubernetes
object which can be an Elastic resource managed by the
operator or a Secret describing an external Elastic resource
not managed by the operator.
properties:
name:
description: Name of an existing Kubernetes object corresponding
to an Elastic resource managed by ECK.
type: string
namespace:
description: Namespace of the Kubernetes object. If
empty, defaults to the current namespace.
type: string
secretName:
description: 'SecretName is the name of an existing
Kubernetes secret that contains connection information
for associating an Elastic resource not managed by
the operator. The referenced secret must contain the
following: - `url`: the URL to reach the Elastic resource
- `username`: the username of the user to be authenticated
to the Elastic resource - `password`: the password
of the user to be authenticated to the Elastic resource
- `ca.crt`: the CA certificate in PEM format (optional).
This field cannot be used in combination with the
other fields name, namespace or serviceName.'
type: string
serviceName:
description: ServiceName is the name of an existing
Kubernetes service which is used to make requests
to the referenced object. It has to be in the same
namespace as the referenced resource. If left empty,
the default HTTP service of the referenced resource
is used.
type: string
type: object
type: array
type: object
metrics:
description: Metrics holds references to Elasticsearch clusters
which receive monitoring data from this resource.
properties:
elasticsearchRefs:
description: ElasticsearchRefs is a reference to a list of
monitoring Elasticsearch clusters running in the same Kubernetes
cluster. Due to existing limitations, only a single Elasticsearch
cluster is currently supported.
items:
description: ObjectSelector defines a reference to a Kubernetes
object which can be an Elastic resource managed by the
operator or a Secret describing an external Elastic resource
not managed by the operator.
properties:
name:
description: Name of an existing Kubernetes object corresponding
to an Elastic resource managed by ECK.
type: string
namespace:
description: Namespace of the Kubernetes object. If
empty, defaults to the current namespace.
type: string
secretName:
description: 'SecretName is the name of an existing
Kubernetes secret that contains connection information
for associating an Elastic resource not managed by
the operator. The referenced secret must contain the
following: - `url`: the URL to reach the Elastic resource
- `username`: the username of the user to be authenticated
to the Elastic resource - `password`: the password
of the user to be authenticated to the Elastic resource
- `ca.crt`: the CA certificate in PEM format (optional).
This field cannot be used in combination with the
other fields name, namespace or serviceName.'
type: string
serviceName:
description: ServiceName is the name of an existing
Kubernetes service which is used to make requests
to the referenced object. It has to be in the same
namespace as the referenced resource. If left empty,
the default HTTP service of the referenced resource
is used.
type: string
type: object
type: array
type: object
type: object
podTemplate:
description: PodTemplate provides customisation options for the Logstash
pods.
Expand Down Expand Up @@ -7992,6 +8094,13 @@ spec:
expectedNodes:
format: int32
type: integer
monitoringAssociationStatus:
additionalProperties:
description: AssociationStatus is the status of an association resource.
type: string
description: MonitoringAssociationStatus is the status of any auto-linking
to monitoring Elasticsearch clusters.
type: object
observedGeneration:
description: ObservedGeneration is the most recent generation observed
for this Logstash instance. It corresponds to the metadata generation,
Expand Down
46 changes: 46 additions & 0 deletions config/samples/logstash/logstash_stackmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: monitoring
spec:
version: 8.6.1
nodeSets:
- name: default
count: 1
config:
node.store.allow_mmap: false
---
apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
name: logstash-sample
spec:
count: 1
version: 8.7.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Currently, this causes the TestSample e2e test to fail, due to the lack of 8.7.0 docker image for logstash

config:
log.level: info
api.http.host: "0.0.0.0"
queue.type: memory
podTemplate:
spec:
containers:
- name: logstash
monitoring:
metrics:
elasticsearchRefs:
- name: monitoring
logs:
elasticsearchRefs:
- name: monitoring
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana-sample
spec:
version: 8.6.1
elasticsearchRef:
name: monitoring
count: 1
---
Loading