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

feature request: "currentState.replicas" count in replicationController API #736

Closed
sym3tri opened this issue Aug 1, 2014 · 7 comments
Closed
Labels
area/api Indicates an issue on api area. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@sym3tri
Copy link
Contributor

sym3tri commented Aug 1, 2014

Similar to how the current desiredState section specifies the number of replicas, it would be useful to show how many pods are currently satisfying that desired state. ie:

"desiredState": {
  "replicas": 3,
  ...
},
"currentState": {
  "replicas": 2
}

Effectively this would provide a "status" for the RC.
The only way (I am aware of) to do this now is by getting the RC's selector query, polling the pod list with that label query, and counting the results.

@kelseyhightower
Copy link
Contributor

I would love to work on this one.

@kelseyhightower
Copy link
Contributor

@brendanburns @smarterclayton Thoughts on adding support for this? I would like to hack on it if people thinks it's a good idea.

@lavalamp
Copy link
Member

lavalamp commented Aug 1, 2014

@kelseyhightower go for it. The only way to implement it right now is to have the replicationController storage object (in pkg/registry), when it gets a GET request for a rep. Controller, list the pods matching the label selector, count the result, and place that in current state. Currently it'll be extremely inefficient, but we can fix that when we have some concept of indexes or something.

@brendandburns
Copy link
Contributor

+1 Go for it!

We can add a caching layer for pod listing (I've been thinking this is a good idea anyway), which can watch the pod list, and update the cache dynamically.

@brendandburns
Copy link
Contributor

Is this underway? If there's no work on it, I'll work on getting it done.

@lavalamp
Copy link
Member

lavalamp commented Sep 3, 2014

Before doing this consider that a naive implementation will currently make listing rep. controllers an O(rep controller count * pod count operation).

@brendandburns
Copy link
Contributor

Done in #1248

vishh pushed a commit to vishh/kubernetes that referenced this issue Apr 6, 2016
Change Cgroup to Container in ps output.
mqliang pushed a commit to mqliang/kubernetes that referenced this issue Dec 8, 2016
mqliang pushed a commit to mqliang/kubernetes that referenced this issue Mar 3, 2017
seans3 pushed a commit to seans3/kubernetes that referenced this issue Apr 10, 2019
jsafrane pushed a commit to jsafrane/kubernetes that referenced this issue Jun 7, 2021
Bug 1927397: UPSTREAM: 98028: add auto update for priority & fairness bootstrap configuration objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

5 participants