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

Logstash add ElasticsearchRefs #6662

Merged
merged 35 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fb72c22
add multiple elasticsearch refs
kaisecheng Mar 15, 2023
2386409
fix test
kaisecheng Apr 5, 2023
a61d136
add validation
kaisecheng Apr 5, 2023
a760d82
add unit tests and update e2e
kaisecheng Apr 6, 2023
113518d
Merge remote-tracking branch 'upstream/feature/logstash' into logstas…
kaisecheng Apr 6, 2023
a538805
merge pipelines
kaisecheng Apr 6, 2023
06892f0
add env test
kaisecheng Apr 6, 2023
68ac14e
add es-output e2e
kaisecheng Apr 6, 2023
7380323
add logstash user to association
kaisecheng Apr 11, 2023
d1b185d
Merge remote-tracking branch 'upstream/feature/logstash' into logstas…
kaisecheng Apr 12, 2023
3b9608b
merge test
kaisecheng Apr 12, 2023
ed24d91
fix generate
kaisecheng Apr 12, 2023
de74b4f
fix roles test
kaisecheng Apr 12, 2023
e727f71
clean up
kaisecheng Apr 13, 2023
6eec1c9
fix index role
kaisecheng Apr 14, 2023
7303cd6
Update pkg/apis/logstash/v1alpha1/logstash_types.go
kaisecheng Apr 17, 2023
85a5527
Update pkg/controller/logstash/env.go
kaisecheng Apr 17, 2023
f9f18b6
Update pkg/apis/logstash/v1alpha1/logstash_types.go
kaisecheng Apr 17, 2023
35ad1fe
ref connection setting from secret
kaisecheng Apr 17, 2023
0971e96
fix generate
kaisecheng Apr 17, 2023
cede486
import format
kaisecheng Apr 21, 2023
65a57a6
Update pkg/controller/logstash/pod.go
kaisecheng Apr 21, 2023
0724deb
Merge branch 'logstash_esrefs' of github.com:kaisecheng/cloud-on-k8s …
kaisecheng Apr 21, 2023
af3b4d0
Merge branch 'feature/logstash' of github.com:elastic/cloud-on-k8s in…
kaisecheng Apr 21, 2023
3d91ff3
fix test
kaisecheng Apr 21, 2023
899b095
- add clusterName
kaisecheng Apr 22, 2023
258b690
Update pkg/apis/logstash/v1alpha1/validations.go
kaisecheng Apr 24, 2023
90f893b
Update pkg/apis/logstash/v1alpha1/validations_test.go
kaisecheng Apr 24, 2023
51a953a
Update pkg/apis/logstash/v1alpha1/validations_test.go
kaisecheng Apr 24, 2023
3304bd7
Update pkg/apis/logstash/v1alpha1/validations_test.go
kaisecheng Apr 24, 2023
94c07c1
change env var from USERNAME to USER
kaisecheng Apr 25, 2023
3c4c5f9
Update pkg/apis/logstash/v1alpha1/logstash_types.go
kaisecheng Apr 26, 2023
ae0df6e
Update pkg/apis/logstash/v1alpha1/logstash_types.go
kaisecheng Apr 26, 2023
36b1182
Update pkg/apis/logstash/v1alpha1/validations.go
kaisecheng Apr 26, 2023
eda38a5
fix generate
kaisecheng Apr 26, 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
1 change: 1 addition & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ func registerControllers(mgr manager.Manager, params operator.Parameters, access
{name: "AGENT-KB", registerFunc: associationctl.AddAgentKibana},
{name: "AGENT-FS", registerFunc: associationctl.AddAgentFleetServer},
{name: "EMS-ES", registerFunc: associationctl.AddMapsES},
{name: "LOGSTASH-ES", registerFunc: associationctl.AddLogstashES},
{name: "ES-MONITORING", registerFunc: associationctl.AddEsMonitoring},
{name: "KB-MONITORING", registerFunc: associationctl.AddKbMonitoring},
{name: "BEAT-MONITORING", registerFunc: associationctl.AddBeatMonitoring},
Expand Down
45 changes: 45 additions & 0 deletions config/crds/v1/all-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9119,6 +9119,44 @@ spec:
count:
format: int32
type: integer
elasticsearchRefs:
description: ElasticsearchRefs are references to Elasticsearch clusters
running in the same Kubernetes cluster.
items:
description: ElasticsearchCluster definition of type to define an
Elasticsearch Cluster to be referred to in Logstash pipeline
properties:
clusterName:
type: string
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
image:
description: Image is the Logstash Docker image to deploy. Version
and Type have to match the Logstash in the image.
Expand Down Expand Up @@ -9747,6 +9785,13 @@ spec:
availableNodes:
format: int32
type: integer
elasticsearchAssociationsStatus:
additionalProperties:
description: AssociationStatus is the status of an association resource.
type: string
description: ElasticsearchAssociationStatus is the status of any auto-linking
to Elasticsearch clusters.
type: object
expectedNodes:
format: int32
type: integer
Expand Down
45 changes: 45 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 @@ -73,6 +73,44 @@ spec:
count:
format: int32
type: integer
elasticsearchRefs:
description: ElasticsearchRefs are references to Elasticsearch clusters
running in the same Kubernetes cluster.
items:
description: ElasticsearchCluster definition of type to define an
Elasticsearch Cluster to be referred to in Logstash pipeline
properties:
clusterName:
type: string
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
image:
description: Image is the Logstash Docker image to deploy. Version
and Type have to match the Logstash in the image.
Expand Down Expand Up @@ -8112,6 +8150,13 @@ spec:
availableNodes:
format: int32
type: integer
elasticsearchAssociationsStatus:
additionalProperties:
description: AssociationStatus is the status of an association resource.
type: string
description: ElasticsearchAssociationStatus is the status of any auto-linking
to Elasticsearch clusters.
type: object
expectedNodes:
format: int32
type: integer
Expand Down
37 changes: 37 additions & 0 deletions config/samples/logstash/logstash_es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch-sample
spec:
version: 8.7.0
nodeSets:
- name: default
count: 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it 2 nodes to have primary/replicas allocated?

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
elasticsearchRefs:
- clusterName: production
name: elasticsearch-sample
# secretName: external-cloud-es-ref
pipelines:
- pipeline.id: main
config.string: |
input { exec { command => 'uptime' interval => 10 } }
output {
elasticsearch {
hosts => [ "${PRODUCTION_ES_HOSTS}" ]
ssl => true
cacert => "${PRODUCTION_ES_SSL_CERTIFICATE_AUTHORITY}"
user => "${PRODUCTION_ES_USER}"
password => "${PRODUCTION_ES_PASSWORD}"
}
}
---
Original file line number Diff line number Diff line change
Expand Up @@ -9173,6 +9173,44 @@ spec:
count:
format: int32
type: integer
elasticsearchRefs:
description: ElasticsearchRefs are references to Elasticsearch clusters
running in the same Kubernetes cluster.
items:
description: ElasticsearchCluster definition of type to define an
Elasticsearch Cluster to be referred to in Logstash pipeline
properties:
clusterName:
type: string
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
image:
description: Image is the Logstash Docker image to deploy. Version
and Type have to match the Logstash in the image.
Expand Down Expand Up @@ -9801,6 +9839,13 @@ spec:
availableNodes:
format: int32
type: integer
elasticsearchAssociationsStatus:
additionalProperties:
description: AssociationStatus is the status of an association resource.
type: string
description: ElasticsearchAssociationStatus is the status of any auto-linking
to Elasticsearch clusters.
type: object
expectedNodes:
format: int32
type: integer
Expand Down
20 changes: 20 additions & 0 deletions docs/reference/api-docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ ObjectSelector defines a reference to a Kubernetes object which can be an Elasti
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-agent-v1alpha1-agentspec[$$AgentSpec$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-apm-v1-apmserverspec[$$ApmServerSpec$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-beat-v1beta1-beatspec[$$BeatSpec$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-logstash-v1alpha1-elasticsearchcluster[$$ElasticsearchCluster$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-enterprisesearch-v1-enterprisesearchspec[$$EnterpriseSearchSpec$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-enterprisesearch-v1beta1-enterprisesearchspec[$$EnterpriseSearchSpec$$]
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-kibana-v1-kibanaspec[$$KibanaSpec$$]
Expand Down Expand Up @@ -1841,6 +1842,24 @@ Package v1alpha1 contains API Schema definitions for the logstash v1alpha1 API g



[id="{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-logstash-v1alpha1-elasticsearchcluster"]
=== ElasticsearchCluster

ElasticsearchCluster definition of type to define an Elasticsearch Cluster to be referred to in Logstash pipeline

.Appears In:
****
- xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-logstash-v1alpha1-logstashspec[$$LogstashSpec$$]
****

[cols="25a,75a", options="header"]
|===
| Field | Description
| *`ObjectSelector`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-objectselector[$$ObjectSelector$$]__ |
| *`clusterName`* __string__ |
|===


[id="{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-logstash-v1alpha1-logstash"]
=== Logstash

Expand Down Expand Up @@ -1895,6 +1914,7 @@ LogstashSpec defines the desired state of Logstash
| *`version`* __string__ | Version of the Logstash.
| *`count`* __integer__ |
| *`image`* __string__ | Image is the Logstash Docker image to deploy. Version and Type have to match the Logstash in the image.
| *`elasticsearchRefs`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-logstash-v1alpha1-elasticsearchcluster[$$ElasticsearchCluster$$] array__ | ElasticsearchRefs are references to Elasticsearch clusters running in the same Kubernetes cluster.
| *`config`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-config[$$Config$$]__ | Config holds the Logstash configuration. At most one of [`Config`, `ConfigRef`] can be specified.
| *`configRef`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-configsource[$$ConfigSource$$]__ | ConfigRef contains a reference to an existing Kubernetes Secret holding the Logstash configuration. Logstash settings must be specified as yaml, under a single "logstash.yml" entry. At most one of [`Config`, `ConfigRef`] can be specified.
| *`pipelines`* __xref:{anchor_prefix}-github-com-elastic-cloud-on-k8s-v2-pkg-apis-common-v1-config[$$Config$$] array__ | Pipelines holds the Logstash Pipelines. At most one of [`Pipelines`, `PipelinesRef`] can be specified.
Expand Down
Loading