Skip to content

Commit 7f72486

Browse files
committed
[helm/elastic-agent] upgrade helm chart to collect rotated logs
Upgates the elastic-agent helm chart to allow the collection of rotated logs, including the GZIP-compressed logs.
1 parent c63fdcc commit 7f72486

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: upgrade helm chart to collect rotated logs
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; a word indicating the component this changeset affects.
22+
component: helm-chart
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
pr: https://github.com/elastic/elastic-agent/pull/11129
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
issue: https://github.com/elastic/elastic-agent/issues/10889

deploy/helm/elastic-agent/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The chart built-in [kubernetes integration](https://docs.elastic.co/integrations
8787
| kubernetes.containers.state.enabled | bool | `true` | enable containers state stream (kube-state-metrics) [ref](https://www.elastic.co/guide/en/beats/metricbeat/8.11/metricbeat-metricset-kubernetes-state_container.html) |
8888
| kubernetes.containers.state.vars | object | `{}` | containers state stream vars |
8989
| kubernetes.containers.logs.enabled | bool | `true` | enable containers logs stream [ref](https://www.elastic.co/docs/current/integrations/kubernetes/container-logs) |
90+
| kubernetes.containers.logs.rotated_logs | bool | `false` | enable rotated logs ingestion [ref](https://www.elastic.co/docs/reference/integrations/kubernetes/container-logs#ingesting-rotated-container-logs) |
9091
| kubernetes.containers.logs.vars | object | `{}` | containers logs stream vars |
9192
| kubernetes.containers.audit_logs.enabled | bool | `false` | enable containers audit logs stream [ref](https://www.elastic.co/docs/current/integrations/kubernetes/audit-logs) |
9293
| kubernetes.pods.metrics.enabled | bool | `true` | enable pods metric stream (kubelet) [ref](https://www.elastic.co/docs/current/integrations/kubernetes/kubelet#pod) |

deploy/helm/elastic-agent/templates/integrations/_kubernetes/_kubernetes_logs_containers.tpl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ Config input for container logs
1717
namespace: {{ .Values.kubernetes.namespace }}
1818
use_output: {{ .Values.kubernetes.output }}
1919
streams:
20+
{{- if $.Values.kubernetes.containers.logs.rotated_logs }}
21+
- id: kubernetes-container-logs-${kubernetes.pod.uid}-${kubernetes.container.name}
22+
gzip_experimental: true
23+
paths:
24+
- '/var/log/pods/${kubernetes.namespace}_${kubernetes.pod.name}_${kubernetes.pod.uid}/${kubernetes.container.name}/*.log*'
25+
{{ else }}
2026
- id: kubernetes-container-logs-${kubernetes.pod.name}-${kubernetes.container.id}
27+
paths:
28+
- '/var/log/containers/*${kubernetes.container.id}.log'
29+
{{ end }}
2130
data_stream:
2231
dataset: kubernetes.container_logs
2332
type: logs
24-
paths:
25-
- '/var/log/containers/*${kubernetes.container.id}.log'
2633
prospector.scanner.symlinks: {{ dig "vars" "symlinks" true .Values.kubernetes.containers.logs }}
2734
parsers:
2835
- container:

deploy/helm/elastic-agent/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ kubernetes:
151151
# -- enable containers logs stream [ref](https://www.elastic.co/docs/current/integrations/kubernetes/container-logs)
152152
# @section -- 2 - Kubernetes integration
153153
enabled: true
154+
# -- enable rotated logs ingestion [ref](https://www.elastic.co/docs/reference/integrations/kubernetes/container-logs#ingesting-rotated-container-logs)
155+
rotated_logs: false
154156
# -- containers logs stream vars
155157
# @section -- 2 - Kubernetes integration
156158
vars: {}

0 commit comments

Comments
 (0)