From 6bfce07bb81323db0ef778b6575c1cf429670aba Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Wed, 7 Mar 2018 14:29:41 -0500 Subject: [PATCH] add server-side print docs --- docs/reference/kubectl/overview.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/reference/kubectl/overview.md b/docs/reference/kubectl/overview.md index 5ae7485c5bc8a..70221e2c24354 100644 --- a/docs/reference/kubectl/overview.md +++ b/docs/reference/kubectl/overview.md @@ -192,6 +192,26 @@ 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. + +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 --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. @@ -245,6 +265,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.