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

New metric for PVC resize status #714

Closed
luarx opened this issue Apr 5, 2019 · 20 comments · Fixed by #952
Closed

New metric for PVC resize status #714

luarx opened this issue Apr 5, 2019 · 20 comments · Fixed by #952
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. hacktoberfest help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@luarx
Copy link

luarx commented Apr 5, 2019

Is this a BUG REPORT or FEATURE REQUEST?:
/kind feature

What happened:
In Kubernetes v1.11 the persistent volume expansion feature is being promoted and we can use it to resize PVC. But kube-state-metrics doesn't have a metric to know if a PVC is "resizing"/"already resized but pending of a pod restart"/"resized".

It would be useful to know if a pod must be restarted so that Kubernetes can resize the filesystem of a persistent volume.

What you expected to happen:
Have a metric to know resize state of a PVC and use it to configure alerts of pods that must be restarted to be able to resize the volume.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): v1.11.9
  • Kube-state-metrics image version
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 5, 2019
@luarx luarx changed the title Metric for PVC resize status New metric for PVC resize status Apr 5, 2019
@brancz
Copy link
Member

brancz commented Apr 5, 2019

The use case makes perfect sense! How does this show in the PVC object? As that's what we would need to create metrics off of.

@luarx
Copy link
Author

luarx commented Apr 9, 2019

Great! I appreciate that :D

In the PVC object there are 3 resizing phases:

  1. NORMAL status without asking for a resize or AFTER RESIZING A PVC
    no_resize_required

  2. Volume RESIZING
    resizing

  3. FILE SYSTEM RESIZE PENDING. In this phase pod must be restarted so that it could be done.
    resize_pending

So I propose the following metric:

  • Name: kube_persistentvolumeclaim_resized_phase
  • Phases:
    • Resizing
    • Pending
    • Completed (PVC is not in one of the previous phases)
  • Fields (the same as kube_persistentvolumeclaim_status_phase):
    kube_persistentvolumeclaim_resized_phase{endpoint="",instance="",job="",namespace="",persistentvolumeclaim="",phase="",pod="",service=""}
  • More fields?
    • LastTransitionTime

What do you think?

@brancz
Copy link
Member

brancz commented Apr 9, 2019

I think having condition metric like we do for pods and nodes would be more appropriate here.

@luarx
Copy link
Author

luarx commented Apr 9, 2019

Are you talking about kube_node_status_condition? It has 3 status values: true/false/unknow...will we define our 3 phases instead of those so?

@brancz
Copy link
Member

brancz commented Apr 9, 2019

It has the condition and status, which seems to be a similar circumstance here. We would have the type and status, which are the required fields for that struct and essentially enums.

@luarx
Copy link
Author

luarx commented Apr 9, 2019

Yes, it makes sense! It would work for me :)

@brancz
Copy link
Member

brancz commented Apr 9, 2019

You want to give it a go? :)

@zouyee
Copy link
Member

zouyee commented Apr 22, 2019

It is helpful to troubleshoot the volume condition!

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 21, 2019
@luarx
Copy link
Author

luarx commented Jul 29, 2019

You want to give it a go? :)

It would be great but I don't have enough time at this time :(

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 28, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

@tariq1890
Copy link
Contributor

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Sep 27, 2019
@k8s-ci-robot
Copy link
Contributor

@tariq1890: Reopened this issue.

In response to this:

/reopen

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.

@tariq1890
Copy link
Contributor

/help-wanted
/remove-lifecycle rotten
/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@tariq1890:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/help-wanted
/remove-lifecycle rotten
/good-first-issue

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.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Sep 27, 2019
@sinhaaks
Copy link
Contributor

Hello, can I work on this issue?

@luarx
Copy link
Author

luarx commented Oct 15, 2019

Sure, I think so! 😃

@lilic
Copy link
Member

lilic commented Oct 15, 2019

/assign @ankitsinhaiiitg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. hacktoberfest help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants