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

Regex support of add_resource_metadata #834

Merged
merged 27 commits into from
Jan 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b819bf8
adding page for adavnce agent with k8s
gizas Jan 11, 2024
d4befc3
adding kubernetes provider example
gizas Jan 11, 2024
3ff2fda
fxing typos and indentation
gizas Jan 11, 2024
eba0e78
fxing typos and indentation
gizas Jan 11, 2024
908ba5c
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
f6788b4
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
ab41b7c
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
72c6927
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
f9f2752
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
7a19a73
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 11, 2024
2f5fe6f
Update docs/en/ingest-management/elastic-agent/advanced-kubernetes-ma…
gizas Jan 12, 2024
8d89798
udpating code yaml box and adding parameter of manifest
gizas Jan 12, 2024
8976765
updating number in list
gizas Jan 12, 2024
21e3caa
updating number in list and iamge for kibana UI
gizas Jan 12, 2024
712af25
adding initial doc for metadata enrichment
gizas Jan 15, 2024
b4c07b9
adding initial doc for metadata enrichment
gizas Jan 15, 2024
d61c7f6
adding initial doc for metadata enrichment
gizas Jan 15, 2024
18ebcf9
adding examples
gizas Jan 16, 2024
928dcbb
Update docs/en/ingest-management/elastic-agent/configuration/provider…
gizas Jan 22, 2024
416f78f
Update docs/en/ingest-management/processors/processor-add_kubernetes_…
gizas Jan 22, 2024
939a81b
fixing conflicts
gizas Jan 22, 2024
96149ba
fixing conflicts and adding wildcards
gizas Jan 22, 2024
4b206d6
fixing part of add_resource
gizas Jan 22, 2024
ade809f
Fix kubernetes provider documentation (#817)
tetianakravchenko Jan 18, 2024
3f8cc23
squashing
gizas Jan 22, 2024
48c18f7
squashing
gizas Jan 22, 2024
01c9b65
fixing newline
gizas Jan 22, 2024
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
Prev Previous commit
Next Next commit
updating number in list and iamge for kibana UI
gizas committed Jan 12, 2024
commit 21e3caad759cf87eddeb31660ad635d5742fb5fb
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[[advanced-kubernetes-managed-by-fleet]]
= Advanced {agent} configuration managed by {fleet}

:manifest: https://raw.githubusercontent.com/elastic/elastic-agent/{branch}/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
For basic {agent} managed by {fleet} scenarios follow the steps on <<running-on-kubernetes-managed-by-fleet>> page.

For basic {agent} managed by {fleet} scenarios follow the steps in <<running-on-kubernetes-managed-by-fleet>>.

On managed {agent} installations it can be useful to provide the ability to configure more advanced options, such as the configuration of providers during startup. Refer to <<providers>> for more details.
On managed {agent} installations could be useful to provide the ability to configure more advanced options like the configuration of providers during the startup. Refer to <<providers>> for more details.

Following steps demonstrate above scenario:

[discrete]
== Step 1: Download the {agent} manifest

include::run-container-common/download-elastic-agent.asciidoc[]
It is advisable to follow the steps of <<install-fleet-managed-elastic-agent>> with Kubernetes Integration installed in your policy and download the {agent} manifest from Kibana UI

image::images/k8kibanaUI.png[{agent} with K8s Package manifest]

Notes::
Sample manifests can also be found https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml[here]

[discrete]
== Step 2: Create a new configmap

[source,yaml]
.Create a new configmap
. Create a new configmap
------------------------------------------------
apiVersion: v1
kind: ConfigMap
@@ -36,46 +39,27 @@ data:
------------------------------------------------

Notes::
1. The above example demonstrates how to disable the `kubernetes_leaderelection` provider. For alternative scenarios you can follow the same procedure. For example, the following settings configure the `kubernetes` provider metadata enrichment:

[source,yaml]
.Example of configmap for kubernetes provider configuration
------------------------------------------------
apiVersion: v1
kind: ConfigMap
metadata:
name: agent-node-datastreams
namespace: kube-system
labels:
k8s-app: elastic-agent
data:
agent.yml: |-
providers.kubernetes:
add_resource_metadata:
deployment: true
cronjob: true
fleet.enabled: true
fleet.access_token: "<FLEET_ENROLLMENT_TOKEN>"
---
------------------------------------------------

Notes::
2. Find more information about https://www.elastic.co/guide/en/fleet/current/fleet-enrollment-tokens.html[Enrollment Tokens].
1. In the above example the disablement of `kubernetes_leaderelection` provider is demonstrated. Same procedure can be followed for alternative scenarios.
2. Find more information for https://www.elastic.co/guide/en/fleet/current/fleet-enrollment-tokens.html[Enrollment Tokens].

[discrete]
== Step 3: Configure Daemonset

Inside the downloaded manifest, update the Daemonset resource:
Inside the downloaded manifest, update Daemonset resource part:

[source,yaml]
.Update entrypoint
------------------------------------------------
containers:
- name: elastic-agent
image: docker.elastic.co/beats/elastic-agent: <Image Version> #< Change this with the image version of agent
image: docker.elastic.co/beats/elastic-agent: <ImageVersion>
args: ["-c", "/etc/elastic-agent/agent.yml", "-e"]
------------------------------------------------

Notes::
The <ImageVersion> is just a placeholder for the elastic-agent image version that will you will download in your manifest: eg. `image: docker.elastic.co/beats/elastic-agent: 8.11.0`
Important thing is to update your manifest with args details

[source,yaml]
.Add extra Volume Mount
------------------------------------------------
@@ -99,6 +83,6 @@ volumes:
[discrete]
== Important Note

By default the manifests for {agent} managed by {fleet} have `hostNetwork:true`. In order to support multiple installations of {agent}s in the same node you should set `hostNetwork:false`. See this relevant https://github.com/elastic/elastic-agent/tree/main/docs/manifests/hostnetwork[example] as described in https://github.com/elastic/elastic-agent/blob/main/docs/elastic-agent-ksm-sharding.md[{agent} Manifests in order to support Kube-State-Metrics Sharding].
By default the manifests for {agent} managed by {fleet} have `hostNetwork:true`. In order to support multiple installations of {agent}s in the same node you should set `hostNetwork:false`. See relevant https://github.com/elastic/elastic-agent/tree/main/docs/manifests/hostnetwork[example] as described in https://github.com/elastic/elastic-agent/blob/main/docs/elastic-agent-ksm-sharding.md[{agent} Manifests in order to support Kube-State-Metrics Sharding]


Binary file added docs/en/ingest-management/images/k8skibanaUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.