-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Add readyReplicas to replica sets #29481
Add readyReplicas to replica sets #29481
Conversation
@gabemontero @bparees @livelace you may be interested in this PR |
its amazing to see so much changes for adding a single field. Curious get rs, still shows DESIRED/CURRENT columns, where does that come from ? |
CURRENT is the replicas the rs created - the new field shows how many of On Sun, Jul 24, 2016 at 10:02 AM, krmayankk notifications@github.com
|
@Kargakis thanks for clarifying |
@@ -910,6 +910,9 @@ type ReplicaSetStatus struct { | |||
// The number of pods that have labels matching the labels of the pod template of the replicaset. | |||
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` | |||
|
|||
// The number of available replicas for this replica set. | |||
AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` |
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.
We have two concepts for pods-- live, and ready, I would use one of those terms. What does "Available" mean?
What do you intend to use this field for?
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.
We use AvailableReplicas
in Deployments. A pod is considered available once N seconds pass since it was transitioned to Ready (for d.spec.minReadySeconds=N). So, for Deployments with minReadySeconds=0, a pod is considered available once it is ready. @bgrant0607 do we want to document this in API conventions?
The field in the RC/RS would be useful: 1) on its own - currently just by looking at the status, users cannot determine if their apps are up and running, instead they need to look into pods. 2) Deployments already do this but they need to get into the pod level in order to determine pod availability, whereas for any other info they look into the replica set spec/status. Calculating available pods in the replica set level is pretty cheap and it will remove some complexity from the deployment controller (albeit not much until we consider adding minReadySeconds in RC/RS).
Thanks! It's a good news! FIY @gabemontero @bparees Tested with: v1.4.0-alpha.1 Status of the deployment with /bin/true in postStart hook:
Status of the deployment with /bin/false in postStart hook:
It means that we can say explicitly, that a deployment is done/failed :) |
@Kargakis Please name this field ReadyReplicas. It doesn't have the same meaning as the AvailableReplicas field in Deployment, and I think it would be useful for both APIs to have both fields eventually. We might add minReadySeconds to RC/RS, or could even add it to Pod, which might be useful in conjunction with DisruptionBudget. Ref #7483 |
@bgrant0607 switched to ReadyReplicas |
LGTM |
Rebased + applying lgtm |
@deads2k look at the googlebot respecting me after so long:) |
From reviewable: 1 discussion left (janetkuo, lavalamp) |
GCE e2e build/test passed for commit 46291d5. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 46291d5. |
Automatic merge from submit-queue |
…ler-ready-available-replicas Automatic merge from submit-queue populate ready replicas and aviable replicas to federated replicaset … populate ready replicas and aviable replicas to federated replicaset status @nikhiljindal #33312 #29481 #32771 @deepak-vij
@bgrant0607 for the api changes
@bprashanth for the controllers changes
@deads2k fyi
This change is