Skip to content

Add K8s-specific files to elastic-agent diagnostics bundle #9103

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e004c99
add pod info
pchila Jul 21, 2025
fbc6db1
Add pod description to k8s diagnostics
pchila Jul 21, 2025
b7a4dd2
move k8s diagnostics to dedicated file
pchila Jul 21, 2025
dd763b6
feat: derive namespace and pod name from payload part in service acco…
pkoutsovasilis Jul 21, 2025
d63ab96
WIP - recursively dump owner refs
pchila Jul 21, 2025
a56a1d3
Add logger to diagnostic hooks and follow owner references
pchila Jul 22, 2025
fffba91
feat: add k8s leases in the diagnostics
pkoutsovasilis Jul 22, 2025
03ba8bd
Add permission to read pods/log to agent clusterrole to enable contai…
pchila Jul 22, 2025
ce267e1
collect agent container logs in diagnostics
pchila Jul 22, 2025
5f03053
Cleanup k8s diagnostic hook
pchila Jul 22, 2025
f07e094
feat: add dumping helm chart archive and values
pkoutsovasilis Jul 22, 2025
03cca3e
chore: fmt
pkoutsovasilis Jul 22, 2025
ec4af9c
Collect cgroup info
pchila Jul 22, 2025
01298ab
feat: add collecting of k8s events for agent pod
pkoutsovasilis Jul 22, 2025
561e59d
feat: replace chart archive with rendered manifest while extracting d…
pkoutsovasilis Jul 23, 2025
a9487d0
fix: don't overwrite diagnosticsAccumulatedError
pkoutsovasilis Jul 23, 2025
3026929
fix: call properly dumpK8sEvents in collectK8sDiagnosticsWithClientAn…
pkoutsovasilis Jul 23, 2025
dd886c6
fix: pass correct paths for helm-manifest.yaml and helm-values.yaml
pkoutsovasilis Jul 23, 2025
9006415
feat(helm): support creation of roles for agent presets
pkoutsovasilis Jul 23, 2025
d866d52
add tests for dumpK8sManifests
pchila Jul 23, 2025
c64d71a
add tests for collectLogsFromPod
pchila Jul 23, 2025
320a874
Fix GlobalHooks unit tests
pchila Jul 23, 2025
67a99f6
Do not create diagnostics file entries for nil []byte
pchila Jul 23, 2025
aa2f208
go mod tidy
pchila Jul 23, 2025
a95d72c
feat: add k8s diagnostics integration tests
pkoutsovasilis Jul 23, 2025
505efae
chore: update notice files
pkoutsovasilis Jul 23, 2025
0ce86c6
add basic cgroup files capture
pchila Jul 23, 2025
d4816c8
add basic tests for error and success k8s diagnostics
pchila Jul 23, 2025
fb426ee
fix: use k8s path constants from k8s diagnostics in integration tests
pkoutsovasilis Jul 23, 2025
0f17d47
Remove linter errors in zip extraction test code
pchila Jul 24, 2025
30b7fb0
fix: allow extra to be defined for preset role and disable its creati…
pkoutsovasilis Jul 28, 2025
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
873 changes: 557 additions & 316 deletions NOTICE-fips.txt

Large diffs are not rendered by default.

873 changes: 557 additions & 316 deletions NOTICE.txt

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions deploy/helm/elastic-agent/examples/eck/rendered/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -748,6 +749,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -977,6 +979,13 @@ spec:
namespace: elastic-system
daemonSet:
podTemplate:
metadata:
labels:
name: agent-pernode-example
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
spec:
automountServiceAccountToken: true
containers:
Expand Down Expand Up @@ -1060,6 +1069,13 @@ spec:
namespace: elastic-system
deployment:
podTemplate:
metadata:
labels:
name: agent-clusterwide-example
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
spec:
automountServiceAccountToken: true
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -395,6 +396,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 509d5f84e4687cb90ad2a381455fde090ef4e6eeb548e789a2de66f441963695
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -373,6 +374,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: cd7c5c4f03cc8377d18ee22cf236428090959fc194ee647bd97a39b79f38c807
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -882,6 +883,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -1018,6 +1020,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: e985ca1d58cc517ae1cfd727bb30a013ebdb6ab103397e87bb1ffa334cf3a360
Expand Down Expand Up @@ -1234,6 +1240,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: 54bb0654f742186393a646bf36b019527a1d3d7fa483bb22ec0d1a6d064bca6e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -750,6 +751,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -886,6 +888,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 233affcd72143e637a130b5f099c30e194d90042eb00a26512f51c844c65a821
Expand Down Expand Up @@ -1067,6 +1073,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: d5c563235f87ab23840416f6679b42b15c094cf361b8794d087b4fdfb8285b4b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -753,6 +754,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -889,6 +891,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: daca0d998edb3afa587d96e69b0833f6919ca6ba72f58f3a1f83b22d7e5ffaf6
Expand Down Expand Up @@ -1070,6 +1076,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: d5c563235f87ab23840416f6679b42b15c094cf361b8794d087b4fdfb8285b4b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -758,6 +759,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -950,6 +952,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 05797fdfdd3cdeefb99e39e0f4756a6b812465509b31195ff57ae3925aa5e087
Expand Down Expand Up @@ -1056,6 +1062,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: 5660dc09203da9bbeff206b176eef04fb1c881f4c668ebddf8b8ec86617bc5e2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -781,6 +782,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -917,6 +919,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 198073338eb92731fe9f2e2f98384fff62a1df1e1440ce1bf9ce77732dba6f2c
Expand Down Expand Up @@ -1098,6 +1104,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: 19faf4816a2c94cc6f666de0c59c4446e840d5af5069b37fcdf3741b3254d3a3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -221,6 +222,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 0840dcdf026f64cefb7aa69f420bc923d7e2d7d6e9a239e107fd2684e309d8ae
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -779,6 +780,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -915,6 +917,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: daca0d998edb3afa587d96e69b0833f6919ca6ba72f58f3a1f83b22d7e5ffaf6
Expand Down Expand Up @@ -1086,6 +1092,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: b27b8c59cca12784fcd6fba96f6ea4923afffa2c6ec373b6e02d763e0f342091
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-netflow-example
annotations:
checksum/config: 4e9f48f0d6ae172f2f6aa5d526b0ca3af7dd28250e7c06c9d4e67ec0a2fc4573
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-nginx-example
annotations:
checksum/config: 99eaac30ab163ab5f4cedbdbf3e6936d34c2b0e2c22dee59947487bab88fcc26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -760,6 +761,7 @@ rules:
- get
- create
- update
- list
- nonResourceURLs:
- /healthz
- /healthz/*
Expand Down Expand Up @@ -896,6 +898,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-pernode-example
annotations:
checksum/config: 233affcd72143e637a130b5f099c30e194d90042eb00a26512f51c844c65a821
Expand Down Expand Up @@ -1078,6 +1084,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-clusterwide-example
annotations:
checksum/config: d5c563235f87ab23840416f6679b42b15c094cf361b8794d087b4fdfb8285b4b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ spec:
template:
metadata:
labels:
helm.sh/chart: elastic-agent-9.2.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.2.0
name: agent-netflow-example
annotations:
checksum/config: 4e9f48f0d6ae172f2f6aa5d526b0ca3af7dd28250e7c06c9d4e67ec0a2fc4573
Expand Down
Loading
Loading