103 Commits

Author SHA1 Message Date
Damien Grisonnet
4f01955a87 kubelet/cadvisor: disable container discovery when using CRI stats
When the container runtime provides stats via CRI, cAdvisor only needs
to track the root container for node-level resource and filesystem
metrics. Set DisableContainerDiscovery on the cAdvisor manager to skip
plugin initialization, cgroup watchers, and subcontainer scanning in
that mode.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2026-07-15 14:51:05 +02:00
Davanum Srinivas
c2e122037d bump github.com/google/cadvisor/lib from v0.60.3 to v0.60.4
The new cadvisor version requires newer golang.org/x modules. Module
version selection raised crypto, mod, net, sync, sys, term, text, and
tools. golang.org/x/net moves from a pseudo-version to the v0.57.0
release, which includes the http2 fixes the pseudo-version pointed at.

cadvisor/lib no longer depends on github.com/gogo/protobuf. This change
removes cadvisor/lib from the gogo/protobuf dependants list in
hack/unwanted-dependencies.json.
2026-07-10 08:24:03 +05:30
Davanum Srinivas
0e1f1daae1 kubelet: read OOM events in-tree and drop the cadvisor oomparser dependency
The kubelet used cadvisor's lib/utils/oomparser to watch the kernel log for
OOM kills and to produce the container_oom_events_total metric. That made the
kubelet depend on the cadvisor lib module for OOM handling.

This moves OOM handling in-tree:

- The OOM kill parser is forked from cadvisor into
  third_party/forked/cadvisor/oomparser. It reads /dev/kmsg and extracts OOM
  events, adapted to take a context.Context and log through klog.
- The kmsg reader is forked from github.com/euank/go-kmsg-parser into
  third_party/forked/go-kmsg-parser/kmsgparser.
- The kubelet OOM watcher reads OOM events through the forked parser and
  records the container_oom_events_total metric in-tree.
- cadvisor/lib is bumped to v0.60.3, which no longer ships the OOM parser.
  This removes the transitive github.com/euank/go-kmsg-parser
  v2.0.0+incompatible dependency and the vendored cadvisor lib/utils/oomparser
  package.

