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

Adding a DeploymentDescriber to kubectl #14199

Merged
merged 1 commit into from
Oct 1, 2015

Conversation

nikhiljindal
Copy link
Contributor

Ref #1743

Adding a DeploymentDescriber to describe deployment objects using kubectl describe deployments
Sample output:

Name:                           nginx-deployment
Namespace:                      default
CreationTimestamp:              Sun, 27 Sep 2015 20:04:35 -0700
Labels:                         name=nginx-deployment
Selector:                       name=nginx
Replicas:                       3 updated / 3 total
StrategyType:                   RollingUpdate
RollingUpdateStrategy:          1 max unavailable, 1 max surge, 0 min ready seconds
OldReplicationControllers:      <none>
NewReplicationController:      deploymentrc-729166632 (3/3 replicas created)

@nikhiljindal
Copy link
Contributor Author

cc @ghodss @ironcladlou

@k8s-github-robot k8s-github-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 18, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/M

@k8s-bot
Copy link

k8s-bot commented Sep 18, 2015

GCE e2e build/test passed for commit 382c2b51d15e961bf5aba2c2ba2624f902f78405.

fmt.Fprintf(out, "StrategyType:\t%s\n", d.Spec.Strategy.Type)
if d.Spec.Strategy.RollingUpdate != nil {
ru := d.Spec.Strategy.RollingUpdate
fmt.Fprintf(out, "RollingUpdateStrategy:\t%s maxUnavailable, %s maxSurge, %d minReadySeconds", ru.MaxUnavailable.String(), ru.MaxSurge.String(), ru.MinReadySeconds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like describe to a bit more human-friendly, so I would suggest "max unavailable", "max surge", etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ghodss
Copy link
Contributor

ghodss commented Sep 19, 2015

In the console output, the values all line up, right?

@ghodss
Copy link
Contributor

ghodss commented Sep 19, 2015

LGTM, but maybe someone else from @kubernetes/kubectl wants to take a look.

}

func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error) {
d, err := dd.Experimental().Deployments(namespace).Get(name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get the replication controllers managed by this dep and show them in some order. If they can be loaded we shouldn't hard fail (show error and continue)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really want them, then instead of recomputing them here, I would prefer that deployment controller adds them to the DeploymentStatus and we just display it here.
I think we had discussed doing that in the proposal, but then decided against it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree with @smarterclayton here. Keeping copies of other objects' state in the Deployment object's status will either be frequently out of date or will lead to lots of extraneous updates to apiserver. At the very most, perhaps the matching RC names should be in the status (and, during a deployment, both the old RC's and the new RC's).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Thats the reason why we decided not to store anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison I'm drawing is to the pod describer where we fetch the replication controllers that overlap the pod. I think users would expect the same here - I'm ok with showing status, but it is common to want to know whether you have multiple RCs in flight during a deployment. Getting the list of RCs and even showing what the D controller thinks is the status is both good. The note about not failing was just that if the RC is borked for some reason we don't want to prevent describe from working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nikhiljindal
Copy link
Contributor Author

Yes, values line up in the console output.

@k8s-bot
Copy link

k8s-bot commented Sep 21, 2015

GCE e2e build/test passed for commit f4dcd38dabdd2ba1bf9d9e6a7a40bac928655098.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 22, 2015
@nikhiljindal nikhiljindal added this to the v1.1 milestone Sep 24, 2015
@k8s-bot
Copy link

k8s-bot commented Sep 25, 2015

Unit, integration and GCE e2e build/test failed for commit 62a8d4217d9b2549b8bdbe60404762ad83b354f7.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 25, 2015
@nikhiljindal nikhiljindal force-pushed the deploymentDescribe branch 2 times, most recently from b0ea1c5 to da05778 Compare September 28, 2015 02:10
@k8s-bot
Copy link

k8s-bot commented Sep 28, 2015

Unit, integration and GCE e2e build/test failed for commit da0577870b65f23d36787cdca85cf10e22c363fd.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 28, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/L

@nikhiljindal nikhiljindal force-pushed the deploymentDescribe branch 3 times, most recently from 39c256c to 38e5dca Compare September 28, 2015 03:18
@nikhiljindal
Copy link
Contributor Author

Have updated the code to include old and new RC in output. PTAL.

@k8s-bot
Copy link

k8s-bot commented Sep 28, 2015

Unit, integration and GCE e2e build/test failed for commit 9353594c16c887f4b5c4a845456ea785ddb16224.

@k8s-bot
Copy link

k8s-bot commented Sep 28, 2015

Unit, integration and GCE e2e build/test failed for commit 39c256ccdcb9908adaa30e7aefedd3154f9e3c6e.

@nikhiljindal
Copy link
Contributor Author

Closing and reopening to retrigger Jenkins. It has been pending for 20 hours.

@nikhiljindal
Copy link
Contributor Author

Adding LGTM label as per @ironcladlou's LGTM above.

@nikhiljindal nikhiljindal added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2015
@nikhiljindal
Copy link
Contributor Author

@k8s-bot test this please

@k8s-bot
Copy link

k8s-bot commented Sep 29, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

oidc.TestOIDCAuthentication (from k8s.io_kubernetes_plugin_pkg_auth_authenticator_token_oidc) failed, which seems flaky. Retrying.

@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Sep 29, 2015

Unit, integration and GCE e2e test build/test passed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Sep 30, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

Logs show all tests passed.
@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Sep 30, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

TestPluginTearDownHook failed which is unrelated. seems flaky.
@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

TestPluginSetupHook this time.
@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

exec.TestPluginTearDownHook again
@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@nikhiljindal
Copy link
Contributor Author

cni_test.go:175: Failed to select the desired plugin: Network plugin "cni" not found.

@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e build/test failed for commit 153c57f.

@k8s-bot
Copy link

k8s-bot commented Oct 1, 2015

Unit, integration and GCE e2e test build/test passed for commit 153c57f.

nikhiljindal added a commit that referenced this pull request Oct 1, 2015
Adding a DeploymentDescriber to kubectl
@nikhiljindal nikhiljindal merged commit 7adb463 into kubernetes:master Oct 1, 2015
nikhiljindal added a commit that referenced this pull request Oct 8, 2015
…#14199-upstream-release-1.1

Automated cherry pick of #14199 upstream release 1.1
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…y-pick-of-#14199-upstream-release-1.1

Automated cherry pick of kubernetes#14199 upstream release 1.1
shouhong pushed a commit to shouhong/kubernetes that referenced this pull request Feb 14, 2017
…y-pick-of-#14199-upstream-release-1.1

Automated cherry pick of kubernetes#14199 upstream release 1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants