Skip to content
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

Adding metrics support to local volume #49598

Merged
merged 1 commit into from
Jul 28, 2017
Merged

Adding metrics support to local volume #49598

merged 1 commit into from
Jul 28, 2017

Conversation

sbezverk
Copy link
Contributor

@sbezverk sbezverk commented Jul 26, 2017

Adding metrics support to local volume plugin.
Fixes #49601

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 26, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @sbezverk. 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.

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 Jul 26, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Jul 26, 2017
@sbezverk
Copy link
Contributor Author

sbezverk commented Jul 26, 2017

/assign @msau42

@@ -107,6 +107,7 @@ func (plugin *localVolumePlugin) NewMounter(spec *volume.Spec, pod *v1.Pod, _ vo
mounter: plugin.host.GetMounter(),
plugin: plugin,
globalPath: volumeSource.Path,
MetricsProvider: volume.NewMetricsDu(volumeSource.Path),
Copy link
Member

Choose a reason for hiding this comment

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

what's the difference between NewMetricsDu and NewMetricsStatFS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NewMetricsDu calculates the volume usage and device free space by executing "du", NewMetricsStatFS calculates the used and available space by stat'ing and gathering filesystem info for the Volume path.

Copy link
Member

Choose a reason for hiding this comment

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

Hm I would use StatFS then since most of the other plugins use that, and it'll be more reliable than parsing output from a command.

@msau42
Copy link
Member

msau42 commented Jul 26, 2017

/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 Jul 26, 2017
@msau42
Copy link
Member

msau42 commented Jul 26, 2017

I think we'll need a release note since the metrics is user-visible.

/release-note

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jul 26, 2017
@msau42
Copy link
Member

msau42 commented Jul 26, 2017

Also please open an issue for this and link it here

@sbezverk
Copy link
Contributor Author

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jul 26, 2017
@sbezverk
Copy link
Contributor Author

@sbezverk
Copy link
Contributor Author

Fixes #49601

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-verify

1 similar comment
@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-verify

@cblecker
Copy link
Member

cblecker commented Jul 26, 2017

@sbezverk If you read the build log (clicking the details link beside the failed test) you'll note that this isn't a flake, but your PR is failing gofmt.

I0726 13:56:18.252] Verifying hack/make-rules/../../hack/verify-gofmt.sh
I0726 13:56:30.986] diff ./pkg/volume/local/local.go gofmt/./pkg/volume/local/local.go
I0726 13:56:30.987] --- /tmp/gofmt408199540	2017-07-26 13:56:26.099417578 +0000
I0726 13:56:30.987] +++ /tmp/gofmt490964035	2017-07-26 13:56:26.099417578 +0000
I0726 13:56:30.987] @@ -102,12 +102,12 @@
I0726 13:56:30.987]  
I0726 13:56:30.987]  	return &localVolumeMounter{
I0726 13:56:30.987]  		localVolume: &localVolume{
I0726 13:56:30.988] -			podUID:     pod.UID,
I0726 13:56:30.988] -			volName:    spec.Name(),
I0726 13:56:30.988] -			mounter:    plugin.host.GetMounter(),
I0726 13:56:30.988] -			plugin:     plugin,
I0726 13:56:30.988] -			globalPath: volumeSource.Path,
I0726 13:56:30.989] -                        MetricsProvider: volume.NewMetricsStatFS(volumeSource.Path),
I0726 13:56:30.989] +			podUID:          pod.UID,
I0726 13:56:30.989] +			volName:         spec.Name(),
I0726 13:56:30.989] +			mounter:         plugin.host.GetMounter(),
I0726 13:56:30.989] +			plugin:          plugin,
I0726 13:56:30.989] +			globalPath:      volumeSource.Path,
I0726 13:56:30.990] +			MetricsProvider: volume.NewMetricsStatFS(volumeSource.Path),
I0726 13:56:30.990]  		},
I0726 13:56:30.990]  		readOnly: readOnly,
I0726 13:56:30.990]  	}, nil
I0726 13:56:30.990] @@ -152,7 +152,7 @@
I0726 13:56:30.990]  	// Mounter interface that provides system calls to mount the global path to the pod local path.
I0726 13:56:30.991]  	mounter mount.Interface
I0726 13:56:30.991]  	plugin  *localVolumePlugin
I0726 13:56:30.991] -        volume.MetricsProvider
I0726 13:56:30.991] +	volume.MetricsProvider
I0726 13:56:30.991]  }
I0726 13:56:30.991]  
I0726 13:56:30.992]  func (l *localVolume) GetPath() string {
I0726 13:56:30.992] FAILED   hack/make-rules/../../hack/verify-gofmt.sh	12s

To fix, run gofmt -w -s pkg/volume/local/local.go and commit the changes.

Adding metrics support to local volume plugin
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 26, 2017
@msau42
Copy link
Member

msau42 commented Jul 26, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: msau42, sbezverk

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

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

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 Jul 26, 2017
@msau42
Copy link
Member

msau42 commented Jul 26, 2017

/test pull-kubernetes-e2e-gce-etcd3

4 similar comments
@msau42
Copy link
Member

msau42 commented Jul 26, 2017

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@fejta
Copy link
Contributor

fejta commented Jul 27, 2017

/retest
Failure was caused by #49679

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

1 similar comment
@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

@fejta It keeps failing. Any suggestions to move forward with this PR?

@sbezverk
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@sbezverk
Copy link
Contributor Author

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 49619, 49598, 47267, 49597, 49638)

@k8s-github-robot k8s-github-robot merged commit ee632be into kubernetes:master Jul 28, 2017
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 Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants