From f4f04e2985d5624240e8b56e7bedb25e9c8b8691 Mon Sep 17 00:00:00 2001 From: Thomas Liu Date: Wed, 13 Apr 2016 15:11:31 -0700 Subject: [PATCH] Include genyaml in update/verify generated docs scripts --- .generated_docs | 33 ++++++++++++ docs/yaml/kubectl/kubectl_annotate.yaml | 8 +++ docs/yaml/kubectl/kubectl_apply.yaml | 8 +++ docs/yaml/kubectl/kubectl_autoscale.yaml | 8 +++ docs/yaml/kubectl/kubectl_cluster-info.yaml | 5 ++ docs/yaml/kubectl/kubectl_convert.yaml | 8 +++ docs/yaml/kubectl/kubectl_create.yaml | 8 +++ docs/yaml/kubectl/kubectl_delete.yaml | 8 +++ docs/yaml/kubectl/kubectl_describe.yaml | 10 +++- docs/yaml/kubectl/kubectl_edit.yaml | 8 +++ docs/yaml/kubectl/kubectl_explain.yaml | 6 ++- docs/yaml/kubectl/kubectl_expose.yaml | 6 ++- docs/yaml/kubectl/kubectl_get.yaml | 10 +++- docs/yaml/kubectl/kubectl_label.yaml | 8 +++ docs/yaml/kubectl/kubectl_logs.yaml | 4 ++ docs/yaml/kubectl/kubectl_patch.yaml | 8 +++ docs/yaml/kubectl/kubectl_replace.yaml | 8 +++ docs/yaml/kubectl/kubectl_rolling-update.yaml | 16 +++--- docs/yaml/kubectl/kubectl_run.yaml | 53 ++++++++++++------- docs/yaml/kubectl/kubectl_scale.yaml | 8 +++ docs/yaml/kubectl/kubectl_stop.yaml | 8 +++ hack/after-build/verify-generated-docs.sh | 1 + hack/lib/golang.sh | 1 + hack/lib/util.sh | 7 ++- hack/update-generated-docs.sh | 2 +- hack/verify-generated-docs.sh | 2 +- 26 files changed, 219 insertions(+), 33 deletions(-) diff --git a/.generated_docs b/.generated_docs index 602bfa62d8e..9160885dee9 100644 --- a/.generated_docs +++ b/.generated_docs @@ -106,3 +106,36 @@ docs/user-guide/kubectl/kubectl_run.md docs/user-guide/kubectl/kubectl_scale.md docs/user-guide/kubectl/kubectl_uncordon.md docs/user-guide/kubectl/kubectl_version.md +docs/yaml/kubectl/kubectl.yaml +docs/yaml/kubectl/kubectl_annotate.yaml +docs/yaml/kubectl/kubectl_api-versions.yaml +docs/yaml/kubectl/kubectl_apply.yaml +docs/yaml/kubectl/kubectl_attach.yaml +docs/yaml/kubectl/kubectl_autoscale.yaml +docs/yaml/kubectl/kubectl_cluster-info.yaml +docs/yaml/kubectl/kubectl_config.yaml +docs/yaml/kubectl/kubectl_convert.yaml +docs/yaml/kubectl/kubectl_cordon.yaml +docs/yaml/kubectl/kubectl_create.yaml +docs/yaml/kubectl/kubectl_delete.yaml +docs/yaml/kubectl/kubectl_describe.yaml +docs/yaml/kubectl/kubectl_drain.yaml +docs/yaml/kubectl/kubectl_edit.yaml +docs/yaml/kubectl/kubectl_exec.yaml +docs/yaml/kubectl/kubectl_explain.yaml +docs/yaml/kubectl/kubectl_expose.yaml +docs/yaml/kubectl/kubectl_get.yaml +docs/yaml/kubectl/kubectl_label.yaml +docs/yaml/kubectl/kubectl_logs.yaml +docs/yaml/kubectl/kubectl_namespace.yaml +docs/yaml/kubectl/kubectl_patch.yaml +docs/yaml/kubectl/kubectl_port-forward.yaml +docs/yaml/kubectl/kubectl_proxy.yaml +docs/yaml/kubectl/kubectl_replace.yaml +docs/yaml/kubectl/kubectl_rolling-update.yaml +docs/yaml/kubectl/kubectl_rollout.yaml +docs/yaml/kubectl/kubectl_run.yaml +docs/yaml/kubectl/kubectl_scale.yaml +docs/yaml/kubectl/kubectl_stop.yaml +docs/yaml/kubectl/kubectl_uncordon.yaml +docs/yaml/kubectl/kubectl_version.yaml diff --git a/docs/yaml/kubectl/kubectl_annotate.yaml b/docs/yaml/kubectl/kubectl_annotate.yaml index bfcdf117692..2bdedb5b998 100644 --- a/docs/yaml/kubectl/kubectl_annotate.yaml +++ b/docs/yaml/kubectl/kubectl_annotate.yaml @@ -22,6 +22,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file identifying the resource to update the annotation +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: no-headers default_value: "false" usage: When using the default output, don't print headers. @@ -39,6 +43,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: resource-version usage: | If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. diff --git a/docs/yaml/kubectl/kubectl_apply.yaml b/docs/yaml/kubectl/kubectl_apply.yaml index 4a5d40f8900..ad26ac944a4 100644 --- a/docs/yaml/kubectl/kubectl_apply.yaml +++ b/docs/yaml/kubectl/kubectl_apply.yaml @@ -8,6 +8,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to file that contains the configuration to apply +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | @@ -15,6 +19,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: schema-cache-dir default_value: ~/.kube/schema usage: | diff --git a/docs/yaml/kubectl/kubectl_autoscale.yaml b/docs/yaml/kubectl/kubectl_autoscale.yaml index f9acae9e0fd..863190d6aad 100644 --- a/docs/yaml/kubectl/kubectl_autoscale.yaml +++ b/docs/yaml/kubectl/kubectl_autoscale.yaml @@ -24,6 +24,10 @@ options: default_value: horizontalpodautoscaler/v1beta1 usage: | The name of the API generator to use. Currently there is only 1 generator. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: max default_value: "-1" usage: | @@ -48,6 +52,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: save-config default_value: "false" usage: | diff --git a/docs/yaml/kubectl/kubectl_cluster-info.yaml b/docs/yaml/kubectl/kubectl_cluster-info.yaml index 471fe1bbc81..a70904ec6ef 100644 --- a/docs/yaml/kubectl/kubectl_cluster-info.yaml +++ b/docs/yaml/kubectl/kubectl_cluster-info.yaml @@ -2,6 +2,11 @@ name: cluster-info synopsis: Display cluster info description: | Display addresses of the master and services with label kubernetes.io/cluster-service=true +options: +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] inherited_options: - name: alsologtostderr default_value: "false" diff --git a/docs/yaml/kubectl/kubectl_convert.yaml b/docs/yaml/kubectl/kubectl_convert.yaml index 84d4c249658..a8f73315c40 100644 --- a/docs/yaml/kubectl/kubectl_convert.yaml +++ b/docs/yaml/kubectl/kubectl_convert.yaml @@ -16,6 +16,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to file to need to get converted. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: local default_value: "true" usage: | @@ -30,6 +34,10 @@ options: - name: output-version usage: | Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: schema-cache-dir default_value: ~/.kube/schema usage: | diff --git a/docs/yaml/kubectl/kubectl_create.yaml b/docs/yaml/kubectl/kubectl_create.yaml index 07299bfeb2d..3f3973191df 100644 --- a/docs/yaml/kubectl/kubectl_create.yaml +++ b/docs/yaml/kubectl/kubectl_create.yaml @@ -10,6 +10,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to file to use to create the resource +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | @@ -17,6 +21,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: save-config default_value: "false" usage: | diff --git a/docs/yaml/kubectl/kubectl_delete.yaml b/docs/yaml/kubectl/kubectl_delete.yaml index 44f0a7de649..8d1f3acc2fc 100644 --- a/docs/yaml/kubectl/kubectl_delete.yaml +++ b/docs/yaml/kubectl/kubectl_delete.yaml @@ -32,10 +32,18 @@ options: default_value: "false" usage: | Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | Output mode. Use "-o name" for shorter output (resource/name). +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: selector shorthand: l usage: Selector (label query) to filter on. diff --git a/docs/yaml/kubectl/kubectl_describe.yaml b/docs/yaml/kubectl/kubectl_describe.yaml index 061b4e5cc43..a88077c48dc 100644 --- a/docs/yaml/kubectl/kubectl_describe.yaml +++ b/docs/yaml/kubectl/kubectl_describe.yaml @@ -14,7 +14,7 @@ description: |- Possible resource types include (case insensitive): pods (po), services (svc), deployments, replicasets (rs), replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns), - serviceaccounts, ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, + serviceaccounts (sa), ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, componentstatuses (cs), endpoints (ep), and secrets. options: - name: filename @@ -22,6 +22,14 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file containing the resource to describe +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: selector shorthand: l usage: Selector (label query) to filter on diff --git a/docs/yaml/kubectl/kubectl_edit.yaml b/docs/yaml/kubectl/kubectl_edit.yaml index 73da18d8c94..785244bffd4 100644 --- a/docs/yaml/kubectl/kubectl_edit.yaml +++ b/docs/yaml/kubectl/kubectl_edit.yaml @@ -26,6 +26,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to file to use to edit the resource +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o default_value: yaml @@ -36,6 +40,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: save-config default_value: "false" usage: | diff --git a/docs/yaml/kubectl/kubectl_explain.yaml b/docs/yaml/kubectl/kubectl_explain.yaml index 90da3310fa0..c1c91f1bbb2 100644 --- a/docs/yaml/kubectl/kubectl_explain.yaml +++ b/docs/yaml/kubectl/kubectl_explain.yaml @@ -6,9 +6,13 @@ description: |- Possible resource types include (case insensitive): pods (po), services (svc), deployments, replicasets (rs), replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns), - serviceaccounts, ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, + serviceaccounts (sa), ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, componentstatuses (cs), endpoints (ep), and secrets. options: +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: recursive default_value: "false" usage: Print the fields of fields (Currently only 1 level deep) diff --git a/docs/yaml/kubectl/kubectl_expose.yaml b/docs/yaml/kubectl/kubectl_expose.yaml index 088813b9182..5cf59467943 100644 --- a/docs/yaml/kubectl/kubectl_expose.yaml +++ b/docs/yaml/kubectl/kubectl_expose.yaml @@ -1,6 +1,6 @@ name: expose synopsis: | - Take a replication controller, service, or pod and expose it as a new Kubernetes Service + Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service description: "Take a deployment, service, replica set, replication controller, or pod and expose it as a new Kubernetes service.\n\nLooks up a deployment, service, replica set, replication controller or pod by name and uses the selector\nfor that @@ -64,6 +64,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: save-config default_value: "false" usage: | diff --git a/docs/yaml/kubectl/kubectl_get.yaml b/docs/yaml/kubectl/kubectl_get.yaml index 3f82817137e..a26ed32e0d4 100644 --- a/docs/yaml/kubectl/kubectl_get.yaml +++ b/docs/yaml/kubectl/kubectl_get.yaml @@ -6,7 +6,7 @@ description: |- Possible resource types include (case insensitive): pods (po), services (svc), deployments, replicasets (rs), replicationcontrollers (rc), nodes (no), events (ev), limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc), resourcequotas (quota), namespaces (ns), - serviceaccounts, ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, + serviceaccounts (sa), ingresses (ing), horizontalpodautoscalers (hpa), daemonsets (ds), configmaps, componentstatuses (cs), endpoints (ep), and secrets. By specifying the output as 'template' and providing a Go template as the value @@ -25,6 +25,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file identifying the resource to get from a server. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: label-columns shorthand: L default_value: '[]' @@ -40,6 +44,10 @@ options: - name: output-version usage: | Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: selector shorthand: l usage: Selector (label query) to filter on diff --git a/docs/yaml/kubectl/kubectl_label.yaml b/docs/yaml/kubectl/kubectl_label.yaml index 2609658245d..9628f7e60f2 100644 --- a/docs/yaml/kubectl/kubectl_label.yaml +++ b/docs/yaml/kubectl/kubectl_label.yaml @@ -20,6 +20,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file identifying the resource to update the labels +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: no-headers default_value: "false" usage: When using the default output, don't print headers. @@ -37,6 +41,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: resource-version usage: | If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. diff --git a/docs/yaml/kubectl/kubectl_logs.yaml b/docs/yaml/kubectl/kubectl_logs.yaml index 3ed27a434dc..18077890a1e 100644 --- a/docs/yaml/kubectl/kubectl_logs.yaml +++ b/docs/yaml/kubectl/kubectl_logs.yaml @@ -10,6 +10,10 @@ options: shorthand: f default_value: "false" usage: Specify if the logs should be streamed. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: interactive default_value: "false" usage: If true, prompt the user for input when required. diff --git a/docs/yaml/kubectl/kubectl_patch.yaml b/docs/yaml/kubectl/kubectl_patch.yaml index 1650e80a86c..990cd0fe272 100644 --- a/docs/yaml/kubectl/kubectl_patch.yaml +++ b/docs/yaml/kubectl/kubectl_patch.yaml @@ -12,6 +12,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file identifying the resource to update +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | @@ -22,6 +26,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: type default_value: strategic usage: | diff --git a/docs/yaml/kubectl/kubectl_replace.yaml b/docs/yaml/kubectl/kubectl_replace.yaml index a171a1f198d..89806cbaa5b 100644 --- a/docs/yaml/kubectl/kubectl_replace.yaml +++ b/docs/yaml/kubectl/kubectl_replace.yaml @@ -25,6 +25,10 @@ options: default_value: "-1" usage: | Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | @@ -32,6 +36,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: save-config default_value: "false" usage: | diff --git a/docs/yaml/kubectl/kubectl_rolling-update.yaml b/docs/yaml/kubectl/kubectl_rolling-update.yaml index 95dc7b7dbfb..eab9c92c9db 100644 --- a/docs/yaml/kubectl/kubectl_rolling-update.yaml +++ b/docs/yaml/kubectl/kubectl_rolling-update.yaml @@ -26,6 +26,10 @@ options: - name: image usage: | Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: no-headers default_value: "false" usage: When using the default output, don't print headers. @@ -38,8 +42,8 @@ options: Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). - name: poll-interval default_value: 3s - usage: "Time delay between polling for replication controller status after the update. - Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n" + usage: | + Time delay between polling for replication controller status after the update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - name: rollback default_value: "false" usage: | @@ -65,12 +69,12 @@ options: Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. - name: timeout default_value: 5m0s - usage: "Max time to wait for a replication controller to update before giving up. - Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n" + usage: | + Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - name: update-period default_value: 1m0s - usage: "Time to wait between updating pods. Valid time units are \"ns\", \"us\" - (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\n" + usage: | + Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". - name: validate default_value: "true" usage: | diff --git a/docs/yaml/kubectl/kubectl_run.yaml b/docs/yaml/kubectl/kubectl_run.yaml index b295f5cb3f2..f7ad3a81c86 100644 --- a/docs/yaml/kubectl/kubectl_run.yaml +++ b/docs/yaml/kubectl/kubectl_run.yaml @@ -32,6 +32,10 @@ options: The host port mapping for the container port. To demonstrate a single-machine container. - name: image usage: The image for the container to run. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: labels shorthand: l usage: Labels to apply to the pod(s). @@ -172,24 +176,35 @@ inherited_options: - name: vmodule usage: | comma-separated list of pattern=N settings for file-filtered logging -example: "# Start a single instance of nginx.\nkubectl run nginx --image=nginx\n\n# - Start a single instance of hazelcast and let the container expose port 5701 .\nkubectl - run hazelcast --image=hazelcast --port=5701\n\n# Start a single instance of hazelcast - and set environment variables \"DNS_DOMAIN=cluster\" and \"POD_NAMESPACE=default\" - in the container.\nkubectl run hazelcast --image=hazelcast --env=\"DNS_DOMAIN=cluster\" - --env=\"POD_NAMESPACE=default\"\n\n# Start a replicated instance of nginx.\nkubectl - run nginx --image=nginx --replicas=5\n\n# Dry run. Print the corresponding API objects - without creating them.\nkubectl run nginx --image=nginx --dry-run\n\n# Start a single - instance of nginx, but overload the spec of the deployment with a partial set of - values parsed from JSON.\nkubectl run nginx --image=nginx --overrides='{ \"apiVersion\": - \"v1\", \"spec\": { ... } }'\n\n# Start a single instance of busybox and keep it - in the foreground, don't restart it if it exits.\nkubectl run -i --tty busybox --image=busybox - --restart=Never\n\n# Start the nginx container using the default command, but use - custom arguments (arg1 .. argN) for that command.\nkubectl run nginx --image=nginx - -- ... \n\n# Start the nginx container using a different command - and custom arguments.\nkubectl run nginx --image=nginx --command -- - ... \n\n# Start the perl container to compute π to 2000 places and print it - out.\nkubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle - 'print bpi(2000)'" +example: |- + # Start a single instance of nginx. + kubectl run nginx --image=nginx + + # Start a single instance of hazelcast and let the container expose port 5701 . + kubectl run hazelcast --image=hazelcast --port=5701 + + # Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container. + kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default" + + # Start a replicated instance of nginx. + kubectl run nginx --image=nginx --replicas=5 + + # Dry run. Print the corresponding API objects without creating them. + kubectl run nginx --image=nginx --dry-run + + # Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON. + kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }' + + # Start a single instance of busybox and keep it in the foreground, don't restart it if it exits. + kubectl run -i --tty busybox --image=busybox --restart=Never + + # Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command. + kubectl run nginx --image=nginx -- ... + + # Start the nginx container using a different command and custom arguments. + kubectl run nginx --image=nginx --command -- ... + + # Start the perl container to compute π to 2000 places and print it out. + kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)' see_also: - kubectl diff --git a/docs/yaml/kubectl/kubectl_scale.yaml b/docs/yaml/kubectl/kubectl_scale.yaml index eba87d282ae..66129c0ae41 100644 --- a/docs/yaml/kubectl/kubectl_scale.yaml +++ b/docs/yaml/kubectl/kubectl_scale.yaml @@ -18,6 +18,10 @@ options: default_value: '[]' usage: | Filename, directory, or URL to a file identifying the resource to set a new size +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | @@ -25,6 +29,10 @@ options: - name: record default_value: "false" usage: Record current kubectl command in the resource annotation. +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: replicas default_value: "-1" usage: The new desired number of replicas. Required. diff --git a/docs/yaml/kubectl/kubectl_stop.yaml b/docs/yaml/kubectl/kubectl_stop.yaml index 06dc4add741..a0d6e78a3d7 100644 --- a/docs/yaml/kubectl/kubectl_stop.yaml +++ b/docs/yaml/kubectl/kubectl_stop.yaml @@ -25,10 +25,18 @@ options: - name: ignore-not-found default_value: "false" usage: Treat "resource not found" as a successful stop. +- name: include-extended-apis + default_value: "true" + usage: | + If true, include definitions of new APIs via calls to the API server. [default true] - name: output shorthand: o usage: | Output mode. Use "-o name" for shorter output (resource/name). +- name: recursive + shorthand: R + default_value: "false" + usage: If true, process directory recursively. - name: selector shorthand: l usage: Selector (label query) to filter on. diff --git a/hack/after-build/verify-generated-docs.sh b/hack/after-build/verify-generated-docs.sh index 10cf34305fe..8087772e9bf 100755 --- a/hack/after-build/verify-generated-docs.sh +++ b/hack/after-build/verify-generated-docs.sh @@ -27,6 +27,7 @@ kube::golang::setup_env gendocs=$(kube::util::find-binary "gendocs") genkubedocs=$(kube::util::find-binary "genkubedocs") genman=$(kube::util::find-binary "genman") +genyaml=$(kube::util::find-binary "genyaml") genbashcomp=$(kube::util::find-binary "genbashcomp") mungedocs=$(kube::util::find-binary "mungedocs") diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 4cbb3560f2a..42fe7115772 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -101,6 +101,7 @@ kube::golang::test_targets() { cmd/gendocs cmd/genkubedocs cmd/genman + cmd/genyaml cmd/mungedocs cmd/genbashcomp cmd/genconversion diff --git a/hack/lib/util.sh b/hack/lib/util.sh index a287548e3ca..6163743112c 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -19,7 +19,7 @@ kube::util::sortable_date() { } # this mimics the behavior of linux realpath which is not shipped by default with -# mac OS X +# mac OS X kube::util::realpath() { [[ $1 = /* ]] && echo "$1" | sed 's/\/$//' || echo "$PWD/${1#./}" | sed 's/\/$//' } @@ -156,7 +156,7 @@ kube::util::host_platform() { ppc64le*) host_arch=ppc64le ;; - *) + *) kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, s390x or ppc64le." exit 1 ;; @@ -185,6 +185,7 @@ kube::util::gen-docs() { gendocs=$(kube::util::find-binary "gendocs") genkubedocs=$(kube::util::find-binary "genkubedocs") genman=$(kube::util::find-binary "genman") + genyaml=$(kube::util::find-binary "genyaml") genbashcomp=$(kube::util::find-binary "genbashcomp") mkdir -p "${dest}/docs/user-guide/kubectl/" @@ -197,6 +198,8 @@ kube::util::gen-docs() { "${genkubedocs}" "${dest}/docs/admin/" "kubelet" mkdir -p "${dest}/docs/man/man1/" "${genman}" "${dest}/docs/man/man1/" + mkdir -p "${dest}/docs/yaml/kubectl/" + "${genyaml}" "${dest}/docs/yaml/kubectl/" mkdir -p "${dest}/contrib/completions/bash/" "${genbashcomp}" "${dest}/contrib/completions/bash/" diff --git a/hack/update-generated-docs.sh b/hack/update-generated-docs.sh index 34a9561cfce..13bc8c0cb60 100755 --- a/hack/update-generated-docs.sh +++ b/hack/update-generated-docs.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genbashcomp cmd/mungedocs +"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genyaml cmd/genbashcomp cmd/mungedocs "${KUBE_ROOT}/hack/after-build/update-generated-docs.sh" "$@" diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index a8f364bd885..7d2605dcf7c 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genbashcomp cmd/mungedocs +"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs cmd/genkubedocs cmd/genman cmd/genyaml cmd/genbashcomp cmd/mungedocs "${KUBE_ROOT}/hack/after-build/verify-generated-docs.sh" "$@"