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

kubectl rollout status does not print actual deployment status #31130

Closed
Eyjafjallajokull opened this issue Aug 22, 2016 · 0 comments · Fixed by #31499
Closed

kubectl rollout status does not print actual deployment status #31130

Eyjafjallajokull opened this issue Aug 22, 2016 · 0 comments · Fixed by #31499
Labels
area/kubectl priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@Eyjafjallajokull
Copy link

Eyjafjallajokull commented Aug 22, 2016

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.5", GitCommit:"b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5", GitTreeState:"clean", BuildDate:"2016-08-11T20:29:08Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:38:31Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: aws ec2

What happened:
I only need one replica for my application, but I also want to have zero downtime deployment. I have written following spec:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: xxx
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1

Deployment works as expected:

  1. there is always 1 pod available
  2. when deploy is triggered, then the second pod is created
  3. first pod is available, second is booting (ready=false)
  4. when the second pod is ready, then the first pod is terminated

Whenever I execute kubectl rollout status deployment/xxx it always prints deployment xxxx successfully rolled out. I've even executed this command in loop, triggered deployment and saw that value never changed.

What you expected to happen:
kubectl rollout status deployment/xxx should work as documentation states: print changes and wait until rollout is completed.

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

Create deployment with spec like above.

Anything else do we need to know:

Maybe I don't understand this well. When is rollout considered successful in my case? I would think that the moment new pod changes into ready status.

I've also followed docs about deployment status and printed in loop all variables checked by rollout status with command:

watch ku --namespace uxpin-kubernetes-probes get deployment/uxpin-apps -o jsonpath="'{.status.observedGeneration}>={.metadata.generation} && {.status.updatedReplicas}=={.spec.replicas}'"

And indeed conditions are true during whole rollout.

The reason I need rollout status is because I want to send notification about completed deployment. If there is better way to do this please correct me.

@pwittrock pwittrock added priority/backlog Higher priority than priority/awaiting-more-evidence. good-for-contributor-onboarding labels Aug 22, 2016
k8s-github-robot pushed a commit that referenced this issue Sep 8, 2016
Automatic merge from submit-queue

kubectl rollout status waits for available pods

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
This changes kubectl rollout status to wait until all updated replicas are available before finishing.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #31130

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Changes 'kubectl rollout status' to wait until all updated replicas are available before finishing.
```
Currently kubectl rollout status finishes when Deployment.Spec.Replicas == Deployment.Status.UpdatedReplicas, but it's less surprising to the user for kubectl rollout status to wait until Deployment.Status.UpdatedReplicas == Deployment.Status.Replics == Deployment.Status.AvailableReplicas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants