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

Add readyReplicas to replica sets #29481

Merged
merged 2 commits into from
Aug 22, 2016
Merged

Add readyReplicas to replica sets #29481

merged 2 commits into from
Aug 22, 2016

Conversation

0xmichalis
Copy link
Contributor

@0xmichalis 0xmichalis commented Jul 22, 2016

@bgrant0607 for the api changes

@bprashanth for the controllers changes

@deads2k fyi


This change is Reviewable

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Jul 23, 2016
@0xmichalis
Copy link
Contributor Author

@gabemontero @bparees @livelace you may be interested in this PR

@krmayankk
Copy link

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 ?

@0xmichalis
Copy link
Contributor Author

CURRENT is the replicas the rs created - the new field shows how many of
them are available.

On Sun, Jul 24, 2016 at 10:02 AM, krmayankk notifications@github.com
wrote:

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 ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#29481 (comment),
or mute the thread
/~https://github.com/notifications/unsubscribe-auth/ADuFf7ICGyKP7L3-d_XVCT8feH_q3CPFks5qYxwFgaJpZM4JTOYw
.

@krmayankk
Copy link

@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"`
Copy link
Member

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?

Copy link
Contributor Author

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).

@livelace
Copy link

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:
availableReplicas: 1
observedGeneration: 2
replicas: 1
updatedReplicas: 1

Status of the deployment with /bin/false in postStart hook:

status:
observedGeneration: 2
replicas: 1
unavailableReplicas: 1
updatedReplicas: 1

It means that we can say explicitly, that a deployment is done/failed :)

@gabemontero
Copy link

Sounds great @livelace. Once this change gets pulled into openshift's k8s godeps, we can look into updating the openshift java restclient (fyi @jcantril) and openshift jenkins plugin to interrogate the AvailableReplicas field.

And thanks @Kargakis for making this happen.

@bgrant0607 bgrant0607 assigned bgrant0607 and unassigned lavalamp Jul 27, 2016
@bgrant0607
Copy link
Member

@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

@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. retest-not-required-docs-only needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed retest-not-required-docs-only labels Jul 28, 2016
@bgrant0607 bgrant0607 assigned janetkuo and unassigned bgrant0607 Aug 3, 2016
@apelisse apelisse removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Aug 11, 2016
@0xmichalis
Copy link
Contributor Author

@bgrant0607 switched to ReadyReplicas

@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 17, 2016
@bgrant0607
Copy link
Member

ref kubernetes-retired/contrib#869

@janetkuo
Copy link
Member

LGTM

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 19, 2016
@0xmichalis
Copy link
Contributor Author

Rebased + applying lgtm

@0xmichalis 0xmichalis added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2016
@0xmichalis
Copy link
Contributor Author

@deads2k look at the googlebot respecting me after so long:)

@0xmichalis
Copy link
Contributor Author

From reviewable: 1 discussion left (janetkuo, lavalamp)

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 19, 2016
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 21, 2016
@k8s-bot
Copy link

k8s-bot commented Aug 21, 2016

GCE e2e build/test passed for commit 46291d5.

@janetkuo janetkuo added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 21, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Aug 22, 2016

GCE e2e build/test passed for commit 46291d5.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 5b6e1c3 into kubernetes:master Aug 22, 2016
@0xmichalis 0xmichalis deleted the available-replicas-on-replica-sets branch August 22, 2016 07:44
k8s-github-robot pushed a commit that referenced this pull request Nov 23, 2016
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.