-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
support disk usage metrics for containerd factory #3502
base: master
Are you sure you want to change the base?
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. Instructions 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. |
container/docker/handler_test.go
Outdated
@@ -169,7 +169,7 @@ func TestAddDiskStatsCheck(t *testing.T) { | |||
fileSystems := []fs.Fs{fileSystem} | |||
|
|||
var fsStats info.FsStats | |||
addDiskStats(fileSystems, nil, &fsStats) | |||
fs.AddDiskStats(fileSystems, nil, &fsStats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be moved to fs
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done~
container/docker/handler_test.go
Outdated
@@ -203,7 +203,7 @@ func TestAddDiskStats(t *testing.T) { | |||
fileSystems := []fs.Fs{fileSystem} | |||
|
|||
// Act | |||
addDiskStats(fileSystems, &fsInfo, &fsStats) | |||
fs.AddDiskStats(fileSystems, &fsInfo, &fsStats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done~
} | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you unmarshal config into a struct? It will be easier to grasp what values are interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
347eed9
to
1b85ff8
Compare
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 <[email protected]>
1b85ff8
to
9e7a939
Compare
query rootfs dir from contianerd status and get disk usage stat by rootfs dir
/run/containerd/io.containerd.runtime.v2.task/${contianerid}/rootfs
set
hasFileSystem
to true for containerd when included disk usage metricsadded common fs handler for container rootfs