Skip to content

Commit

Permalink
add server-side print docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Mar 7, 2018
1 parent 7dd01bd commit 60637c3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/reference/kubectl/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,29 @@ NAME RSRC
submit-queue 610995
```

#### Server-side columns

`kubectl` supports receiving specific column information from the server about objects.
This means that for any given resource, the server will return columns and rows relevant to that resource, for the client to print.
This allows for consistent human-readable output across clients used against the same cluster, by having the server encapsulate the details of printing.

All functionality of the `get` command is unaffected by using this feature.
Clients are still able to return sorted output, perform template printing, print custom-columns, etc.

To output object information using this feature, you can add the `--experimental-server-print` flag to a supported `kubectl` command.

##### Examples

```shell
$ kubectl get pods <pod-name> --experimental-server-print
```

The result of running this command is:

```shell
NAME READY STATUS RESTARTS AGE
pod-name 1/1 Running 0 1m

### Sorting list objects

To output objects to a sorted list in your terminal window, you can add the `--sort-by` flag to a supported `kubectl` command. Sort your objects by specifying any numeric or string field with the `--sort-by` flag. To specify a field, use a [jsonpath](/docs/user-guide/jsonpath) expression.
Expand Down Expand Up @@ -245,6 +268,9 @@ $ kubectl get ds --include-uninitialized
// List all pods running on node server01
$ kubectl get pods --field-selector=spec.nodeName=server01
// List all pods in plain-text output format, delegating the details of printing to the server
$ kubectl get pods --experimental-server-print
```

`kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default.
Expand Down

0 comments on commit 60637c3

Please sign in to comment.