From 31b7f6c56129afbb97073a0c65cdc787c8214ada Mon Sep 17 00:00:00 2001 From: Panos Koutsovasilis Date: Fri, 31 Jan 2025 11:18:43 +0200 Subject: [PATCH] [helm]: make system integration enabled by default --- .../examples/eck/rendered/manifest.yaml | 161 +++++++ .../kubernetes-default/rendered/manifest.yaml | 163 ++++++- .../rendered/manifest.yaml | 163 ++++++- .../rendered/manifest.yaml | 163 ++++++- .../rendered/manifest.yaml | 163 ++++++- .../rendered/manifest.yaml | 163 ++++++- .../netflow-service/rendered/manifest.yaml | 416 ++++++++++++++++++ .../rendered/manifest.yaml | 397 +++++++++++++++++ .../user-cluster-role/rendered/manifest.yaml | 397 +++++++++++++++++ .../rendered/manifest.yaml | 163 ++++++- deploy/helm/elastic-agent/values.yaml | 2 +- 11 files changed, 2344 insertions(+), 7 deletions(-) diff --git a/deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml index 0a94afa4690..eab684fdaec 100644 --- a/deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml @@ -458,6 +458,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default --- # Source: elastic-agent/charts/kube-state-metrics/templates/role.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -1021,6 +1158,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true dnsPolicy: ClusterFirstWithHostNet hostNetwork: true nodeSelector: @@ -1033,6 +1182,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib --- # Source: elastic-agent/templates/agent/eck/deployment.yaml apiVersion: agent.k8s.elastic.co/v1alpha1 diff --git a/deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml index d5c609a4c2b..745057df46a 100644 --- a/deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/kubernetes-default/rendered/manifest.yaml @@ -457,6 +457,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: node: ${NODE_NAME} @@ -888,7 +1025,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: 233affcd72143e637a130b5f099c30e194d90042eb00a26512f51c844c65a821 + checksum/config: 26f667cc0334e1c6b1a436cdef1c6be537b68c6de364ac0cdaefe1f763087779 spec: automountServiceAccountToken: true containers: @@ -937,6 +1074,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -955,6 +1104,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml index 87beb58f128..081e9ea538f 100644 --- a/deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/kubernetes-hints-autodiscover/rendered/manifest.yaml @@ -457,6 +457,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: hints: @@ -891,7 +1028,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: daca0d998edb3afa587d96e69b0833f6919ca6ba72f58f3a1f83b22d7e5ffaf6 + checksum/config: 2b949a509d5a2ed509afb45d734085c84ce7172a80f3062dfab5c608bd80f00c spec: automountServiceAccountToken: true containers: @@ -940,6 +1077,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -958,6 +1107,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/examples/kubernetes-ksm-sharding/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/kubernetes-ksm-sharding/rendered/manifest.yaml index 1993d07a8ef..e0a8c2eb0bd 100644 --- a/deploy/helm/elastic-agent/examples/kubernetes-ksm-sharding/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/kubernetes-ksm-sharding/rendered/manifest.yaml @@ -269,6 +269,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: node: ${NODE_NAME} @@ -949,7 +1086,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: 05797fdfdd3cdeefb99e39e0f4756a6b812465509b31195ff57ae3925aa5e087 + checksum/config: fb92c66cf35b3941e9726388d837f59c302940f467a8cbfbfd8d949fb2effa1d spec: automountServiceAccountToken: true containers: @@ -1008,6 +1145,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -1026,6 +1175,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml index 599b020ad40..7ffd2e58928 100644 --- a/deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/kubernetes-only-logs/rendered/manifest.yaml @@ -96,6 +96,143 @@ stringData: prospector.scanner.symlinks: true type: filestream use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: node: ${NODE_NAME} @@ -223,7 +360,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: 0840dcdf026f64cefb7aa69f420bc923d7e2d7d6e9a239e107fd2684e309d8ae + checksum/config: 4aa1b26569a43f5ae1f8ae9c58a0e294391854c3b3bb36ce35e91ea065f874ee spec: automountServiceAccountToken: true containers: @@ -272,6 +409,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -290,6 +439,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml index 1acea05f377..0f8b7c3b71b 100644 --- a/deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/multiple-integrations/rendered/manifest.yaml @@ -483,6 +483,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: hints: @@ -917,7 +1054,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: daca0d998edb3afa587d96e69b0833f6919ca6ba72f58f3a1f83b22d7e5ffaf6 + checksum/config: 2b949a509d5a2ed509afb45d734085c84ce7172a80f3062dfab5c608bd80f00c spec: automountServiceAccountToken: true containers: @@ -956,6 +1093,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -974,6 +1123,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/examples/netflow-service/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/netflow-service/rendered/manifest.yaml index b768f25fd14..383d68f7a57 100644 --- a/deploy/helm/elastic-agent/examples/netflow-service/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/netflow-service/rendered/manifest.yaml @@ -1,4 +1,16 @@ --- +# Source: elastic-agent/templates/agent/service-account.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +--- # Source: elastic-agent/templates/agent/k8s/secret.yaml apiVersion: v1 kind: Secret @@ -62,6 +74,280 @@ stringData: enabled: false leader_lease: example-netflow --- +# Source: elastic-agent/templates/agent/k8s/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +stringData: + + agent.yml: |- + id: agent-pernode-example + outputs: + default: + api_key: ${OUTPUT_DEFAULT_API_KEY} + hosts: + - ${OUTPUT_DEFAULT_URL} + type: elasticsearch + secret_references: [] + agent: + monitoring: + enabled: true + logs: true + metrics: true + namespace: default + use_output: default + inputs: + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default + providers: + kubernetes: + node: ${NODE_NAME} + scope: node + kubernetes_leaderelection: + enabled: false + leader_lease: example-pernode +--- +# Source: elastic-agent/templates/agent/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +rules: + - apiGroups: [ "" ] # "" indicates the core API group + resources: + - nodes + - namespaces + - events + - pods + - services + - configmaps + - persistentvolumes + - persistentvolumeclaims + - persistentvolumeclaims/status + - nodes/metrics + - nodes/proxy + - nodes/stats + verbs: + - get + - watch + - list + - apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - watch + - list + - nonResourceURLs: + - /metrics + verbs: + - get + - watch + - list + - apiGroups: [ "coordination.k8s.io" ] + resources: + - leases + verbs: + - get + - create + - update + - nonResourceURLs: + - /healthz + - /healthz/* + - /livez + - /livez/* + - /metrics + - /metrics/slis + - /readyz + - /readyz/* + verbs: + - get + - apiGroups: [ "apps" ] + resources: + - replicasets + - deployments + - daemonsets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: [ "batch" ] + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch +--- +# Source: elastic-agent/templates/agent/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +subjects: + - kind: ServiceAccount + name: agent-pernode-example + namespace: "default" +roleRef: + kind: ClusterRole + name: agent-perNode-example-default + apiGroup: rbac.authorization.k8s.io +--- # Source: elastic-agent/templates/agent/service.yaml apiVersion: v1 kind: Service @@ -82,6 +368,136 @@ spec: targetPort: 2055 protocol: UDP --- +# Source: elastic-agent/templates/agent/k8s/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +spec: + selector: + matchLabels: + name: agent-pernode-example + template: + metadata: + labels: + name: agent-pernode-example + annotations: + checksum/config: 4e490039a8c7cd1183e1446f980d44aa64a1fd0f77af0d821d463675b7c6340b + spec: + automountServiceAccountToken: true + containers: + - args: + - -c + - /etc/elastic-agent/agent.yml + - -e + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STATE_PATH + value: /usr/share/elastic-agent/state + - name: ELASTIC_NETINFO + value: "false" + - name: OUTPUT_DEFAULT_URL + valueFrom: + secretKeyRef: + key: url + name: es-api-secret + - name: OUTPUT_DEFAULT_API_KEY + valueFrom: + secretKeyRef: + key: api_key + name: es-api-secret + image: docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT + imagePullPolicy: IfNotPresent + name: agent + resources: + limits: + memory: 1000Mi + requests: + cpu: 100m + memory: 400Mi + securityContext: + capabilities: + add: + - DAC_READ_SEARCH + - CHOWN + - SETPCAP + - SYS_PTRACE + drop: + - ALL + privileged: false + runAsGroup: 1000 + runAsUser: 1000 + volumeMounts: + - mountPath: /var/lib/docker/containers + name: varlibdockercontainers + readOnly: true + - mountPath: /var/log + name: varlog + readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true + - mountPath: /usr/share/elastic-agent/state + name: agent-data + - mountPath: /etc/elastic-agent/agent.yml + name: config + readOnly: true + subPath: agent.yml + dnsPolicy: ClusterFirstWithHostNet + hostNetwork: true + nodeSelector: + kubernetes.io/os: linux + serviceAccountName: agent-pernode-example + volumes: + - hostPath: + path: /var/lib/docker/containers + name: varlibdockercontainers + - hostPath: + path: /var/log + name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib + - hostPath: + path: /etc/elastic-agent/default/agent-pernode-example/state + type: DirectoryOrCreate + name: agent-data + - name: config + secret: + defaultMode: 292 + secretName: agent-pernode-example +--- # Source: elastic-agent/templates/agent/k8s/deployment.yaml apiVersion: apps/v1 kind: Deployment diff --git a/deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml index 1654f966cc8..d3fe02f9e7c 100644 --- a/deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/nginx-custom-integration/rendered/manifest.yaml @@ -1,4 +1,16 @@ --- +# Source: elastic-agent/templates/agent/service-account.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +--- # Source: elastic-agent/templates/agent/k8s/secret.yaml apiVersion: v1 kind: Secret @@ -54,6 +66,391 @@ stringData: enabled: false leader_lease: example-nginx --- +# Source: elastic-agent/templates/agent/k8s/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +stringData: + + agent.yml: |- + id: agent-pernode-example + outputs: + default: + hosts: + - http://elasticsearch:9200 + password: changeme + type: elasticsearch + username: elastic + secret_references: [] + agent: + monitoring: + enabled: true + logs: true + metrics: true + namespace: default + use_output: default + inputs: + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default + providers: + kubernetes: + node: ${NODE_NAME} + scope: node + kubernetes_leaderelection: + enabled: false + leader_lease: example-pernode +--- +# Source: elastic-agent/templates/agent/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +rules: + - apiGroups: [ "" ] # "" indicates the core API group + resources: + - nodes + - namespaces + - events + - pods + - services + - configmaps + - persistentvolumes + - persistentvolumeclaims + - persistentvolumeclaims/status + - nodes/metrics + - nodes/proxy + - nodes/stats + verbs: + - get + - watch + - list + - apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - watch + - list + - nonResourceURLs: + - /metrics + verbs: + - get + - watch + - list + - apiGroups: [ "coordination.k8s.io" ] + resources: + - leases + verbs: + - get + - create + - update + - nonResourceURLs: + - /healthz + - /healthz/* + - /livez + - /livez/* + - /metrics + - /metrics/slis + - /readyz + - /readyz/* + verbs: + - get + - apiGroups: [ "apps" ] + resources: + - replicasets + - deployments + - daemonsets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: [ "batch" ] + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch +--- +# Source: elastic-agent/templates/agent/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +subjects: + - kind: ServiceAccount + name: agent-pernode-example + namespace: "default" +roleRef: + kind: ClusterRole + name: agent-perNode-example-default + apiGroup: rbac.authorization.k8s.io +--- +# Source: elastic-agent/templates/agent/k8s/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +spec: + selector: + matchLabels: + name: agent-pernode-example + template: + metadata: + labels: + name: agent-pernode-example + annotations: + checksum/config: a9cbb6addaad84ed61b7ac945e0711230e62d8e82840a5537bed64810dfcef30 + spec: + automountServiceAccountToken: true + containers: + - args: + - -c + - /etc/elastic-agent/agent.yml + - -e + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STATE_PATH + value: /usr/share/elastic-agent/state + - name: ELASTIC_NETINFO + value: "false" + image: docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT + imagePullPolicy: IfNotPresent + name: agent + resources: + limits: + memory: 1000Mi + requests: + cpu: 100m + memory: 400Mi + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/lib/docker/containers + name: varlibdockercontainers + readOnly: true + - mountPath: /var/log + name: varlog + readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true + - mountPath: /usr/share/elastic-agent/state + name: agent-data + - mountPath: /etc/elastic-agent/agent.yml + name: config + readOnly: true + subPath: agent.yml + dnsPolicy: ClusterFirstWithHostNet + hostNetwork: true + nodeSelector: + kubernetes.io/os: linux + serviceAccountName: agent-pernode-example + volumes: + - hostPath: + path: /var/lib/docker/containers + name: varlibdockercontainers + - hostPath: + path: /var/log + name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib + - hostPath: + path: /etc/elastic-agent/default/agent-pernode-example/state + type: DirectoryOrCreate + name: agent-data + - name: config + secret: + defaultMode: 292 + secretName: agent-pernode-example +--- # Source: elastic-agent/templates/agent/k8s/deployment.yaml apiVersion: apps/v1 kind: Deployment diff --git a/deploy/helm/elastic-agent/examples/user-cluster-role/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/user-cluster-role/rendered/manifest.yaml index c878dcd71aa..f1bb998c172 100644 --- a/deploy/helm/elastic-agent/examples/user-cluster-role/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/user-cluster-role/rendered/manifest.yaml @@ -14,6 +14,18 @@ metadata: elastic-agent.k8s.elastic.co/preset: nginx elastic-agent.k8s.elastic.co/sa: nginx --- +# Source: elastic-agent/templates/agent/service-account.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +--- # Source: elastic-agent/templates/agent/k8s/secret.yaml apiVersion: v1 kind: Secret @@ -71,6 +83,262 @@ stringData: enabled: false leader_lease: example-nginx --- +# Source: elastic-agent/templates/agent/k8s/secret.yaml +apiVersion: v1 +kind: Secret +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +stringData: + + agent.yml: |- + id: agent-pernode-example + outputs: + default: + hosts: + - http://elasticsearch:9200 + password: changeme + type: elasticsearch + username: elastic + secret_references: [] + agent: + monitoring: + enabled: true + logs: true + metrics: true + namespace: default + use_output: default + inputs: + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default + providers: + kubernetes: + node: ${NODE_NAME} + scope: node + kubernetes_leaderelection: + enabled: false + leader_lease: example-pernode +--- +# Source: elastic-agent/templates/agent/cluster-role.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +rules: + - apiGroups: [ "" ] # "" indicates the core API group + resources: + - nodes + - namespaces + - events + - pods + - services + - configmaps + - persistentvolumes + - persistentvolumeclaims + - persistentvolumeclaims/status + - nodes/metrics + - nodes/proxy + - nodes/stats + verbs: + - get + - watch + - list + - apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - watch + - list + - nonResourceURLs: + - /metrics + verbs: + - get + - watch + - list + - apiGroups: [ "coordination.k8s.io" ] + resources: + - leases + verbs: + - get + - create + - update + - nonResourceURLs: + - /healthz + - /healthz/* + - /livez + - /livez/* + - /metrics + - /metrics/slis + - /readyz + - /readyz/* + verbs: + - get + - apiGroups: [ "apps" ] + resources: + - replicasets + - deployments + - daemonsets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: [ "batch" ] + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch +--- # Source: elastic-agent/templates/agent/cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -92,6 +360,135 @@ roleRef: name: user-cr apiGroup: rbac.authorization.k8s.io --- +# Source: elastic-agent/templates/agent/cluster-role-binding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: agent-perNode-example-default + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +subjects: + - kind: ServiceAccount + name: agent-pernode-example + namespace: "default" +roleRef: + kind: ClusterRole + name: agent-perNode-example-default + apiGroup: rbac.authorization.k8s.io +--- +# Source: elastic-agent/templates/agent/k8s/daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: agent-pernode-example + namespace: "default" + labels: + helm.sh/chart: elastic-agent-9.0.0-beta + app.kubernetes.io/name: elastic-agent + app.kubernetes.io/instance: example + app.kubernetes.io/version: 9.0.0 +spec: + selector: + matchLabels: + name: agent-pernode-example + template: + metadata: + labels: + name: agent-pernode-example + annotations: + checksum/config: a9cbb6addaad84ed61b7ac945e0711230e62d8e82840a5537bed64810dfcef30 + spec: + automountServiceAccountToken: true + containers: + - args: + - -c + - /etc/elastic-agent/agent.yml + - -e + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STATE_PATH + value: /usr/share/elastic-agent/state + - name: ELASTIC_NETINFO + value: "false" + image: docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT + imagePullPolicy: IfNotPresent + name: agent + resources: + limits: + memory: 1000Mi + requests: + cpu: 100m + memory: 400Mi + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/lib/docker/containers + name: varlibdockercontainers + readOnly: true + - mountPath: /var/log + name: varlog + readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true + - mountPath: /usr/share/elastic-agent/state + name: agent-data + - mountPath: /etc/elastic-agent/agent.yml + name: config + readOnly: true + subPath: agent.yml + dnsPolicy: ClusterFirstWithHostNet + hostNetwork: true + nodeSelector: + kubernetes.io/os: linux + serviceAccountName: agent-pernode-example + volumes: + - hostPath: + path: /var/lib/docker/containers + name: varlibdockercontainers + - hostPath: + path: /var/log + name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib + - hostPath: + path: /etc/elastic-agent/default/agent-pernode-example/state + type: DirectoryOrCreate + name: agent-data + - name: config + secret: + defaultMode: 292 + secretName: agent-pernode-example +--- # Source: elastic-agent/templates/agent/k8s/deployment.yaml apiVersion: apps/v1 kind: Deployment diff --git a/deploy/helm/elastic-agent/examples/user-service-account/rendered/manifest.yaml b/deploy/helm/elastic-agent/examples/user-service-account/rendered/manifest.yaml index 46f2be3a360..15fbde4dc93 100644 --- a/deploy/helm/elastic-agent/examples/user-service-account/rendered/manifest.yaml +++ b/deploy/helm/elastic-agent/examples/user-service-account/rendered/manifest.yaml @@ -433,6 +433,143 @@ stringData: ssl.verification_mode: none type: kubernetes/metrics use_output: default + - data_stream: + namespace: default + id: system-logs + streams: + - data_stream: + dataset: system.auth + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/auth.log* + - /var/log/secure* + processors: + - add_locale: null + tags: + - system-auth + - data_stream: + dataset: system.syslog + type: logs + exclude_files: + - \.gz$ + ignore_older: 72h + multiline: + match: after + pattern: ^\s + paths: + - /var/log/messages* + - /var/log/syslog* + - /var/log/system* + processors: + - add_locale: null + tags: null + type: logfile + use_output: default + - data_stream: + namespace: default + id: system-metrics + streams: + - cpu.metrics: + - percentages + - normalized_percentages + data_stream: + dataset: system.cpu + type: metrics + metricsets: + - cpu + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.diskio + type: metrics + diskio.include_devices: null + metricsets: + - diskio + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.filesystem + type: metrics + metricsets: + - filesystem + period: 1m + processors: + - drop_event.when.regexp: + system.filesystem.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - data_stream: + dataset: system.fsstat + type: metrics + metricsets: + - fsstat + period: 1m + processors: + - drop_event.when.regexp: + system.fsstat.mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib|snap)($|/) + system.hostfs: /hostfs + - condition: ${host.platform} != 'windows' + data_stream: + dataset: system.load + type: metrics + metricsets: + - load + period: 10s + - data_stream: + dataset: system.memory + type: metrics + metricsets: + - memory + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.network + type: metrics + metricsets: + - network + network.interfaces: null + period: 10s + - data_stream: + dataset: system.process + type: metrics + metricsets: + - process + period: 10s + process.cgroups.enabled: false + process.cmdline.cache.enabled: true + process.include_cpu_ticks: false + process.include_top_n.by_cpu: 5 + process.include_top_n.by_memory: 5 + processes: + - .* + system.hostfs: /hostfs + - data_stream: + dataset: system.process_summary + type: metrics + metricsets: + - process_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.socket_summary + type: metrics + metricsets: + - socket_summary + period: 10s + system.hostfs: /hostfs + - data_stream: + dataset: system.uptime + type: metrics + metricsets: + - uptime + period: 10s + type: system/metrics + use_output: default providers: kubernetes: node: ${NODE_NAME} @@ -868,7 +1005,7 @@ spec: labels: name: agent-pernode-example annotations: - checksum/config: 233affcd72143e637a130b5f099c30e194d90042eb00a26512f51c844c65a821 + checksum/config: 26f667cc0334e1c6b1a436cdef1c6be537b68c6de364ac0cdaefe1f763087779 spec: automountServiceAccountToken: true containers: @@ -917,6 +1054,18 @@ spec: - mountPath: /var/log name: varlog readOnly: true + - mountPath: /hostfs/proc + name: proc + readOnly: true + - mountPath: /hostfs/sys/fs/cgroup + name: cgroup + readOnly: true + - mountPath: /hostfs/var/lib + name: var-lib + readOnly: true + - mountPath: /hostfs/etc + name: etc-full + readOnly: true - mountPath: /usr/share/elastic-agent/state name: agent-data - mountPath: /etc/elastic-agent/agent.yml @@ -935,6 +1084,18 @@ spec: - hostPath: path: /var/log name: varlog + - hostPath: + path: /proc + name: proc + - hostPath: + path: /sys/fs/cgroup + name: cgroup + - hostPath: + path: /etc + name: etc-full + - hostPath: + path: /var/lib + name: var-lib - hostPath: path: /etc/elastic-agent/default/agent-pernode-example/state type: DirectoryOrCreate diff --git a/deploy/helm/elastic-agent/values.yaml b/deploy/helm/elastic-agent/values.yaml index 9f523542a25..0ce3ad7dc39 100644 --- a/deploy/helm/elastic-agent/values.yaml +++ b/deploy/helm/elastic-agent/values.yaml @@ -297,7 +297,7 @@ kubernetes: system: # -- enable System integration. # @section -- 4 - System integration - enabled: false + enabled: true # -- name of the output used in System integration. Note that this output needs to be defined in # [outputs](#1-outputs) # @section -- 4 - System integration