Skip to content

Add PVCRef to VolumeStats#51448

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
kastenhq:pvc_ref_volstats
Sep 1, 2017
Merged

Add PVCRef to VolumeStats#51448
k8s-github-robot merged 1 commit intokubernetes:masterfrom
kastenhq:pvc_ref_volstats

Conversation

@vkamra
Copy link
Copy Markdown

@vkamra vkamra commented Aug 28, 2017

What this PR does / why we need it:
For pod volumes that reference a PVC, add a PVCRef to the corresponding
volume stat. This allows metrics to be indexed/queried by PVC name
which is more user-friendly than Pod reference

Which issue this PR fixes : #363

Special notes for your reviewer:

Release note:

`VolumeStats` reported by the kubelet stats summary API 
(http://<node>:10255/stats/summary) now include a PVCRef
field describing the PVC referenced by the volume (if any). 

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 28, 2017
@k8s-github-robot k8s-github-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 28, 2017
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @vkamra. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Details

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 28, 2017
@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 28, 2017

/cc @jingxu97

@xiangpengzhao
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 28, 2017
@wongma7
Copy link
Copy Markdown
Contributor

wongma7 commented Aug 28, 2017

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Aug 28, 2017
@wongma7
Copy link
Copy Markdown
Contributor

wongma7 commented Aug 28, 2017

The issue is wrong, should link to kubernetes/features. also needs hack/update-bazel.sh to pass verify 👍

@jingxu97 jingxu97 self-requested a review August 28, 2017 21:46
@@ -0,0 +1,141 @@
/*
Copyright 2016 The Kubernetes Authors.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

@jingxu97
Copy link
Copy Markdown
Contributor

Do you have manual test for see whether the stats are working?

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 28, 2017

@wongma7 - will do - thanks

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 28, 2017

@jingxu97 - have tested manually (output below for a stateful set pod)

`     {
      "time": "2017-08-28T22:18:26Z",
      "availableBytes": 876806144,
      "capacityBytes": 1023303680,
      "usedBytes": 76034048,
      "inodesFree": 65507,
      "inodes": 65536,
      "inodesUsed": 29,
      "name": "datadir",
      "pvcRef": {
       "name": "datadir-cockroachdb-0",
       "namespace": "default"
      }`

@jingxu97
Copy link
Copy Markdown
Contributor

Could you also add a release note in the commit? Thanks!

@jingxu97
Copy link
Copy Markdown
Contributor

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 28, 2017

@jingxu97 - done

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 28, 2017

/retest

@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 29, 2017
return stats.VolumeStats{
Name: podName,
Name: podName,
PVCRef: pvcRef,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking to check pvcRef is nil or not here. If it is nil, return stats.VolumeStats without PVCRef field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the result will be the same since PVCRef will default to nil whether we explicitly set PVCRef: nil, or not at all

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed - the behavior would be the same i.e VolumeStats.PVCRef will be nil in both cases?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I am hoping if PVCRef is nil, the printed result of volumestat will not show this field, instead of showing PVCRef: nil?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - it won't. It's tagged optional/omit-empty.

@jingxu97
Copy link
Copy Markdown
Contributor

cc @derekwaynecarr @Random-Liu could you please help approve this PR? Thanks!

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 29, 2017

@jingxu97 @wongma7 - any idea what to do about the test failures above. They appear unrelated/flakes - would you mind taking a quick look to see if you agree?

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 29, 2017

/retest

@wongma7
Copy link
Copy Markdown
Contributor

wongma7 commented Aug 29, 2017

yeah it looks like flakes to me, gpu is currently flaky and "TestCRD" looks like it's not just us

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 29, 2017

/retest

@jingxu97
Copy link
Copy Markdown
Contributor

jingxu97 commented Aug 29, 2017

@vkamra, you don't need to run /retest which run all the tests again. Just the tests that failed, like
"/test pull-kubernetes-e2e-gce-bazel"

Also for verify test, you can try to run locally with hack/verify-bazel.sh

@jingxu97
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 29, 2017
@jingxu97
Copy link
Copy Markdown
Contributor

cc @tallclair Could you help approve this PR?

@vkamra
Copy link
Copy Markdown
Author

vkamra commented Aug 29, 2017

/test pull-kubernetes-e2e-gce-etcd3

For pod volumes that reference a PVC, add a PVCRef to the corresponding
volume stat. This allows metrics to be indexed/queried by PVC name
which is more user-friendly than Pod reference
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2017
@xiangpengzhao
Copy link
Copy Markdown
Contributor

you don't need to run /retest which run all the tests again. Just the tests that failed, like
"/test pull-kubernetes-e2e-gce-bazel"

@jingxu97 fyi: /retest only runs the failed test(s) again, it doesn't re-run all the tests :)

@wongma7
Copy link
Copy Markdown
Contributor

wongma7 commented Aug 30, 2017

/retest

@jingxu97 jingxu97 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2017
@jingxu97
Copy link
Copy Markdown
Contributor

@xiangpengzhao thanks for the information! Good to know that.

@derekwaynecarr
Copy link
Copy Markdown
Member

/approve

@k8s-github-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: derekwaynecarr, jingxu97, vkamra

Associated issue: 363

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 30, 2017
@k8s-github-robot
Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 51513, 51515, 50570, 51482, 51448)

@k8s-github-robot k8s-github-robot merged commit 17dffc1 into kubernetes:master Sep 1, 2017
k8s-github-robot pushed a commit that referenced this pull request Sep 3, 2017
Automatic merge from submit-queue

Expose PVC metrics via kubelet prometheus

This depends on #51448, opening early though. second commit is mine and mostly a copy/paste job.

implements metrics listed in here kubernetes/community#855 following method here kubernetes/community#930 (comment)

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: kubernetes/enhancements#363

**Special notes for your reviewer**:

**Release note**:

```release-note
PersistentVolumeClaim metrics like "volume_stats_inodes" and "volume_stats_capacity_bytes" are now reported via kubelet prometheus
```
cofyc pushed a commit to cofyc/kubernetes that referenced this pull request Sep 26, 2017
For pod volumes that reference a PVC, add a PVCRef to the corresponding
volume stat. This allows metrics to be indexed/queried by PVC name
which is more user-friendly than Pod reference

See kubernetes#51448.
@julio-lopez julio-lopez deleted the pvc_ref_volstats branch October 9, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants