Commit Graph

128 Commits (f9af7e94a9aa5b3267f6948d5c6531428c4f7cfe)

Author SHA1 Message Date
Clayton Coleman 25e0a8f56c
Print the involved object in the event table as resource/name
The involved object is important and only some events include its
name in the message. Change the `Kind` column to `Object` and print
the object in `resource/name` form to allow copy and paste
to `kubectl get`. Also move the source field column to the right
of involved object since it is related.
2019-02-10 20:16:07 -05:00
wojtekt 73d14dede6 Promote Lease API to v1 2018-12-20 15:39:57 +01:00
k8s-ci-robot 2e80c3a0b2
Merge pull request #69874 from stewart-yu/patch-1
fix some wrong type in printers.go
2018-11-28 23:31:10 -08:00
zuoxiu.jm da9387131e prune internal clients from kubectl describer 2018-11-16 00:11:10 +08:00
k8s-ci-robot 68b4be3e19
Merge pull request #70775 from freehan/pod-ready-cli
add readiness gates in kubectl extended output for pods
2018-11-13 14:59:18 -08:00
k8s-ci-robot a88f2973e0
Merge pull request #70466 from Pingan2017/get-statefulset
Improve human-readable output of Deployments and StatefulSets
2018-11-13 14:59:08 -08:00
Pingan2017 182a66f9b7 add Ready column for kubectl get sts command 2018-11-10 10:40:33 +08:00
Minhan Xia c987e95282 add readiness gates column in the wide printout for pod 2018-11-07 16:45:49 -08:00
k8s-ci-robot 863a502c06
Merge pull request #70269 from WanLinghao/clean_describe
clean and move some code in pkg/printers/internalversion/
2018-11-01 22:16:35 -07:00
WanLinghao 462b4e190d clean unused functions in ./pkg/printers/internalversion/printers.go 2018-10-30 19:01:57 +08:00
k8s-ci-robot fb6716e83c
Merge pull request #67495 from islinwb/policy_psp
use PodSecurityPolicySpec of policy/v1beta1 instead of extensions/v1beta1
2018-10-29 08:31:15 -07:00
Jordan Liggitt d0577ace6b fixup extensions->apps references 2018-10-25 21:12:57 -04:00
Weibin Lin d02e3bd780 use PodSecurityPolicySpec of policy/v1beta1 instead of extensions/v1beta1 2018-10-18 10:18:13 +08:00
Stewart-YU a7f0e44916
fix some wrong type in printers.go
fix some wrong type in printers.go
2018-10-16 20:43:21 +08:00
Wei Huang da041ec5a9
`kubectl get priorityclass` prints value column 2018-10-10 12:18:42 -07:00
Ibrahim Mbaziira 6c3d9cd300
Add table printer for resource quotas 2018-10-09 20:00:28 +03:00
Mike Dame 17740a2857 Update printers to include changes from autoscaling/v2beta2 2018-08-27 11:07:52 -04:00
Tim Hockin 06b785ca52 Allow headless svc without ports to have endpoints
As cited in
https://github.com/kubernetes/dns/issues/174 - this is documented to
work, and I don't see why it shouldn't work.  We allowed the definition
of headless services without ports, but apparently nobody tested it very
well.

Manually tested clusterIP services with no ports - validation error.

Manually tested services with negative ports - validation error.

New tests failed, output inspected and verified.  Now pass.
2018-08-21 08:36:27 -07:00
Clayton Coleman 2f275b72b2
Improve the output of `kubectl get events`
Events have long shown the most data of the core objects in their output, but that data is of varying use
to a user. Following the principle that events are intended for the system to communicate information back
to the user, and that Message is the primary human readable field, this commit alters the default columns
to ensure event is shown with the most width.

1. Events are no longer sorted in the printer (this was a bug and was broken with paging and server side
   rendering)
2. Only the last seen, type, reason, kind, and message fields are shown by default, which makes the
   message prominent
3. Source, subobject, count, and first seen are only shown under `-o wide`
4. The duration fields were changed to be the more precise output introduced for job duration (2-3 sig figs)
2018-07-26 16:12:32 -04:00
Jordan Liggitt dc5f615152
Send correct headers for pod printing 2018-07-19 20:55:00 -04:00
Daisuke Taniwaki 7cb10e141d
Fix DeletionTimestamp printing 2018-07-04 05:19:34 +09:00
Kubernetes Submit Queue 41c95725b4
Merge pull request #65463 from smarterclayton/jobs_output
Automatic merge from submit-queue (batch tested with PRs 64575, 65120, 65463, 65434, 65522). 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>.

Improve job describe and get output

For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.

```
Start Time:     Mon, 25 Jun 2018 20:00:05 -0400
Completed At:   Mon, 25 Jun 2018 21:00:34 -0400
Duration:       60m
```

This is more useful than the current output:

```
NAME                                   DESIRED   SUCCESSFUL   AGE
image-mirror-origin-v3.10-1529982000   1         1            54m
image-mirror-origin-v3.11-1529982000   1         1            54m
image-pruner-1529971200                1         1            3h
```

```release-note
Improve the display of jobs in `kubectl get` and `kubectl describe` to emphasize progress and duration.
```
2018-06-28 02:20:20 -07:00
wojtekt b95db13ecc Create coordination registry 2018-06-27 13:30:13 +02:00
Clayton Coleman c819a16284
Improve job describe and get output
For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.
2018-06-26 09:37:29 -04:00
Dr. Stefan Schimanski ebbfaf3869 printers: fix json types – int64 is only allowed integer
We have the invariant in apimachinery that all integers in JSON are int64.
We panic on other types on deepcopy and possibly at other occasions.
2018-06-02 09:43:20 +00:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
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>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
ceshihao 6b94e872c6 Make pod status to "Running" if there is at least one container still reporting as "Running" status 2018-04-19 14:24:18 +08:00
Slava Semushin 8a7d5707d5 PSP: move internal types from extensions to policy. 2018-04-11 18:35:09 +02:00
Wang Guoliang 89669283fe should use time.Since instead of time.Now().Sub 2018-04-10 12:05:51 +08:00
Jordan Liggitt 3b8a570437
Restore show-kind function when printing multiple kinds 2018-04-01 00:24:25 -04:00
Di Xu a6b567e8b2 include node internal ip as additional information for kubectl 2018-03-23 13:59:22 +08:00
Slava Semushin 4621948ed8 kubectl get psp: modify header to show PRIV instead of DATA for column with privileged flag. 2018-03-13 16:08:33 +01:00
Maciej Szulik 5630d29552
Add missing table converters for server side printing 2018-02-28 17:27:45 +01:00
Beata Skiba d003550bd2 Differentiate between target and target average value 2018-02-26 18:46:43 +01:00
Beata Skiba afe1724695 Add support for external metrics in kubectl 2018-02-26 13:54:35 +01:00
Kubernetes Submit Queue 0f9b5e9fc0
Merge pull request #60269 from smarterclayton/crd_printing
Automatic merge from submit-queue (batch tested with PRs 60324, 60269, 59771, 60314, 59941). 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>.

Implement a stub server printer for CRDs

This wires up TableConvertor to CRDs and puts a basic implementation in place for custom paths. However, since our OpenAPISchema can't store OpenAPI extension fields there is no way to expose the custom column piece that get.go supports today (`x-kubernetes-print-columns`). That piece can be implemented separately and needs discussion.

As this is purely exposing the default interface, very low risk. Will add an e2e test that covers this under a registered CRD.

@soltysh @sttts @kubernetes/sig-api-machinery-pr-reviews

A couple of options for wiring up the actual definition:

1. add a new "extensions" map to spec.validation
   1. Downside: won't handle future child nested fields, not the correct schema
2. try to change the OpenAPISchema3 field to support extensions
   1. Would require a breaking protobuf change, is also very difficult
   2. Could store the entire schema as opaque JSON and then parse on load (might be the right thing anyway)
3. Support this as an annotation in 1.11 - `alpha.customresource.k8s.io/x-kubernetes-print-columns` like the CLI

Part of #58536
2018-02-24 20:01:39 -08:00
Clayton Coleman fb6b1c0fba
CRD should have server side printing
Add the plumbing for server side printing. Not connected until we
support a way to get OpenAPI extensions from CRDs.
2018-02-24 13:44:05 -05:00
Clayton Coleman 1970f89e43
Namespace should support table printing 2018-02-22 11:37:40 -05:00
Kubernetes Submit Queue 9ee71b720e
Merge pull request #59059 from smarterclayton/move_partial_object
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). 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>.

Promote v1alpha1 meta to v1beta1

