Commit Graph

48 Commits

Author SHA1 Message Date
Derek Carr
acb43c7c4a Rework hostfs metrics
Ephemeral storage usage should be calculated by the metrics code,
not the eviction code.
2020-12-03 13:04:25 -07:00
Qiutong Song
a59a6b984f fix CPU time of pod stats with cs.CPU.Time
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2020-11-03 09:29:18 +00:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
kadisi
a75323c76b fix unexpected append mutations about pkg/kubelet package
Signed-off-by: kadisi <iamkadisi@163.com>
Co-authored-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2020-06-03 13:36:57 +08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
tangcong
2b984b3e3a fix kubelet stats staticcheck error 2020-04-21 07:16:58 +08:00
louisgong
e56d40d048 remove unused param 2020-03-24 09:25:04 +08:00
louisgong
0efb70c0a2 eviction by process number 2020-03-24 09:25:04 +08:00
Kubernetes Prow Robot
ac97b2d65e
Merge pull request #83507 from lyft/support-resetting-cpuacct
Prevent returning invalid usageNanoCores value when cpuacct is reset in a live container
2020-02-09 08:45:53 -08:00
Kubernetes Prow Robot
a931227952
Merge pull request #83504 from lyft/remove-all-terminated-containers
cri_stats_provider: do not consider exited containers when calculating cpu usage
2019-12-16 17:53:39 -08:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Ashley Kasim
7d4f555449 correctly handle resetting cpuacct in a live container 2019-11-04 13:06:43 -08:00
Ashley Kasim
3be31530d5 cri_stats_provider: do not consider exited containers when calculating cpu usage 2019-10-04 09:07:53 -07:00
Paul Fisher
f798cee51e pkg/kubelet: fix uint64 overflow when elapsed UsageCoreNanoSeconds exceeds 18446744073 2019-09-03 15:54:26 -07:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
Lantao Liu
11cd4242f6 Remove terminated pod from summary api.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-03 18:34:54 -07:00
Davanum Srinivas
33081c1f07
New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
Lantao Liu
0ac651bfc3 Include pod logs in the pod ephemeral storage.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-08 16:42:14 -08:00
Lantao Liu
f14c6c95d6 New pod log directory /var/log/pods/NAMESPACE_NAME_UID.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-08 16:42:14 -08:00
Pengfei Ni
84a7f48cf7 Add network stats for Windows containers 2019-03-07 09:54:50 +08:00
Yu-Ju Hong
191666d6a3 Fix computing of cpu nano core usage
CRI runtimes do not supply cpu nano core usage as it is not part of CRI
stats. However, there are upstream components that still rely on such
stats to function. The previous fix was faulty because the multiple
callers could compete and update the stats, causing
inconsistent/incoherent metrics. This change, instead, creates a
separate call for updating the usage, and rely on eviction manager,
which runs periodically, to trigger the updates. The caveat is that if
eviction manager is completley turned off, no one would compute the
usage.
2019-03-05 09:25:40 -08:00
Kubernetes Prow Robot
4f01eb528e
Merge pull request #74336 from littleroad/exited_container
cri_stats_provider: Implement removeTerminatedContainer correctly
2019-02-28 19:12:07 -08:00
Lu Fengqi
3f8eda37ce cri_stats_provider: overload nil as 0 for exited containers stats
Always report 0 cpu/memory usage for exited containers to make
metrics-server work as expect.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
2019-02-28 10:41:15 +08:00
Lantao Liu
f9b8d27cef Lower the log level for non-exist cadvisor stats.
For exited container, it is quite normal that cri stats
are returned, but there is no corresponding cadvisor stats.
2019-02-26 16:43:42 -08:00
Pengfei Ni
2449b0997c Revert "Add network stats for Windows containers"
This reverts commit 9cf38de44b.
2019-02-15 12:20:23 +08:00
Pengfei Ni
01fbca29cb Kubelet: add usageNanoCores from CRI stats provider 2019-02-07 22:31:30 +08:00
Pengfei Ni
9cf38de44b Add network stats for Windows containers 2019-01-24 14:20:30 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Krzysztof Jastrzebski
3b21995c95 Process only CPU and memory stats when Kubelete stats API is called with
only_cpu_and_memory parameter. Before all stats were processed and
removed before returning.
2018-09-20 12:35:56 +02:00
Pengfei Ni
8255318b96 Kubelet: do not report used inodes on Windows 2018-09-03 16:42:33 +08:00
Pengfei Ni
7cbee06a00 Add Pod stats for Windows containers 2018-05-17 15:28:46 +08:00
Pengfei Ni
a757a69b45 Remove the workaround of heapster panic 2018-04-09 09:43:39 +08:00
Lantao Liu
3688650a6b Add CPU/Memory pod stats for CRI stats.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-26 19:29:47 +00:00
abhi
6649d38c96 Adding per container stats for CRI runtimes
This commit aims to collect per container log stats. The
change was proposed as a part of #55905. The change includes
change of the log path from /var/pod/<pod uid>/containername_attempt.log
to /var/pod/<pod uid>/containername/containername_attempt.log.
The logs are collected by reusing volume package to collect
metrics from the log path.