Behavior is unchanged. OOM events are still emitted and the metric still
reports the same counts.
2026-06-26 20:35:19 -04:00
Davanum Srinivas
0c61430054 kubelet: adopt lib/model pointer sub-stats and restore the stats nil-checks
github.com/google/cadvisor/lib v0.60.2 models the per-subsystem container
stats (Cpu, Memory, Network, DiskIo, Processes) as pointers, so a nil
again distinguishes "not collected" from a collected zero. Restore the
kubelet's original nil-checks in helper.go and cadvisor_stats_provider.go
(now equivalent to the pre-lib code), adapt the test fixtures and winstats
to build pointer sub-stats, and bump the vendored lib to v0.60.2.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-06-24 13:46:45 -04:00
Davanum Srinivas
f451aa0762 kubelet: depend on github.com/google/cadvisor/lib
Migrate the kubelet (and the kube-proxy conntrack helper) off the full github.com/google/cadvisor module onto the lean github.com/google/cadvisor/lib: repoint info/v1+info/v2 type usage to lib/model and the manager/fs/cache/etc. consumers to lib/*; regenerate the cadvisor.Interface mocks; keep the kubelet-pinned cAdvisor global flags via lib/cadvisorflags.

go.mod: require + replace github.com/google/cadvisor/lib (=> the dims/cadvisor/lib fork for now, until lib is tagged) and drop the full github.com/google/cadvisor module entirely; keep github.com/containerd/containerd/api at v1.11.0 (matching upstream master); add github.com/google/cadvisor to unwanted-dependencies.json unwantedModules so the full module cannot be re-vendored.

test/e2e_node: the one remaining consumer of the full module -- the node-e2e ResourceCollector, which used the v2 HTTP client (client/v2) + v2 API types (info/v2) -- now scrapes the standalone cAdvisor pod's /api/v2.1/stats directly over HTTP+JSON, so test/e2e_node depends on no cAdvisor package. No change to the kubelet's stats surfaces.
2026-06-20 17:27:16 -04:00
Stephen Kitt
8f971144d0 Bump cadvisor to 0.57.0
This adds container creation timestamps.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-19 11:42:44 +02:00
Benjamin Elder
686a126f69 hack/update-vendor.sh 2026-04-24 19:38:58 -07:00
Davanum Srinivas
050c786014 Update vendored dependencies: cadvisor, containerd, runtime-spec, selinux
Update the following vendored dependencies:

- github.com/google/cadvisor: v0.55.1 -> v0.56.0
- github.com/containerd/containerd/api: v1.9.0 -> v1.10.0
- github.com/opencontainers/runtime-spec: v1.2.1 -> v1.3.0
- github.com/opencontainers/selinux: v1.13.0 -> v1.13.1

cadvisor v0.56.0 changes:
- Add s390x (IBM Z/mainframe) CPU topology support with NumBooks and
  NumDrawers fields in MachineInfo
- Add new Prometheus metrics: machine_cpu_books and machine_cpu_drawers
- Add standard deviation (Std) field to Percentiles for resource statistics
- Add sysfs constants CPUBookID and CPUDrawerID for s390x topology detection

containerd/api v1.10.0 changes:
- Add ActiveMount message type for tracking mounts with timestamps
- Add ActivationInfo message for mount management and lifecycle tracking

runtime-spec v1.3.0 changes (from ChangeLog):
- Add FreeBSD platform support with new Spec.FreeBSD field
- Add netDevices object for moving network devices to container namespaces
- Add memoryPolicy object for NUMA memory policy configuration
- Add hwConfig object for VM-based containers (vcpus, memory, device-tree)
- Add iomems for hardware I/O memory page access in VMs
- Add intelRdt.schemata and intelRdt.enableMonitoring fields
- Change LinuxPids.Limit to pointer type for optional handling
- Clarify intelRdt configuration and pids cgroup settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-01-15 10:26:13 -05:00
Davanum Srinivas
95cf1f264d Update to github.com/google/cadvisor v0.55.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-21 08:13:06 -05:00
Stephen Kitt
684473af62 Bump cadvisor to 0.53
This brings a few fixes, drops github.com/pkg/errors (as a direct
dependency), and bumps many transitive dependencies. The
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp bump to
v0.61.0 breaks "k8s.io/kubernetes/test/integration/apiserver: tracing"
consistently, so it's held back for now.

github.com/containerd/containerd/api pulls in gopkg.in/yaml.v3 so that
needs to be added to the exceptions in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-28 09:20:21 +02:00
Davanum Srinivas
5ecddb6571 update to latest cadvisor @ v0.52.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-03-05 06:36:39 -05:00
Davanum Srinivas
152d342a8d Update to latest cadvisor
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-10-30 15:25:21 -04:00
Kirtana Ashok
3fba9930b7 Update cadvisor and hcsshim versions
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-09-22 11:50:45 -07:00
Davanum Srinivas
bf268f02a3 Remove gcp in-tree cloud provider and credential provider
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-01 09:03:53 -04:00
David Porter
c05e541793 Bump cAdvisor to v0.49.0
Signed-off-by: David Porter <david@porter.me>
2024-02-29 14:21:49 -08:00
Davanum Srinivas
8b9fc325e2 Update to new cadvisor v0.48.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-10-31 14:30:54 -04:00
Itamar Holder
f22aa42aa8 bump go.mod cadvisor to v0.47.3
Signed-off-by: Itamar Holder <iholder@redhat.com>
2023-07-11 17:22:33 +03:00
Harshal Patil
409bc8ccc0 deps: Bump to cAdvisor v0.47.2
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2023-06-20 15:08:29 -04:00
torredil
6aebda9b1e Remove AWS legacy cloud provider + EBS in-tree storage plugin
Signed-off-by: torredil <torredil@amazon.com>
2023-03-06 14:01:15 +00:00
David Porter
761dd3640e deps: Bump to cAdvisor v0.47.1
Signed-off-by: David Porter <david@porter.me>
2023-01-11 16:07:12 -08:00
David Porter
a2c4672163 deps: Bump cAdvisor to v0.46.0
Signed-off-by: David Porter <david@porter.me>
2022-11-08 18:49:14 -08:00
David Porter
d9fda8ab3b vendor: Bump cAdvisor to v0.45.0
Signed-off-by: David Porter <david@porter.me>
2022-08-03 09:47:06 -07:00
David Porter
b0da29dcb8 Bump cAdvisor to v0.44.1
Bump cAdvisor to v0.44.1 to pick up fix for containerd task timeout
which resulted in empty network metrics.

Signed-off-by: David Porter <david@porter.me>
2022-04-25 17:18:38 -07:00
Elana Hashman
07af1bab70 deps: update runc to 1.1.0
This updates vendored runc/libcontainer to 1.1.0,
and google/cadvisor to a version updated to runc 1.1.0
(google/cadvisor#3048).

Changes in vendor are generated by (roughly):

        ./hack/pin-dependency.sh github.com/google/cadvisor v0.44.0
        ./hack/pin-dependency.sh github.com/opencontainers/runc v1.1.0
        ./hack/update-vendor.sh
        ./hack/lint-dependencies.sh # And follow all its recommendations.
        ./hack/update-vendor.sh
        ./hack/update-internal-modules.sh
        ./hack/lint-dependencies.sh # Re-check everything again.

Co-Authored-By: Kir Kolyshkin <kolyshkin@gmail.com>
2022-03-28 16:23:18 -07:00
Davanum Srinivas
420145e529 drop things from vendor/ directory
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-08 08:07:03 -05:00
David Porter
c6452be958 Bump cAdvisor to v0.43.0
Bumping cAdvisor from v0.39.2 -> v0.43.0

* Also pin transitive dependencies
  * containerd v1.4.9 -> v1.4.11
  * docker v20.10.2+incompatible> v20.10.7+incompatible

Signed-off-by: David Porter <david@porter.me>
2021-11-09 17:09:00 -08:00
Giuseppe Scrivano
5b0bafabf6 vendor: upgrade cadvisor to 0.39.2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-06-01 15:20:27 +02:00
David Porter
b5dd78da3d vendor: cadvisor v0.39.0
Main upgrades:
- github.com/opencontainers/runc v1.0.0-rc93
- github.com/containerd/containerd v1.4.4
- github.com/docker/docker v20.10.2
- github.com/mrunalp/fileutils v0.5.0
- github.com/opencontainers/selinux v1.8.0
- github.com/cilium/ebpf v0.2.0
2021-03-08 22:10:29 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Maciej Iwan Iwanowski
d573ab8317 Upgrading cAdvisor to 0.38.8 2021-02-22 19:37:05 +01:00
Geonju Kim
3c04340ce7 vendor: update cAdvisor to v0.38.7 2021-01-14 10:11:50 +09:00
Hanlin Shi
26d02bea9a vendor: update cAdvisor to v0.38.6
Signed-off-by: Hanlin Shi <shihanlin9@gmail.com>
2020-12-09 15:11:26 -08:00
David Porter
4a46efb707 vendor: update cAdvisor to v0.38.5 2020-11-24 07:45:19 +00:00
David Porter
8af7405f17 vendor: cadvisor v0.38.4 2020-11-13 19:52:57 +00:00
David Ashpole
1f70708f6c update cAdvisor to v0.37.0 2020-07-09 10:23:10 -07:00
Giuseppe Scrivano
a6a3bf2eb4 vendor: update google/cadvisor and opencontainers/runc
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-24 18:39:50 +02:00
Davanum Srinivas
082578c22f Updating dependency github.com/google/cadvisor to version 6a8d614
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:52:56 -04:00
Davanum Srinivas
4274ea2c89 Update cadvisor and containerd 2020-03-25 12:01:19 -04:00
David Ashpole
a445c97a0e update cadvisor dependency to v0.35.0 2019-11-27 14:22:51 -08:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
David Ashpole
5420d84160 update cAdvisor godeps to v0.34.0 release 2019-08-30 10:31:03 -07:00
Tarun Pothulapati
ce31366baf pinned cadvisor to a latest commit
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
2019-08-08 17:56:37 +05:30
Tim Allclair
c12b053390 Reregister cAdvisor cloud info providers in Kubelet 2019-04-22 15:43:45 -07:00
Davanum Srinivas
70d562a6ac Update to latest cadvisor - cleanup mesos/rkt
Change-Id: Ib5ae0cb13b93f8c87bb74e3ba33040df5f3d6a6f
2019-04-11 14:49:23 -04:00
Lantao Liu
74f4579f07 Update cadvisor to v0.33.1. 2019-03-07 12:01:57 -08:00
David Ashpole
4e063fe007 update cadvisor godeps to v0.33.0 2019-02-27 11:02:48 -08:00
Davanum Srinivas
3fe776f24b Update vendor dependencies
Change-Id: I3b1ca9f2687388c831d9d46a4e1de413ffae06ac
2018-11-10 07:50:31 -05:00
David Ashpole
788196e45b update cadvisor to v0.31.0 2018-09-10 10:31:56 -07:00
Jess Frazelle
31ffd9f881 vendor: update docker cadvisor winterm
This vendor change was purely for the changes in docker to allow for
setting the Masked and Read-only paths.

See: moby/moby#36644

But because of the docker dep update it also needed cadvisor to be
updated and winterm due to changes in pkg/tlsconfig in docker

See: google/cadvisor#1967

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-08-30 11:40:05 -04:00
Christoph Blecker
f97fdf76dc Remove unneeded deps 2018-07-07 12:20:46 -07:00