support disk usage metrics for containerd factory#3502
support disk usage metrics for containerd factory#3502chengjoey wants to merge 1 commit intogoogle:masterfrom
Conversation
|
Hi @chengjoey. Thanks for your PR. I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
|
||
| var fsStats info.FsStats | ||
| addDiskStats(fileSystems, nil, &fsStats) | ||
| fs.AddDiskStats(fileSystems, nil, &fsStats) |
There was a problem hiding this comment.
This test should be moved to fs module.
|
|
||
| // Act | ||
| addDiskStats(fileSystems, &fsInfo, &fsStats) | ||
| fs.AddDiskStats(fileSystems, &fsInfo, &fsStats) |
| } | ||
| configStr := r.Info["config"] | ||
| config := make(map[string]interface{}) | ||
| if err := json.Unmarshal([]byte(configStr), &config); err != nil { |
There was a problem hiding this comment.
Could you unmarshal config into a struct? It will be easier to grasp what values are interesting.
There was a problem hiding this comment.
The original definition of config is here
I extracted the struct in config.go to container/containerd/config
|
/ok-to-test |
68c7bbf to
5f1986c
Compare
|
/retest |
|
Will this commit continue? Looking forward to it~ |
|
I am looking forward to this feature merging. |
|
I eagerly anticipate the completion of this feature. |
|
This feature is particularly important and I'm looking forward to it |
|
Hi, I think the disk usage of a container should include the usage of log files in /var/log/pods. |
hi @wsszh , The disk usage calculation of contianerd is similar to that of docker and podman. I think that several container factories currently do not include |
if a container should include the usage of log files, I would like to submit another PR to modify the container runtimes such as podman, docker, containerd, etc. This PR only does usage metric for containerd |
1b85ff8 to
9e7a939
Compare
|
great work,Hope to speed up to merge in master |
|
Hi, will this pull request solve this problem ? |
@melikeiremguler , Yes, this PR is to solve the issue of 2785. |
|
Is this PR going to be merged? |
|
Looking forward to the early merge. |
Or is there any alternative solution now? |
|
@iwankgb How could we speed up merge process of this code? We are using it on production and it works perfect. |
|
please |
|
is it still in work or has been abandoned? |
|
@iwankgb could you take a look again? |
|
@dims maybe you can help review this? And re-open the ticket |
|
@till if/when it gets rebased/updated the PR author can reopen this PR |
query rootfs dir from contianerd status and get disk usage stat by rootfs dir `/run/containerd/io.containerd.runtime.v2.task/${contianerid}/rootfs`
Signed-off-by: joey <zchengjoey@gmail.com>
9e7a939 to
578c27f
Compare
| # Since github.com/google/cadvisor/cmd is a submodule, we must build from inside that directory | ||
| pushd cmd > /dev/null | ||
| go build ${GO_FLAGS} -ldflags "${ldflags}" -o "${output_file}" "${repo_path}/cmd" | ||
| go mod tidy && go build ${GO_FLAGS} -ldflags "${ldflags}" -o "${output_file}" "${repo_path}/cmd" |
There was a problem hiding this comment.
please remove the extra go mod tidy
| gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= | ||
| gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= | ||
| gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= | ||
| k8s.io/cri-api v0.34.3 h1:zFdQSHZuQlQXesw9ncjQRUyDpvLng/84Q4qLKd8x2zE= |
There was a problem hiding this comment.
hmm, we really should not be creating circular dependencies!
There was a problem hiding this comment.
This circular dependency refers to the fact that k8s(kubelet) already depends on cAdvisor, so should cAdvisor not depend on the packages in the k8s repository?
There was a problem hiding this comment.
correct! it took us a few years to straighten out the dependencies.
| } | ||
|
|
||
| func (c *client) RootfsDir(ctx context.Context) (string, error) { | ||
| r, err := c.runtimeService.Status(ctx, &runtimeapi.StatusRequest{Verbose: true}) |
There was a problem hiding this comment.
please find another way. we can't be creating circular dependencies
|
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label. |
|
still relevant. |
query rootfs dir from contianerd status and get disk usage stat by rootfs dir
/run/containerd/io.containerd.runtime.v2.task/${contianerid}/rootfsset
hasFileSystemto true for containerd when included disk usage metricsadded common fs handler for container rootfs