Signed-off-by: abhi <abhi@docker.com>
2018-02-20 19:50:47 -08:00
Lantao Liu
a77450ec2d Add mountpoint as CRI image filesystem storage identifier. 2018-02-07 23:01:06 +00:00
Lee Verberne
e10042d22f Increment CRI version from v1alpha1 to v1alpha2
This also incorporates the version string into the package name so
that incompatibile versions will fail to connect.

Arbitrary choices:
- The proto3 package name is runtime.v1alpha2. The proto compiler
  normally translates this to a go package of "runtime_v1alpha2", but
  I renamed it to "v1alpha2" for consistency with existing packages.
- kubelet/apis/cri is used as "internalapi". I left it alone and put the
  public "runtimeapi" in kubelet/apis/cri/runtime.
2018-02-07 09:06:26 +01:00
Lantao Liu
68dadcfd15 Make eviction manager work with CRI container runtime.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-30 17:57:46 +00:00
abhi
3dd6e98ea0 Fixing logs for cri stats
Signed-off-by: abhi <abhi@docker.com>
2018-01-11 09:43:12 -08:00
abhi
84b0e82db4 Integrating cadvisor stats to CRI Pod stats collection
This commit addresses the issue described here
https://github.com/kubernetes-incubator/cri-containerd/issues/341
The changes include using cadvisor stats in addition to CRI stats
for CRI runtimes. As described in the issue above , the CRI stats
currently doesnt provide all the necessary stats for the kubelet.
This commit addreses the need to extract stats from cadvisor which
is not available as CRI stats.

Signed-off-by: abhi <abhi@docker.com>
2017-11-22 22:48:37 -08:00
Jing Xu
75ef18c4d3 Add Pod-level local ephemeral storage metric in Summary API
This PR adds pod-level ephemeral storage metric into Summary API.
Pod-level ephemeral storage usage is the sum of all containers and local
ephemeral volume including EmptyDir (if not backed up by memory or
hugepages), configueMap, and downwardAPI.
2017-11-20 16:32:38 -08:00
Kubernetes Submit Queue
5e508b37d9
Merge pull request #54606 from miaoyq/filter-out-duplicated-container-stats
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Filter out duplicated container stats

**What this PR does / why we need it**:

**Which issue this PR fixes** *
fixes #53514

**Special notes for your reviewer**:

/cc @Random-Liu 

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-17 23:20:36 -08:00
Yanqiang Miao
3bd315dcb1 Filter out duplicated container stats
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-18 09:51:23 +08:00
Lantao Liu
b037be6c19 Work around heapster panic. 2017-11-07 06:41:57 +00:00
Lantao Liu
d387eab817 Fix CRI container/imagefs stats. 2017-09-18 07:48:20 +00:00
David Porter
aee1e58d58 Handle nil WritableLayer 2017-09-16 00:13:17 +00:00
David Porter
0b1f806557 Fix nil dereference if storage id is nil 2017-09-16 00:13:04 +00:00
Yang Guo
dfea03d920 Implement StatsProvider using CRI stats 2017-09-06 09:11:56 -07:00
Yang Guo
f9767d2f71 Change StatsProvider interface to provide container stats from either cadvisor or CRI and implement this interface using cadvisor 2017-08-25 13:11:26 -07:00