No code changes, just renames. We can discuss if there are any field / naming changes here or in a follow-up

Parent #58536
Fixes #53224
Prereq to #55637

@kubernetes/sig-api-machinery-pr-reviews @deads2k

```release-note
The `meta.k8s.io/v1alpha1` objects for retrieving tabular responses from the server (`Table`) or fetching just the `ObjectMeta` for an object (as `PartialObjectMetadata`) are now beta as part of `meta.k8s.io/v1beta1`.  Clients may request alternate representations of normal Kubernetes objects by passing an `Accept` header like `application/json;as=Table;g=meta.k8s.io;v=v1beta1` or `application/json;as=PartialObjectMetadata;g=meta.k8s.io;v1=v1beta1`.  Older servers will ignore this representation or return an error if it is not available.  Clients may request fallback to the normal object by adding a non-qualified mime-type to their `Accept` header like `application/json` - the server will then respond with either the alternate representation if it is supported or the fallback mime-type which is the normal object response.
```
2018-02-05 12:40:37 -08:00
Kubernetes Submit Queue f65f07225f
Merge pull request #59169 from NickrenREN/kubectl-pv-terminating
Automatic merge from submit-queue (batch tested with PRs 55439, 58564, 59028, 59169, 59259). 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>.

kubectl: Add Terminating state to PVs

kubectl shows PV `Terminating` status, just like Pod and [PVC](https://github.com/kubernetes/kubernetes/pull/55873)

**What this PR does / why we need it**:
We will postpone PV deletion if it is bound to a PVC, see #58743, so we may keep PV waiting for deletion for a longer time than before so users should know what is going on.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref: https://github.com/kubernetes/community/pull/1608

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
/sig cli
/sig storage
/assign @jsafrane 

I tested this PR on my local host.
```
nickren@nickren-14:~/test/test$ kubectl delete -f pv.yaml 
persistentvolume "task-pv-volume" deleted
nickren@nickren-14:~/test/test$ kubectl get pv
NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                   STORAGECLASS   REASON    AGE
task-pv-volume   1Gi        RWO            Delete           Terminating   default/task-pv-claim   standard                 27s
nickren@nickren-14:~/test/test$ kubectl describe pv task-pv-volume
Name:            task-pv-volume
Labels:          type=local
Annotations:     pv.kubernetes.io/bound-by-controller=yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    standard
Status:          Terminating (since Thu, 01 Feb 2018 13:18:51 +0800)
Claim:           default/task-pv-claim
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Message:         
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /tmp/data
    HostPathType:  
Events:            <none>
```
2018-02-02 17:17:42 -08:00
Clayton Coleman d07a608607 Promote v1alpha1 meta to v1beta1
No code changes, just renames
2018-02-02 14:00:45 -05:00
NickrenREN 7364c4c019 Add Terminating state to PVs 2018-02-02 23:33:45 +08:00
Bobby (Babak) Salamat 384a86caa9 Add NominatedNodeName to PodStatus 2018-01-30 13:13:57 -08:00
Kubernetes Submit Queue 1dbb4197c4
Merge pull request #56331 from shiywang/fix_indent
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>.

Remove spaces from kubectl describe hpa

Fixes comment left here: https://github.com/kubernetes/kubernetes/pull/36033#discussion_r108020701

@kubernetes/sig-cli-pr-reviews  @DirectXMan12 

```release-note
remove spaces from kubectl describe hpa
```
2018-01-16 00:10:26 -08:00
Shiyang Wang f42f79edb0 fix spaces around the / 2017-11-27 18:28:18 +08:00
pospispa 22370d925e kubectl: Add Terminating state to PVCs
kubectl should show something when a PVC has a deletion timestamp and is
waiting for deletion. This patch follows Pod - it adds Terminating state.

For easier discovery of errors, finalizers are printed in `kubectl describe
pvc`.
2017-11-16 12:39:15 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Nikhita Raghunath 3b0b95ecbf Remove TPR remnants
There are still TPR types and generated client
in the extensions group. It is better to clean
that up, now that it has been removed from master.
2017-11-03 21:15:58 +05:30
Maru Newby adc338d330 Remove all traces of federation 2017-10-26 13:37:37 -07:00
zhangxiaoyu-zidif 46e33f4234 Delete redundant err check 2017-10-23 13:46:04 +08:00