Production-Grade Container Scheduling and Management
Go to file
Kubernetes Submit Queue 761fdeacaa
Merge pull request #55689 from luksa/kubectl_explain_kind_version
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make kubectl explain print the Kind and APIVersion of the resource

**What this PR does / why we need it**:
Kubectl explain currently doesn't print out the Kind and APIversion of the resource being explained. When running `kubectl explain hpa.spec`, for example, there is no way of knowing whether you're looking at the `autoscaling/v1` or the `autoscaling/v2beta1` version. 
Also, `kubectl explain` is often used as a reference when writing YAML/JSON object manifests. It allows you to look up everything except the API version. Currently, you either need to know the API Version of a resource by heart or look it up in the online API docs. 
This PR fixes both problems by having `kubectl explain` print out the full Kind and APIVersion of the resource it is explaining.

Here are a few examples of the new output:
```
$ kubectl explain deploy
KIND:     Deployment
VERSION:  extensions/v1beta1

DESCRIPTION:
...


$ kubectl explain hpa.spec
KIND:     HorizontalPodAutoscaler
VERSION:  autoscaling/v1

RESOURCE: spec <Object>

DESCRIPTION:
...


$ kubectl explain hpa.spec.maxReplicas
KIND:     HorizontalPodAutoscaler
VERSION:  autoscaling/v1

FIELD:    maxReplicas <integer>

DESCRIPTION:
...


$ kubectl explain hpa.spec --recursive
KIND:     HorizontalPodAutoscaler
VERSION:  autoscaling/v1

RESOURCE: spec <Object>

DESCRIPTION:
     behaviour of autoscaler. More info:
     https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.

     specification of a horizontal pod autoscaler.

FIELDS:
   maxReplicas	<integer>
   minReplicas	<integer>
   scaleTargetRef	<Object>
      apiVersion	<string>
      kind	<string>
      name	<string>
   targetCPUUtilizationPercentage	<integer>
```

**Release note**:

```release-note
Kubectl explain now prints out the Kind and API version of the resource being explained
```
2017-12-15 08:12:28 -08:00
.github Merge pull request #54114 from xiangpengzhao/fix-pr-template 2017-10-30 18:37:06 -07:00
api Mark Flexvolume as GA 2017-12-12 14:53:40 -05:00
build update build/root/WORKSPACE and cluster/images/hyperkube/Makefile for the new tag 2017-11-29 14:15:58 -05:00
cluster Merge pull request #56217 from Cynerva/gkk/docker-logins 2017-12-14 23:37:39 -08:00
cmd Merge pull request #56364 from stewart-yu/codeClean 2017-12-15 02:04:40 -08:00
docs Merge pull request #56961 from danielqsj/remove_fed_doc 2017-12-14 21:34:08 -08:00
examples Update generated files 2017-11-09 12:14:08 +01:00
Godeps Merge pull request #56161 from ericchiang/go-jose-import 2017-12-15 04:33:38 -08:00
hack Merge pull request #56200 from stewart-yu/testPriority 2017-12-14 23:37:51 -08:00
logo Don't use strokes in the logo SVG 2017-10-12 09:38:56 -07:00
pkg Merge pull request #55689 from luksa/kubectl_explain_kind_version 2017-12-15 08:12:28 -08:00
plugin Merge pull request #55853 from guangxuli/fix_scheduler_test 2017-12-15 02:04:45 -08:00
staging Merge pull request #55296 from hzxuzhonghu/fix-1 2017-12-15 04:33:49 -08:00
test Merge pull request #56328 from sttts/sttts-openapi-aggregation-integration-test 2017-12-14 23:37:48 -08:00
third_party Update generated files 2017-11-09 12:14:08 +01:00
translations Merge pull request #47584 from zjj2wry/translate 2017-11-15 23:57:28 -08:00
vendor Merge pull request #56161 from ericchiang/go-jose-import 2017-12-15 04:33:38 -08:00
.bazelrc
.generated_files
.gitattributes Hide openapi-spec in diffs 2017-11-04 23:16:04 -07:00
.gitignore
.kazelcfg.json
BUILD.bazel
CHANGELOG-1.2.md
CHANGELOG-1.3.md
CHANGELOG-1.4.md Update invalid TOC anchor of 1.4 CHANGELOG 2017-10-26 17:25:23 +08:00
CHANGELOG-1.5.md Regenerate CHANGELOG TOCs 2017-10-11 17:04:47 -04:00
CHANGELOG-1.6.md Update CHANGELOG-1.6.md for v1.6.13. 2017-11-22 14:06:09 -08:00
CHANGELOG-1.7.md Update CHANGELOG-1.7.md for v1.7.11. 2017-11-25 16:37:13 -05:00
CHANGELOG-1.8.md Update CHANGELOG-1.8.md for v1.8.5. 2017-12-07 09:10:33 -08:00
CHANGELOG-1.9.md Update CHANGELOG-1.9.md for v1.9.0-beta.2. 2017-12-07 12:52:08 -08:00
CHANGELOG.md Move 1.8.x release notes 2017-10-11 22:41:36 -04:00
code-of-conduct.md
CONTRIBUTING.md
labels.yaml
LICENSE
Makefile
Makefile.generated_files
OWNERS
OWNERS_ALIASES Create sig-autoscaling-maintainers alias 2017-11-17 17:57:33 +01:00
README.md
SUPPORT.md
Vagrantfile fix download link for fedora libvirt vagrant box 2017-11-18 22:26:57 +05:30
WORKSPACE

Kubernetes

Submit Queue Widget GoDoc Widget CII Best Practices


Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using Kubernetes

See our documentation on kubernetes.io.

Try our interactive tutorial.

Take a free course on Scalable Microservices with Kubernetes.

To start developing Kubernetes

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
$ go get -d k8s.io/kubernetes
$ cd $GOPATH/src/k8s.io/kubernetes
$ make
You have a working Docker environment.
$ git clone https://github.com/kubernetes/kubernetes
$ cd kubernetes
$ make quick-release

If you are less impatient, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.

Analytics