diff --git a/pkg/cmd/annotate/annotate.go b/pkg/cmd/annotate/annotate.go index e4c2ce0a..2ce6bc2b 100644 --- a/pkg/cmd/annotate/annotate.go +++ b/pkg/cmd/annotate/annotate.go @@ -81,7 +81,7 @@ type AnnotateOptions struct { var ( annotateLong = templates.LongDesc(i18n.T(` - Update the annotations on one or more resources + Update the annotations on one or more resources. All Kubernetes objects support the ability to store additional data with the object as annotations. Annotations are key/value pairs that can be larger than labels and include @@ -93,24 +93,24 @@ var ( the server the command will fail.`)) annotateExample = templates.Examples(i18n.T(` - # Update pod 'foo' with the annotation 'description' and the value 'my frontend'. + # Update pod 'foo' with the annotation 'description' and the value 'my frontend' # If the same annotation is set multiple times, only the last value will be applied kubectl annotate pods foo description='my frontend' # Update a pod identified by type and name in "pod.json" kubectl annotate -f pod.json description='my frontend' - # Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value. + # Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value kubectl annotate --overwrite pods foo description='my frontend running nginx' # Update all pods in the namespace kubectl annotate pods --all description='my frontend running nginx' - # Update pod 'foo' only if the resource is unchanged from version 1. + # Update pod 'foo' only if the resource is unchanged from version 1 kubectl annotate pods foo description='my frontend running nginx' --resource-version=1 - # Update pod 'foo' by removing an annotation named 'description' if it exists. - # Does not require the --overwrite flag. + # Update pod 'foo' by removing an annotation named 'description' if it exists + # Does not require the --overwrite flag kubectl annotate pods foo description-`)) ) diff --git a/pkg/cmd/apiresources/apiresources.go b/pkg/cmd/apiresources/apiresources.go index b0eff26a..94ce9d32 100644 --- a/pkg/cmd/apiresources/apiresources.go +++ b/pkg/cmd/apiresources/apiresources.go @@ -40,13 +40,13 @@ import ( var ( apiresourcesExample = templates.Examples(` - # Print the supported API Resources + # Print the supported API resources kubectl api-resources - # Print the supported API Resources with more information + # Print the supported API resources with more information kubectl api-resources -o wide - # Print the supported API Resources sorted by a column + # Print the supported API resources sorted by a column kubectl api-resources --sort-by=name # Print the supported namespaced resources @@ -55,7 +55,7 @@ var ( # Print the supported non-namespaced resources kubectl api-resources --namespaced=false - # Print the supported API Resources with specific APIGroup + # Print the supported API resources with a specific APIGroup kubectl api-resources --api-group=extensions`) ) @@ -95,7 +95,7 @@ func NewCmdAPIResources(f cmdutil.Factory, ioStreams genericclioptions.IOStreams cmd := &cobra.Command{ Use: "api-resources", Short: i18n.T("Print the supported API resources on the server"), - Long: i18n.T("Print the supported API resources on the server"), + Long: i18n.T("Print the supported API resources on the server."), Example: apiresourcesExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(cmd, args)) diff --git a/pkg/cmd/apiresources/apiversions.go b/pkg/cmd/apiresources/apiversions.go index 0a506183..71585d4e 100644 --- a/pkg/cmd/apiresources/apiversions.go +++ b/pkg/cmd/apiresources/apiversions.go @@ -56,7 +56,7 @@ func NewCmdAPIVersions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) cmd := &cobra.Command{ Use: "api-versions", Short: i18n.T("Print the supported API versions on the server, in the form of \"group/version\""), - Long: i18n.T("Print the supported API versions on the server, in the form of \"group/version\""), + Long: i18n.T("Print the supported API versions on the server, in the form of \"group/version\"."), Example: apiversionsExample, DisableFlagsInUseLine: true, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/apply/apply.go b/pkg/cmd/apply/apply.go index 8a521edf..9fd451f5 100644 --- a/pkg/cmd/apply/apply.go +++ b/pkg/cmd/apply/apply.go @@ -108,7 +108,7 @@ type ApplyOptions struct { var ( applyLong = templates.LongDesc(i18n.T(` - Apply a configuration to a resource by filename or stdin. + Apply a configuration to a resource by file name or stdin. The resource name must be specified. This resource will be created if it doesn't exist yet. To use 'apply', always create the resource initially with either 'apply' or 'create --save-config'. @@ -117,20 +117,20 @@ var ( Alpha Disclaimer: the --prune functionality is not yet complete. Do not use unless you are aware of what the current state is. See https://issues.k8s.io/34274.`)) applyExample = templates.Examples(i18n.T(` - # Apply the configuration in pod.json to a pod. + # Apply the configuration in pod.json to a pod kubectl apply -f ./pod.json - # Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml. + # Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml kubectl apply -k dir/ - # Apply the JSON passed into stdin to a pod. + # Apply the JSON passed into stdin to a pod cat pod.json | kubectl apply -f - # Note: --prune is still in Alpha - # Apply the configuration in manifest.yaml that matches label app=nginx and delete all the other resources that are not in the file and match label app=nginx. + # Apply the configuration in manifest.yaml that matches label app=nginx and delete all other resources that are not in the file and match label app=nginx kubectl apply --prune -f manifest.yaml -l app=nginx - # Apply the configuration in manifest.yaml and delete all the other configmaps that are not in the file. + # Apply the configuration in manifest.yaml and delete all the other config maps that are not in the file kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap`)) warningNoLastAppliedConfigAnnotation = "Warning: resource %[1]s is missing the %[2]s annotation which is required by %[3]s apply. %[3]s apply should only be used on resources created declaratively by either %[3]s create --save-config or %[3]s apply. The missing annotation will be patched automatically.\n" @@ -170,7 +170,7 @@ func NewCmdApply(baseName string, f cmdutil.Factory, ioStreams genericclioptions cmd := &cobra.Command{ Use: "apply (-f FILENAME | -k DIRECTORY)", DisableFlagsInUseLine: true, - Short: i18n.T("Apply a configuration to a resource by filename or stdin"), + Short: i18n.T("Apply a configuration to a resource by file name or stdin"), Long: applyLong, Example: applyExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/apply/apply_edit_last_applied.go b/pkg/cmd/apply/apply_edit_last_applied.go index 47e375cc..9623b906 100644 --- a/pkg/cmd/apply/apply_edit_last_applied.go +++ b/pkg/cmd/apply/apply_edit_last_applied.go @@ -32,10 +32,10 @@ var ( Edit the latest last-applied-configuration annotations of resources from the default editor. The edit-last-applied command allows you to directly edit any API resource you can retrieve via the - command line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR + command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. You can edit multiple objects, although changes are applied one at a time. The command - accepts filenames as well as command line arguments, although the files you point to must + accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources. The default format is YAML. To edit in JSON, specify "-o json". @@ -50,10 +50,10 @@ var ( saved copy to include the latest resource version.`)) applyEditLastAppliedExample = templates.Examples(` - # Edit the last-applied-configuration annotations by type/name in YAML. + # Edit the last-applied-configuration annotations by type/name in YAML kubectl apply edit-last-applied deployment/nginx - # Edit the last-applied-configuration annotations by file in JSON. + # Edit the last-applied-configuration annotations by file in JSON kubectl apply edit-last-applied -f deploy.yaml -o json`) ) diff --git a/pkg/cmd/apply/apply_set_last_applied.go b/pkg/cmd/apply/apply_set_last_applied.go index 1b9dd672..3bf097a7 100644 --- a/pkg/cmd/apply/apply_set_last_applied.go +++ b/pkg/cmd/apply/apply_set_last_applied.go @@ -73,13 +73,13 @@ var ( without updating any other parts of the object.`)) applySetLastAppliedExample = templates.Examples(i18n.T(` - # Set the last-applied-configuration of a resource to match the contents of a file. + # Set the last-applied-configuration of a resource to match the contents of a file kubectl apply set-last-applied -f deploy.yaml - # Execute set-last-applied against each configuration file in a directory. + # Execute set-last-applied against each configuration file in a directory kubectl apply set-last-applied -f path/ - # Set the last-applied-configuration of a resource to match the contents of a file, will create the annotation if it does not already exist. + # Set the last-applied-configuration of a resource to match the contents of a file; will create the annotation if it does not already exist kubectl apply set-last-applied -f deploy.yaml --create-annotation=true `)) ) @@ -98,7 +98,7 @@ func NewCmdApplySetLastApplied(f cmdutil.Factory, ioStreams genericclioptions.IO cmd := &cobra.Command{ Use: "set-last-applied -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Set the last-applied-configuration annotation on a live object to match the contents of a file."), + Short: i18n.T("Set the last-applied-configuration annotation on a live object to match the contents of a file"), Long: applySetLastAppliedLong, Example: applySetLastAppliedExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/apply/apply_view_last_applied.go b/pkg/cmd/apply/apply_view_last_applied.go index 74e7f37f..3dd77c22 100644 --- a/pkg/cmd/apply/apply_view_last_applied.go +++ b/pkg/cmd/apply/apply_view_last_applied.go @@ -47,11 +47,11 @@ var ( applyViewLastAppliedLong = templates.LongDesc(i18n.T(` View the latest last-applied-configuration annotations by type/name or file. - The default output will be printed to stdout in YAML format. One can use -o option - to change output format.`)) + The default output will be printed to stdout in YAML format. You can use the -o option + to change the output format.`)) applyViewLastAppliedExample = templates.Examples(i18n.T(` - # View the last-applied-configuration annotations by type/name in YAML. + # View the last-applied-configuration annotations by type/name in YAML kubectl apply view-last-applied deployment/nginx # View the last-applied-configuration annotations by file in JSON @@ -74,7 +74,7 @@ func NewCmdApplyViewLastApplied(f cmdutil.Factory, ioStreams genericclioptions.I cmd := &cobra.Command{ Use: "view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)", DisableFlagsInUseLine: true, - Short: i18n.T("View latest last-applied-configuration annotations of a resource/object"), + Short: i18n.T("View the latest last-applied-configuration annotations of a resource/object"), Long: applyViewLastAppliedLong, Example: applyViewLastAppliedExample, ValidArgsFunction: util.ResourceTypeAndNameCompletionFunc(f), diff --git a/pkg/cmd/attach/attach.go b/pkg/cmd/attach/attach.go index f89cfd83..48975f68 100644 --- a/pkg/cmd/attach/attach.go +++ b/pkg/cmd/attach/attach.go @@ -42,18 +42,18 @@ import ( var ( attachExample = templates.Examples(i18n.T(` - # Get output from running pod mypod, use the kubectl.kubernetes.io/default-container annotation + # Get output from running pod mypod; use the 'kubectl.kubernetes.io/default-container' annotation # for selecting the container to be attached or the first container in the pod will be chosen kubectl attach mypod # Get output from ruby-container from pod mypod kubectl attach mypod -c ruby-container - # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod mypod + # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client kubectl attach mypod -c ruby-container -i -t - # Get output from the first pod of a ReplicaSet named nginx + # Get output from the first pod of a replica set named nginx kubectl attach rs/nginx `)) ) diff --git a/pkg/cmd/auth/cani.go b/pkg/cmd/auth/cani.go index 10305cec..5c107ae2 100644 --- a/pkg/cmd/auth/cani.go +++ b/pkg/cmd/auth/cani.go @@ -71,7 +71,7 @@ var ( VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. - NONRESOURCEURL is a partial URL starts with "/". + NONRESOURCEURL is a partial URL that starts with "/". NAME is the name of a particular Kubernetes resource.`) canIExample = templates.Examples(` diff --git a/pkg/cmd/auth/reconcile.go b/pkg/cmd/auth/reconcile.go index 5151310a..a8e65d33 100644 --- a/pkg/cmd/auth/reconcile.go +++ b/pkg/cmd/auth/reconcile.go @@ -58,7 +58,7 @@ type ReconcileOptions struct { var ( reconcileLong = templates.LongDesc(` - Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRoleBinding objects. + Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects. Missing objects are created, and the containing namespace is created for namespaced objects, if required. @@ -71,7 +71,7 @@ var ( This is preferred to 'apply' for RBAC resources so that semantically-aware merging of rules and subjects is done.`) reconcileExample = templates.Examples(` - # Reconcile rbac resources from a file + # Reconcile RBAC resources from a file kubectl auth reconcile -f my-rbac-rules.yaml`) ) @@ -91,7 +91,7 @@ func NewCmdReconcile(f cmdutil.Factory, streams genericclioptions.IOStreams) *co cmd := &cobra.Command{ Use: "reconcile -f FILENAME", DisableFlagsInUseLine: true, - Short: "Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRoleBinding objects", + Short: "Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects", Long: reconcileLong, Example: reconcileExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/autoscale/autoscale.go b/pkg/cmd/autoscale/autoscale.go index afe7117d..5b1102dc 100644 --- a/pkg/cmd/autoscale/autoscale.go +++ b/pkg/cmd/autoscale/autoscale.go @@ -40,16 +40,16 @@ import ( var ( autoscaleLong = templates.LongDesc(i18n.T(` - Creates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluster. + Creates an autoscaler that automatically chooses and sets the number of pods that run in a Kubernetes cluster. - Looks up a Deployment, ReplicaSet, StatefulSet, or ReplicationController by name and creates an autoscaler that uses the given resource as a reference. + Looks up a deployment, replica set, stateful set, or replication controller by name and creates an autoscaler that uses the given resource as a reference. An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.`)) autoscaleExample = templates.Examples(i18n.T(` - # Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used: + # Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used kubectl autoscale deployment foo --min=2 --max=10 - # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%: + # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80% kubectl autoscale rc foo --max=5 --cpu-percent=80`)) ) @@ -104,7 +104,7 @@ func NewCmdAutoscale(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) * cmd := &cobra.Command{ Use: "autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU]", DisableFlagsInUseLine: true, - Short: i18n.T("Auto-scale a Deployment, ReplicaSet, StatefulSet, or ReplicationController"), + Short: i18n.T("Auto-scale a deployment, replica set, stateful set, or replication controller"), Long: autoscaleLong, Example: autoscaleExample, ValidArgsFunction: util.SpecifiedResourceTypeAndNameCompletionFunc(f, validArgs), diff --git a/pkg/cmd/certificates/certificates.go b/pkg/cmd/certificates/certificates.go index d7caefe3..7f63d6b0 100644 --- a/pkg/cmd/certificates/certificates.go +++ b/pkg/cmd/certificates/certificates.go @@ -135,6 +135,10 @@ func NewCmdCertificateApprove(f cmdutil.Factory, ioStreams genericclioptions.IOS as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do. `)), + Example: templates.Examples(i18n.T(` + # Approve CSR 'csr-sqgzp' + kubectl certificate approve csr-sqgzp + `)), Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) @@ -175,6 +179,10 @@ func NewCmdCertificateDeny(f cmdutil.Factory, ioStreams genericclioptions.IOStre signing request (CSR). This action tells a certificate signing controller to not to issue a certificate to the requestor. `)), + Example: templates.Examples(i18n.T(` + # Deny CSR 'csr-sqgzp' + kubectl certificate deny csr-sqgzp + `)), Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd, args)) cmdutil.CheckErr(o.Validate()) diff --git a/pkg/cmd/clusterinfo/clusterinfo.go b/pkg/cmd/clusterinfo/clusterinfo.go index 34e3b113..14a0146e 100644 --- a/pkg/cmd/clusterinfo/clusterinfo.go +++ b/pkg/cmd/clusterinfo/clusterinfo.go @@ -38,7 +38,7 @@ import ( var ( longDescr = templates.LongDesc(i18n.T(` - Display addresses of the control plane and services with label kubernetes.io/cluster-service=true + Display addresses of the control plane and services with label kubernetes.io/cluster-service=true. To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.`)) clusterinfoExample = templates.Examples(i18n.T(` @@ -62,7 +62,7 @@ func NewCmdClusterInfo(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) cmd := &cobra.Command{ Use: "cluster-info", - Short: i18n.T("Display cluster info"), + Short: i18n.T("Display cluster information"), Long: longDescr, Example: clusterinfoExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/clusterinfo/clusterinfo_dump.go b/pkg/cmd/clusterinfo/clusterinfo_dump.go index 97cc25fd..57d748ad 100644 --- a/pkg/cmd/clusterinfo/clusterinfo_dump.go +++ b/pkg/cmd/clusterinfo/clusterinfo_dump.go @@ -71,7 +71,7 @@ func NewCmdClusterInfoDump(f cmdutil.Factory, ioStreams genericclioptions.IOStre cmd := &cobra.Command{ Use: "dump", - Short: i18n.T("Dump lots of relevant info for debugging and diagnosis"), + Short: i18n.T("Dump relevant information for debugging and diagnosis"), Long: dumpLong, Example: dumpExample, Run: func(cmd *cobra.Command, args []string) { @@ -91,12 +91,12 @@ func NewCmdClusterInfoDump(f cmdutil.Factory, ioStreams genericclioptions.IOStre var ( dumpLong = templates.LongDesc(i18n.T(` - Dumps cluster info out suitable for debugging and diagnosing cluster problems. By default, dumps everything to - stdout. You can optionally specify a directory with --output-directory. If you specify a directory, kubernetes will - build a set of files in that directory. By default only dumps things in the current namespace and 'kube-system' namespace, but you can + Dump cluster information out suitable for debugging and diagnosing cluster problems. By default, dumps everything to + stdout. You can optionally specify a directory with --output-directory. If you specify a directory, Kubernetes will + build a set of files in that directory. By default, only dumps things in the current namespace and 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces. - The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories + The command also dumps the logs of all of the pods in the cluster; these logs are dumped into different directories based on namespace and pod name.`)) dumpExample = templates.Examples(i18n.T(` diff --git a/pkg/cmd/completion/completion.go b/pkg/cmd/completion/completion.go index 6399ffe2..6f89b0d0 100644 --- a/pkg/cmd/completion/completion.go +++ b/pkg/cmd/completion/completion.go @@ -60,7 +60,7 @@ var ( for windows: https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/#enable-shell-autocompletion - Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2`)) + Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2.`)) completionExample = templates.Examples(i18n.T(` # Installing bash completion on macOS using homebrew @@ -68,13 +68,13 @@ var ( brew install bash-completion ## or, if running Bash 4.1+ brew install bash-completion@2 - ## If kubectl is installed via homebrew, this should start working immediately. + ## If kubectl is installed via homebrew, this should start working immediately ## If you've installed via other means, you may need add the completion to your completion directory kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl # Installing bash completion on Linux - ## If bash-completion is not installed on Linux, please install the 'bash-completion' package + ## If bash-completion is not installed on Linux, install the 'bash-completion' package ## via your distribution's package manager. ## Load the kubectl completion code for bash into the current shell source <(kubectl completion bash) diff --git a/pkg/cmd/config/create_authinfo.go b/pkg/cmd/config/create_authinfo.go index bf4ec20b..f94cfd01 100644 --- a/pkg/cmd/config/create_authinfo.go +++ b/pkg/cmd/config/create_authinfo.go @@ -68,7 +68,7 @@ const ( var ( createAuthInfoLong = fmt.Sprintf(templates.LongDesc(i18n.T(` - Sets a user entry in kubeconfig + Set a user entry in kubeconfig. Specifying a name that already exists will merge new fields on top of existing values. @@ -85,7 +85,7 @@ var ( createAuthInfoExample = templates.Examples(` # Set only the "client-key" field on the "cluster-admin" - # entry, without touching other values: + # entry, without touching other values kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key # Set basic auth for the "cluster-admin" entry @@ -149,7 +149,7 @@ func newCmdConfigSetAuthInfo(out io.Writer, options *createAuthInfoOptions) *cob flagExecEnv, ), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a user entry in kubeconfig"), + Short: i18n.T("Set a user entry in kubeconfig"), Long: createAuthInfoLong, Example: createAuthInfoExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/create_cluster.go b/pkg/cmd/config/create_cluster.go index 6ca07cf2..3a48a7e5 100644 --- a/pkg/cmd/config/create_cluster.go +++ b/pkg/cmd/config/create_cluster.go @@ -45,12 +45,12 @@ type createClusterOptions struct { var ( createClusterLong = templates.LongDesc(i18n.T(` - Sets a cluster entry in kubeconfig. + Set a cluster entry in kubeconfig. Specifying a name that already exists will merge new fields on top of existing values for those fields.`)) createClusterExample = templates.Examples(` - # Set only the server field on the e2e cluster entry without touching other values. + # Set only the server field on the e2e cluster entry without touching other values kubectl config set-cluster e2e --server=https://1.2.3.4 # Embed certificate authority data for the e2e cluster entry @@ -70,7 +70,7 @@ func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess) cmd := &cobra.Command{ Use: fmt.Sprintf("set-cluster NAME [--%v=server] [--%v=path/to/certificate/authority] [--%v=true] [--%v=example.com]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagInsecure, clientcmd.FlagTLSServerName), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a cluster entry in kubeconfig"), + Short: i18n.T("Set a cluster entry in kubeconfig"), Long: createClusterLong, Example: createClusterExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/create_context.go b/pkg/cmd/config/create_context.go index 2b1d849a..ab745379 100644 --- a/pkg/cmd/config/create_context.go +++ b/pkg/cmd/config/create_context.go @@ -42,7 +42,7 @@ type createContextOptions struct { var ( createContextLong = templates.LongDesc(i18n.T(` - Sets a context entry in kubeconfig + Set a context entry in kubeconfig. Specifying a name that already exists will merge new fields on top of existing values for those fields.`)) @@ -58,7 +58,7 @@ func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess) cmd := &cobra.Command{ Use: fmt.Sprintf("set-context [NAME | --current] [--%v=cluster_nickname] [--%v=user_nickname] [--%v=namespace]", clientcmd.FlagClusterName, clientcmd.FlagAuthInfoName, clientcmd.FlagNamespace), DisableFlagsInUseLine: true, - Short: i18n.T("Sets a context entry in kubeconfig"), + Short: i18n.T("Set a context entry in kubeconfig"), Long: createContextLong, Example: createContextExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/current_context.go b/pkg/cmd/config/current_context.go index aa65d446..ec5e9c6b 100644 --- a/pkg/cmd/config/current_context.go +++ b/pkg/cmd/config/current_context.go @@ -35,7 +35,7 @@ type CurrentContextOptions struct { var ( currentContextLong = templates.LongDesc(i18n.T(` - Displays the current-context`)) + Display the current-context.`)) currentContextExample = templates.Examples(` # Display the current-context @@ -48,7 +48,7 @@ func NewCmdConfigCurrentContext(out io.Writer, configAccess clientcmd.ConfigAcce cmd := &cobra.Command{ Use: "current-context", - Short: i18n.T("Displays the current-context"), + Short: i18n.T("Display the current-context"), Long: currentContextLong, Example: currentContextExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/delete_cluster.go b/pkg/cmd/config/delete_cluster.go index 23a09b2e..9a5ba2dc 100644 --- a/pkg/cmd/config/delete_cluster.go +++ b/pkg/cmd/config/delete_cluster.go @@ -40,7 +40,7 @@ func NewCmdConfigDeleteCluster(out io.Writer, configAccess clientcmd.ConfigAcces Use: "delete-cluster NAME", DisableFlagsInUseLine: true, Short: i18n.T("Delete the specified cluster from the kubeconfig"), - Long: i18n.T("Delete the specified cluster from the kubeconfig"), + Long: i18n.T("Delete the specified cluster from the kubeconfig."), Example: deleteClusterExample, ValidArgsFunction: util.ClusterCompletionFunc, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/delete_context.go b/pkg/cmd/config/delete_context.go index 7e12ba88..8c512e35 100644 --- a/pkg/cmd/config/delete_context.go +++ b/pkg/cmd/config/delete_context.go @@ -40,7 +40,7 @@ func NewCmdConfigDeleteContext(out, errOut io.Writer, configAccess clientcmd.Con Use: "delete-context NAME", DisableFlagsInUseLine: true, Short: i18n.T("Delete the specified context from the kubeconfig"), - Long: i18n.T("Delete the specified context from the kubeconfig"), + Long: i18n.T("Delete the specified context from the kubeconfig."), Example: deleteContextExample, ValidArgsFunction: util.ContextCompletionFunc, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/delete_user.go b/pkg/cmd/config/delete_user.go index a2da9713..c3c1fc95 100644 --- a/pkg/cmd/config/delete_user.go +++ b/pkg/cmd/config/delete_user.go @@ -62,7 +62,7 @@ func NewCmdConfigDeleteUser(streams genericclioptions.IOStreams, configAccess cl Use: "delete-user NAME", DisableFlagsInUseLine: true, Short: i18n.T("Delete the specified user from the kubeconfig"), - Long: i18n.T("Delete the specified user from the kubeconfig"), + Long: i18n.T("Delete the specified user from the kubeconfig."), Example: deleteUserExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(cmd, args)) diff --git a/pkg/cmd/config/get_clusters.go b/pkg/cmd/config/get_clusters.go index 5c048d75..34b8d0f8 100644 --- a/pkg/cmd/config/get_clusters.go +++ b/pkg/cmd/config/get_clusters.go @@ -29,7 +29,7 @@ import ( var ( getClustersExample = templates.Examples(` - # List the clusters kubectl knows about + # List the clusters that kubectl knows about kubectl config get-clusters`) ) diff --git a/pkg/cmd/config/get_contexts.go b/pkg/cmd/config/get_contexts.go index dbd6f967..a8fdb753 100644 --- a/pkg/cmd/config/get_contexts.go +++ b/pkg/cmd/config/get_contexts.go @@ -47,13 +47,13 @@ type GetContextsOptions struct { } var ( - getContextsLong = templates.LongDesc(i18n.T(`Displays one or many contexts from the kubeconfig file.`)) + getContextsLong = templates.LongDesc(i18n.T(`Display one or many contexts from the kubeconfig file.`)) getContextsExample = templates.Examples(` # List all the contexts in your kubeconfig file kubectl config get-contexts - # Describe one context in your kubeconfig file. + # Describe one context in your kubeconfig file kubectl config get-contexts my-context`) ) diff --git a/pkg/cmd/config/get_users.go b/pkg/cmd/config/get_users.go index 926df7c4..d58f556b 100644 --- a/pkg/cmd/config/get_users.go +++ b/pkg/cmd/config/get_users.go @@ -31,7 +31,7 @@ import ( var ( getUsersExample = templates.Examples(` - # List the users kubectl knows about + # List the users that kubectl knows about kubectl config get-users`) ) diff --git a/pkg/cmd/config/rename_context.go b/pkg/cmd/config/rename_context.go index 153ba090..3d37b318 100644 --- a/pkg/cmd/config/rename_context.go +++ b/pkg/cmd/config/rename_context.go @@ -42,16 +42,16 @@ const ( ) var ( - renameContextShort = i18n.T("Renames a context from the kubeconfig file.") + renameContextShort = i18n.T("Rename a context from the kubeconfig file") renameContextLong = templates.LongDesc(i18n.T(` Renames a context from the kubeconfig file. - CONTEXT_NAME is the context name that you wish to change. + CONTEXT_NAME is the context name that you want to change. - NEW_NAME is the new name you wish to set. + NEW_NAME is the new name you want to set. - Note: In case the context being renamed is the 'current-context', this field will also be updated.`)) + Note: If the context being renamed is the 'current-context', this field will also be updated.`)) renameContextExample = templates.Examples(` # Rename the context 'old-name' to 'new-name' in your kubeconfig file diff --git a/pkg/cmd/config/set.go b/pkg/cmd/config/set.go index a9237e98..09d025d9 100644 --- a/pkg/cmd/config/set.go +++ b/pkg/cmd/config/set.go @@ -42,25 +42,25 @@ type setOptions struct { var ( setLong = templates.LongDesc(i18n.T(` - Sets an individual value in a kubeconfig file + Set an individual value in a kubeconfig file. PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots. - PROPERTY_VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used. + PROPERTY_VALUE is the new value you want to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used. - Specifying a attribute name that already exists will merge new fields on top of existing values.`)) + Specifying an attribute name that already exists will merge new fields on top of existing values.`)) setExample = templates.Examples(` - # Set server field on the my-cluster cluster to https://1.2.3.4 + # Set the server field on the my-cluster cluster to https://1.2.3.4 kubectl config set clusters.my-cluster.server https://1.2.3.4 - # Set certificate-authority-data field on the my-cluster cluster. + # Set the certificate-authority-data field on the my-cluster cluster kubectl config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -) - # Set cluster field in the my-context context to my-cluster. + # Set the cluster field in the my-context context to my-cluster kubectl config set contexts.my-context.cluster my-cluster - # Set client-key-data field in the cluster-admin user using --set-raw-bytes option. + # Set the client-key-data field in the cluster-admin user using --set-raw-bytes option kubectl config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true`) ) @@ -71,7 +71,7 @@ func NewCmdConfigSet(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra. cmd := &cobra.Command{ Use: "set PROPERTY_NAME PROPERTY_VALUE", DisableFlagsInUseLine: true, - Short: i18n.T("Sets an individual value in a kubeconfig file"), + Short: i18n.T("Set an individual value in a kubeconfig file"), Long: setLong, Example: setExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/unset.go b/pkg/cmd/config/unset.go index a4384529..bf20bbe0 100644 --- a/pkg/cmd/config/unset.go +++ b/pkg/cmd/config/unset.go @@ -37,15 +37,15 @@ type unsetOptions struct { var ( unsetLong = templates.LongDesc(i18n.T(` - Unsets an individual value in a kubeconfig file + Unset an individual value in a kubeconfig file. PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.`)) unsetExample = templates.Examples(` - # Unset the current-context. + # Unset the current-context kubectl config unset current-context - # Unset namespace in foo context. + # Unset namespace in foo context kubectl config unset contexts.foo.namespace`) ) @@ -56,7 +56,7 @@ func NewCmdConfigUnset(out io.Writer, configAccess clientcmd.ConfigAccess) *cobr cmd := &cobra.Command{ Use: "unset PROPERTY_NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Unsets an individual value in a kubeconfig file"), + Short: i18n.T("Unset an individual value in a kubeconfig file"), Long: unsetLong, Example: unsetExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/use_context.go b/pkg/cmd/config/use_context.go index 758d82b9..78978caa 100644 --- a/pkg/cmd/config/use_context.go +++ b/pkg/cmd/config/use_context.go @@ -49,9 +49,9 @@ func NewCmdConfigUseContext(out io.Writer, configAccess clientcmd.ConfigAccess) cmd := &cobra.Command{ Use: "use-context CONTEXT_NAME", DisableFlagsInUseLine: true, - Short: i18n.T("Sets the current-context in a kubeconfig file"), + Short: i18n.T("Set the current-context in a kubeconfig file"), Aliases: []string{"use"}, - Long: `Sets the current-context in a kubeconfig file`, + Long: `Set the current-context in a kubeconfig file.`, Example: useContextExample, ValidArgsFunction: util.ContextCompletionFunc, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/config/view.go b/pkg/cmd/config/view.go index 1f071a25..eec8867b 100644 --- a/pkg/cmd/config/view.go +++ b/pkg/cmd/config/view.go @@ -57,10 +57,10 @@ var ( You can use --output jsonpath={...} to extract specific values using a jsonpath expression.`)) viewExample = templates.Examples(` - # Show merged kubeconfig settings. + # Show merged kubeconfig settings kubectl config view - # Show merged kubeconfig settings and raw certificate data. + # Show merged kubeconfig settings and raw certificate data kubectl config view --raw # Get the password for the e2e user diff --git a/pkg/cmd/cp/cp.go b/pkg/cmd/cp/cp.go index 79d06411..578700d2 100644 --- a/pkg/cmd/cp/cp.go +++ b/pkg/cmd/cp/cp.go @@ -48,7 +48,7 @@ var ( # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or - # file mode preservation consider using 'kubectl exec'. + # file mode preservation, consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace tar cf - /tmp/foo | kubectl exec -i -n -- tar xf - -C /tmp/bar @@ -102,7 +102,7 @@ func NewCmdCp(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.C cmd := &cobra.Command{ Use: "cp ", DisableFlagsInUseLine: true, - Short: i18n.T("Copy files and directories to and from containers."), + Short: i18n.T("Copy files and directories to and from containers"), Long: i18n.T("Copy files and directories to and from containers."), Example: cpExample, ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { diff --git a/pkg/cmd/create/create.go b/pkg/cmd/create/create.go index 090f736c..51b81012 100644 --- a/pkg/cmd/create/create.go +++ b/pkg/cmd/create/create.go @@ -74,13 +74,13 @@ var ( JSON and YAML formats are accepted.`)) createExample = templates.Examples(i18n.T(` - # Create a pod using the data in pod.json. + # Create a pod using the data in pod.json kubectl create -f ./pod.json - # Create a pod based on the JSON passed into stdin. + # Create a pod based on the JSON passed into stdin cat pod.json | kubectl create -f - - # Edit the data in docker-registry.yaml in JSON then create the resource using the edited data. + # Edit the data in docker-registry.yaml in JSON then create the resource using the edited data kubectl create -f docker-registry.yaml --edit -o json`)) ) @@ -103,7 +103,7 @@ func NewCmdCreate(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cob cmd := &cobra.Command{ Use: "create -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Create a resource from a file or from stdin."), + Short: i18n.T("Create a resource from a file or from stdin"), Long: createLong, Example: createExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_clusterrole.go b/pkg/cmd/create/create_clusterrole.go index 7da49190..ff6852a3 100644 --- a/pkg/cmd/create/create_clusterrole.go +++ b/pkg/cmd/create/create_clusterrole.go @@ -36,25 +36,25 @@ import ( var ( clusterRoleLong = templates.LongDesc(i18n.T(` - Create a ClusterRole.`)) + Create a cluster role.`)) clusterRoleExample = templates.Examples(i18n.T(` - # Create a ClusterRole named "pod-reader" that allows user to perform "get", "watch" and "list" on pods + # Create a cluster role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods - # Create a ClusterRole named "pod-reader" with ResourceName specified + # Create a cluster role named "pod-reader" with ResourceName specified kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod - # Create a ClusterRole named "foo" with API Group specified + # Create a cluster role named "foo" with API Group specified kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions - # Create a ClusterRole named "foo" with SubResource specified + # Create a cluster role named "foo" with SubResource specified kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status - # Create a ClusterRole name "foo" with NonResourceURL specified + # Create a cluster role name "foo" with NonResourceURL specified kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/* - # Create a ClusterRole name "monitoring" with AggregationRule specified + # Create a cluster role name "monitoring" with AggregationRule specified kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"`)) // Valid nonResource verb list for validation. @@ -78,7 +78,7 @@ func NewCmdCreateClusterRole(f cmdutil.Factory, ioStreams genericclioptions.IOSt cmd := &cobra.Command{ Use: "clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: clusterRoleLong, + Short: i18n.T("Create a cluster role"), Long: clusterRoleLong, Example: clusterRoleExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_clusterrolebinding.go b/pkg/cmd/create/create_clusterrolebinding.go index 7757b2c6..ec557081 100644 --- a/pkg/cmd/create/create_clusterrolebinding.go +++ b/pkg/cmd/create/create_clusterrolebinding.go @@ -39,10 +39,10 @@ import ( var ( clusterRoleBindingLong = templates.LongDesc(i18n.T(` - Create a ClusterRoleBinding for a particular ClusterRole.`)) + Create a cluster role binding for a particular cluster role.`)) clusterRoleBindingExample = templates.Examples(i18n.T(` - # Create a ClusterRoleBinding for user1, user2, and group1 using the cluster-admin ClusterRole + # Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role kubectl create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1`)) ) @@ -84,7 +84,7 @@ func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, ioStreams genericclioptio cmd := &cobra.Command{ Use: "clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a ClusterRoleBinding for a particular ClusterRole"), + Short: i18n.T("Create a cluster role binding for a particular cluster role"), Long: clusterRoleBindingLong, Example: clusterRoleBindingExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_configmap.go b/pkg/cmd/create/create_configmap.go index 4b2802fa..690d8522 100644 --- a/pkg/cmd/create/create_configmap.go +++ b/pkg/cmd/create/create_configmap.go @@ -44,31 +44,31 @@ import ( var ( configMapLong = templates.LongDesc(i18n.T(` - Create a configmap based on a file, directory, or specified literal value. + Create a config map based on a file, directory, or specified literal value. - A single configmap may package one or more key/value pairs. + A single config map may package one or more key/value pairs. - When creating a configmap based on a file, the key will default to the basename of the file, and the value will + When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key. - When creating a configmap based on a directory, each file whose basename is a valid key in the directory will be - packaged into the configmap. Any directory entries except regular files are ignored (e.g. subdirectories, + When creating a config map based on a directory, each file whose basename is a valid key in the directory will be + packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).`)) configMapExample = templates.Examples(i18n.T(` - # Create a new configmap named my-config based on folder bar + # Create a new config map named my-config based on folder bar kubectl create configmap my-config --from-file=path/to/bar - # Create a new configmap named my-config with specified keys instead of file basenames on disk + # Create a new config map named my-config with specified keys instead of file basenames on disk kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt - # Create a new configmap named my-config with key1=config1 and key2=config2 + # Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 - # Create a new configmap named my-config from the key=value pairs in the file + # Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from-file=path/to/bar - # Create a new configmap named my-config from an env file + # Create a new config map named my-config from an env file kubectl create configmap my-config --from-env-file=path/to/bar.env`)) ) @@ -121,7 +121,7 @@ func NewCmdCreateConfigMap(f cmdutil.Factory, ioStreams genericclioptions.IOStre Use: "configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, Aliases: []string{"cm"}, - Short: i18n.T("Create a configmap from a local file, directory or literal value"), + Short: i18n.T("Create a config map from a local file, directory or literal value"), Long: configMapLong, Example: configMapExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_cronjob.go b/pkg/cmd/create/create_cronjob.go index 76f88da7..da7500dc 100644 --- a/pkg/cmd/create/create_cronjob.go +++ b/pkg/cmd/create/create_cronjob.go @@ -38,13 +38,13 @@ import ( var ( cronjobLong = templates.LongDesc(i18n.T(` - Create a cronjob with the specified name.`)) + Create a cron job with the specified name.`)) cronjobExample = templates.Examples(` - # Create a cronjob + # Create a cron job kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" - # Create a cronjob with command + # Create a cron job with a command kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date`) ) @@ -87,7 +87,7 @@ func NewCmdCreateCronJob(f cmdutil.Factory, ioStreams genericclioptions.IOStream Use: "cronjob NAME --image=image --schedule='0/5 * * * ?' -- [COMMAND] [args...]", DisableFlagsInUseLine: false, Aliases: []string{"cj"}, - Short: cronjobLong, + Short: i18n.T("Create a cron job with the specified name"), Long: cronjobLong, Example: cronjobExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_deployment.go b/pkg/cmd/create/create_deployment.go index 04a3e55a..da3c7046 100644 --- a/pkg/cmd/create/create_deployment.go +++ b/pkg/cmd/create/create_deployment.go @@ -43,16 +43,16 @@ var ( Create a deployment with the specified name.`)) deploymentExample = templates.Examples(i18n.T(` - # Create a deployment named my-dep that runs the busybox image. + # Create a deployment named my-dep that runs the busybox image kubectl create deployment my-dep --image=busybox - # Create a deployment with command + # Create a deployment with a command kubectl create deployment my-dep --image=busybox -- date - # Create a deployment named my-dep that runs the nginx image with 3 replicas. + # Create a deployment named my-dep that runs the nginx image with 3 replicas kubectl create deployment my-dep --image=nginx --replicas=3 - # Create a deployment named my-dep that runs the busybox image and expose port 5701. + # Create a deployment named my-dep that runs the busybox image and expose port 5701 kubectl create deployment my-dep --image=busybox --port=5701`)) ) @@ -97,7 +97,7 @@ func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericclioptions.IOStr Use: "deployment NAME --image=image -- [COMMAND] [args...]", DisableFlagsInUseLine: true, Aliases: []string{"deploy"}, - Short: deploymentLong, + Short: i18n.T("Create a deployment with the specified name"), Long: deploymentLong, Example: deploymentExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_ingress.go b/pkg/cmd/create/create_ingress.go index fc4bd835..afcfe97d 100644 --- a/pkg/cmd/create/create_ingress.go +++ b/pkg/cmd/create/create_ingress.go @@ -142,7 +142,7 @@ func NewCmdCreateIngress(f cmdutil.Factory, ioStreams genericclioptions.IOStream Use: "ingress NAME --rule=host/path=service:port[,tls[=secret]] ", DisableFlagsInUseLine: true, Aliases: []string{"ing"}, - Short: ingressLong, + Short: i18n.T("Create an ingress with the specified name"), Long: ingressLong, Example: ingressExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_job.go b/pkg/cmd/create/create_job.go index 57a177fd..44fd497a 100644 --- a/pkg/cmd/create/create_job.go +++ b/pkg/cmd/create/create_job.go @@ -44,10 +44,10 @@ var ( # Create a job kubectl create job my-job --image=busybox - # Create a job with command + # Create a job with a command kubectl create job my-job --image=busybox -- date - # Create a job from a CronJob named "a-cronjob" + # Create a job from a cron job named "a-cronjob" kubectl create job test-job --from=cronjob/a-cronjob`)) ) @@ -88,7 +88,7 @@ func NewCmdCreateJob(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) * cmd := &cobra.Command{ Use: "job NAME --image=image [--from=cronjob/name] -- [COMMAND] [args...]", DisableFlagsInUseLine: true, - Short: jobLong, + Short: i18n.T("Create a job with the specified name"), Long: jobLong, Example: jobExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_pdb.go b/pkg/cmd/create/create_pdb.go index 64dc4bf7..c5db39fd 100644 --- a/pkg/cmd/create/create_pdb.go +++ b/pkg/cmd/create/create_pdb.go @@ -39,15 +39,15 @@ import ( var ( pdbLong = templates.LongDesc(i18n.T(` - Create a pod disruption budget with the specified name, selector, and desired minimum available pods`)) + Create a pod disruption budget with the specified name, selector, and desired minimum available pods.`)) pdbExample = templates.Examples(i18n.T(` # Create a pod disruption budget named my-pdb that will select all pods with the app=rails label - # and require at least one of them being available at any point in time. + # and require at least one of them being available at any point in time kubectl create poddisruptionbudget my-pdb --selector=app=rails --min-available=1 # Create a pod disruption budget named my-pdb that will select all pods with the app=nginx label - # and require at least half of the pods selected to be available at any point in time. + # and require at least half of the pods selected to be available at any point in time kubectl create pdb my-pdb --selector=app=nginx --min-available=50%`)) ) @@ -92,7 +92,7 @@ func NewCmdCreatePodDisruptionBudget(f cmdutil.Factory, ioStreams genericcliopti Use: "poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run=server|client|none]", DisableFlagsInUseLine: true, Aliases: []string{"pdb"}, - Short: i18n.T("Create a pod disruption budget with the specified name."), + Short: i18n.T("Create a pod disruption budget with the specified name"), Long: pdbLong, Example: pdbExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_priorityclass.go b/pkg/cmd/create/create_priorityclass.go index 39f49040..4b54fd24 100644 --- a/pkg/cmd/create/create_priorityclass.go +++ b/pkg/cmd/create/create_priorityclass.go @@ -38,16 +38,16 @@ import ( var ( pcLong = templates.LongDesc(i18n.T(` - Create a priorityclass with the specified name, value, globalDefault and description`)) + Create a priority class with the specified name, value, globalDefault and description.`)) pcExample = templates.Examples(i18n.T(` - # Create a priorityclass named high-priority + # Create a priority class named high-priority kubectl create priorityclass high-priority --value=1000 --description="high priority" - # Create a priorityclass named default-priority that considered as the global default priority + # Create a priority class named default-priority that is considered as the global default priority kubectl create priorityclass default-priority --value=1000 --global-default=true --description="default priority" - # Create a priorityclass named high-priority that can not preempt pods with lower priority + # Create a priority class named high-priority that cannot preempt pods with lower priority kubectl create priorityclass high-priority --value=1000 --description="high priority" --preemption-policy="Never"`)) ) @@ -89,7 +89,7 @@ func NewCmdCreatePriorityClass(f cmdutil.Factory, ioStreams genericclioptions.IO Use: "priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run=server|client|none]", DisableFlagsInUseLine: true, Aliases: []string{"pc"}, - Short: i18n.T("Create a priorityclass with the specified name."), + Short: i18n.T("Create a priority class with the specified name"), Long: pcLong, Example: pcExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_quota.go b/pkg/cmd/create/create_quota.go index df5444a2..6d67c38b 100644 --- a/pkg/cmd/create/create_quota.go +++ b/pkg/cmd/create/create_quota.go @@ -39,13 +39,13 @@ import ( var ( quotaLong = templates.LongDesc(i18n.T(` - Create a resourcequota with the specified name, hard limits and optional scopes`)) + Create a resource quota with the specified name, hard limits, and optional scopes.`)) quotaExample = templates.Examples(i18n.T(` - # Create a new resourcequota named my-quota + # Create a new resource quota named my-quota kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10 - # Create a new resourcequota named best-effort + # Create a new resource quota named best-effort kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort`)) ) @@ -88,7 +88,7 @@ func NewCmdCreateQuota(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) Use: "quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, Aliases: []string{"resourcequota"}, - Short: i18n.T("Create a quota with the specified name."), + Short: i18n.T("Create a quota with the specified name"), Long: quotaLong, Example: quotaExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_role.go b/pkg/cmd/create/create_role.go index c34cbd7f..ec7d5bec 100644 --- a/pkg/cmd/create/create_role.go +++ b/pkg/cmd/create/create_role.go @@ -44,16 +44,16 @@ var ( Create a role with single rule.`)) roleExample = templates.Examples(i18n.T(` - # Create a Role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods + # Create a role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods - # Create a Role named "pod-reader" with ResourceName specified + # Create a role named "pod-reader" with ResourceName specified kubectl create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod - # Create a Role named "foo" with API Group specified + # Create a role named "foo" with API Group specified kubectl create role foo --verb=get,list,watch --resource=rs.extensions - # Create a Role named "foo" with SubResource specified + # Create a role named "foo" with SubResource specified kubectl create role foo --verb=get,list,watch --resource=pods,pods/status`)) // Valid resource verb list for validation. @@ -158,7 +158,7 @@ func NewCmdCreateRole(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) cmd := &cobra.Command{ Use: "role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: roleLong, + Short: i18n.T("Create a role with single rule"), Long: roleLong, Example: roleExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_rolebinding.go b/pkg/cmd/create/create_rolebinding.go index 77012da7..beef08b0 100644 --- a/pkg/cmd/create/create_rolebinding.go +++ b/pkg/cmd/create/create_rolebinding.go @@ -38,10 +38,10 @@ import ( var ( roleBindingLong = templates.LongDesc(i18n.T(` - Create a RoleBinding for a particular Role or ClusterRole.`)) + Create a role binding for a particular role or cluster role.`)) roleBindingExample = templates.Examples(i18n.T(` - # Create a RoleBinding for user1, user2, and group1 using the admin ClusterRole + # Create a role binding for user1, user2, and group1 using the admin cluster role kubectl create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1`)) ) @@ -86,7 +86,7 @@ func NewCmdCreateRoleBinding(f cmdutil.Factory, ioStreams genericclioptions.IOSt cmd := &cobra.Command{ Use: "rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a RoleBinding for a particular Role or ClusterRole"), + Short: i18n.T("Create a role binding for a particular role or cluster role"), Long: roleBindingLong, Example: roleBindingExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_secret.go b/pkg/cmd/create/create_secret.go index 608c823e..214b0c8f 100644 --- a/pkg/cmd/create/create_secret.go +++ b/pkg/cmd/create/create_secret.go @@ -134,7 +134,7 @@ func NewCmdCreateSecretGeneric(f cmdutil.Factory, ioStreams genericclioptions.IO cmd := &cobra.Command{ Use: "generic NAME [--type=string] [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a secret from a local file, directory or literal value"), + Short: i18n.T("Create a secret from a local file, directory, or literal value"), Long: secretLong, Example: secretExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/create/create_secret_docker.go b/pkg/cmd/create/create_secret_docker.go index 40ac2ee3..0d4f9a1b 100644 --- a/pkg/cmd/create/create_secret_docker.go +++ b/pkg/cmd/create/create_secret_docker.go @@ -50,13 +50,13 @@ var ( authenticate to the registry. The email address is optional. When creating applications, you may have a Docker registry that requires authentication. In order for the - nodes to pull images on your behalf, they have to have the credentials. You can provide this information + nodes to pull images on your behalf, they must have the credentials. You can provide this information by creating a dockercfg secret and attaching it to your service account.`)) secretForDockerRegistryExample = templates.Examples(i18n.T(` # If you don't already have a .dockercfg file, you can create a dockercfg secret directly by using: kubectl create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL - + # Create a new secret named my-secret from ~/.docker/config.json kubectl create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json`)) ) diff --git a/pkg/cmd/create/create_secret_tls.go b/pkg/cmd/create/create_secret_tls.go index ca27af7a..5adcc10b 100644 --- a/pkg/cmd/create/create_secret_tls.go +++ b/pkg/cmd/create/create_secret_tls.go @@ -41,11 +41,11 @@ var ( secretForTLSLong = templates.LongDesc(i18n.T(` Create a TLS secret from the given public/private key pair. - The public/private key pair must exist before hand. The public key certificate must be .PEM encoded and match + The public/private key pair must exist beforehand. The public key certificate must be .PEM encoded and match the given private key.`)) secretForTLSExample = templates.Examples(i18n.T(` - # Create a new TLS secret named tls-secret with the given key pair: + # Create a new TLS secret named tls-secret with the given key pair kubectl create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key`)) ) diff --git a/pkg/cmd/create/create_service.go b/pkg/cmd/create/create_service.go index afb17169..ff2f2b0b 100644 --- a/pkg/cmd/create/create_service.go +++ b/pkg/cmd/create/create_service.go @@ -45,8 +45,8 @@ func NewCmdCreateService(f cmdutil.Factory, ioStreams genericclioptions.IOStream cmd := &cobra.Command{ Use: "service", Aliases: []string{"svc"}, - Short: i18n.T("Create a service using specified subcommand."), - Long: i18n.T("Create a service using specified subcommand."), + Short: i18n.T("Create a service using a specified subcommand"), + Long: i18n.T("Create a service using a specified subcommand."), Run: cmdutil.DefaultSubCommandRun(ioStreams.ErrOut), } cmd.AddCommand(NewCmdCreateServiceClusterIP(f, ioStreams)) @@ -245,7 +245,7 @@ func NewCmdCreateServiceClusterIP(f cmdutil.Factory, ioStreams genericclioptions cmd := &cobra.Command{ Use: "clusterip NAME [--tcp=:] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a ClusterIP service."), + Short: i18n.T("Create a ClusterIP service"), Long: serviceClusterIPLong, Example: serviceClusterIPExample, Run: func(cmd *cobra.Command, args []string) { @@ -283,7 +283,7 @@ func NewCmdCreateServiceNodePort(f cmdutil.Factory, ioStreams genericclioptions. cmd := &cobra.Command{ Use: "nodeport NAME [--tcp=port:targetPort] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a NodePort service."), + Short: i18n.T("Create a NodePort service"), Long: serviceNodePortLong, Example: serviceNodePortExample, Run: func(cmd *cobra.Command, args []string) { @@ -320,7 +320,7 @@ func NewCmdCreateServiceLoadBalancer(f cmdutil.Factory, ioStreams genericcliopti cmd := &cobra.Command{ Use: "loadbalancer NAME [--tcp=port:targetPort] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create a LoadBalancer service."), + Short: i18n.T("Create a LoadBalancer service"), Long: serviceLoadBalancerLong, Example: serviceLoadBalancerExample, Run: func(cmd *cobra.Command, args []string) { @@ -360,7 +360,7 @@ func NewCmdCreateServiceExternalName(f cmdutil.Factory, ioStreams genericcliopti cmd := &cobra.Command{ Use: "externalname NAME --external-name external.name [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Create an ExternalName service."), + Short: i18n.T("Create an ExternalName service"), Long: serviceExternalNameLong, Example: serviceExternalNameExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/delete/delete.go b/pkg/cmd/delete/delete.go index 1a48ecf2..4f9d8062 100644 --- a/pkg/cmd/delete/delete.go +++ b/pkg/cmd/delete/delete.go @@ -43,9 +43,9 @@ import ( var ( deleteLong = templates.LongDesc(i18n.T(` - Delete resources by filenames, stdin, resources and names, or by resources and label selector. + Delete resources by file names, stdin, resources and names, or by resources and label selector. - JSON and YAML formats are accepted. Only one type of the arguments may be specified: filenames, + JSON and YAML formats are accepted. Only one type of argument may be specified: file names, resources and names, or resources and label selector. Some resources, such as pods, support graceful deletion. These resources define a default period @@ -54,7 +54,8 @@ var ( represent entities in the cluster, deletion may not be acknowledged immediately. If the node hosting a pod is down or cannot reach the API server, termination may take significantly longer than the grace period. To force delete a resource, you must specify the --force flag. - Note: only a subset of resources support graceful deletion. In absence of the support, --grace-period is ignored. + Note: only a subset of resources support graceful deletion. In absence of the support, + the --grace-period flag is ignored. IMPORTANT: Force deleting pods does not wait for confirmation that the pod's processes have been terminated, which can leave those processes running until the node detects the deletion and @@ -63,7 +64,7 @@ var ( multiple processes running on different machines using the same identification which may lead to data corruption or inconsistency. Only force delete pods when you are sure the pod is terminated, or if your application can tolerate multiple copies of the same pod running at once. - Also, if you force delete pods the scheduler may place new pods on those nodes before the node + Also, if you force delete pods, the scheduler may place new pods on those nodes before the node has released those resources and causing those pods to be evicted immediately. Note that the delete command does NOT do resource version checks, so if someone submits an @@ -71,19 +72,19 @@ var ( rest of the resource.`)) deleteExample = templates.Examples(i18n.T(` - # Delete a pod using the type and name specified in pod.json. + # Delete a pod using the type and name specified in pod.json kubectl delete -f ./pod.json - # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml. + # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml kubectl delete -k dir - # Delete a pod based on the type and name in the JSON passed into stdin. + # Delete a pod based on the type and name in the JSON passed into stdin cat pod.json | kubectl delete -f - # Delete pods and services with same names "baz" and "foo" kubectl delete pod,service baz foo - # Delete pods and services with label name=myLabel. + # Delete pods and services with label name=myLabel kubectl delete pods,services -l name=myLabel # Delete a pod with minimal delay @@ -133,7 +134,7 @@ func NewCmdDelete(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra cmd := &cobra.Command{ Use: "delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)])", DisableFlagsInUseLine: true, - Short: i18n.T("Delete resources by filenames, stdin, resources and names, or by resources and label selector"), + Short: i18n.T("Delete resources by file names, stdin, resources and names, or by resources and label selector"), Long: deleteLong, Example: deleteExample, ValidArgsFunction: util.ResourceTypeAndNameCompletionFunc(f), diff --git a/pkg/cmd/describe/describe.go b/pkg/cmd/describe/describe.go index f2866f57..84e324c8 100644 --- a/pkg/cmd/describe/describe.go +++ b/pkg/cmd/describe/describe.go @@ -37,7 +37,7 @@ import ( var ( describeLong = templates.LongDesc(i18n.T(` - Show details of a specific resource or group of resources + Show details of a specific resource or group of resources. Print a detailed description of the selected resources, including related resources such as events or controllers. You may select a single object by name, all objects of that @@ -65,7 +65,7 @@ var ( kubectl describe po -l name=myLabel # Describe all pods managed by the 'frontend' replication controller (rc-created pods - # get the name of the rc as a prefix in the pod the name). + # get the name of the rc as a prefix in the pod the name) kubectl describe pods frontend`)) ) diff --git a/pkg/cmd/diff/diff.go b/pkg/cmd/diff/diff.go index 44b55da2..7b810ec9 100644 --- a/pkg/cmd/diff/diff.go +++ b/pkg/cmd/diff/diff.go @@ -51,17 +51,17 @@ import ( var ( diffLong = templates.LongDesc(i18n.T(` - Diff configurations specified by filename or stdin between the current online + Diff configurations specified by file name or stdin between the current online configuration, and the configuration as it would be if applied. - Output is always YAML. + The output is always YAML. KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own diff command. Users can use external commands with params too, example: KUBECTL_EXTERNAL_DIFF="colordiff -N -u" By default, the "diff" command available in your path will be - run with "-u" (unified diff) and "-N" (treat absent files as empty) options. + run with the "-u" (unified diff) and "-N" (treat absent files as empty) options. Exit status: 0 @@ -74,7 +74,7 @@ var ( Note: KUBECTL_EXTERNAL_DIFF, if used, is expected to follow that convention.`)) diffExample = templates.Examples(i18n.T(` - # Diff resources included in pod.json. + # Diff resources included in pod.json kubectl diff -f pod.json # Diff file read from stdin @@ -139,7 +139,7 @@ func NewCmdDiff(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C cmd := &cobra.Command{ Use: "diff -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Diff live version against would-be applied version"), + Short: i18n.T("Diff the live version against a would-be applied version"), Long: diffLong, Example: diffExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/drain/drain.go b/pkg/cmd/drain/drain.go index e731af41..f14a4627 100644 --- a/pkg/cmd/drain/drain.go +++ b/pkg/cmd/drain/drain.go @@ -56,7 +56,7 @@ var ( Mark node as unschedulable.`)) cordonExample = templates.Examples(i18n.T(` - # Mark node "foo" as unschedulable. + # Mark node "foo" as unschedulable kubectl cordon foo`)) ) @@ -85,8 +85,8 @@ var ( Mark node as schedulable.`)) uncordonExample = templates.Examples(i18n.T(` - # Mark node "foo" as schedulable. - $ kubectl uncordon foo`)) + # Mark node "foo" as schedulable + kubectl uncordon foo`)) ) func NewCmdUncordon(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { @@ -114,16 +114,16 @@ var ( Drain node in preparation for maintenance. The given node will be marked unschedulable to prevent new pods from arriving. - 'drain' evicts the pods if the APIServer supports + 'drain' evicts the pods if the API server supports [eviction](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/). Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through - the API server). If there are DaemonSet-managed pods, drain will not proceed + the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any - DaemonSet-managed pods, because those pods would be immediately replaced by the - DaemonSet controller, which ignores unschedulable markings. If there are any - pods that are neither mirror pods nor managed by ReplicationController, - ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you + daemon set-managed pods, because those pods would be immediately replaced by the + daemon set controller, which ignores unschedulable markings. If there are any + pods that are neither mirror pods nor managed by a replication controller, + replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing. @@ -136,11 +136,11 @@ var ( ![Workflow](https://kubernetes.io/images/docs/kubectl_drain.svg)`)) drainExample = templates.Examples(i18n.T(` - # Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it. - $ kubectl drain foo --force + # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set on it + kubectl drain foo --force - # As above, but abort if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet, and use a grace period of 15 minutes. - $ kubectl drain foo --grace-period=900`)) + # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set, and use a grace period of 15 minutes + kubectl drain foo --grace-period=900`)) ) func NewDrainCmdOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *DrainCmdOptions { diff --git a/pkg/cmd/edit/edit.go b/pkg/cmd/edit/edit.go index 7384fcc1..6b262897 100644 --- a/pkg/cmd/edit/edit.go +++ b/pkg/cmd/edit/edit.go @@ -32,10 +32,10 @@ var ( Edit a resource from the default editor. The edit command allows you to directly edit any API resource you can retrieve via the - command line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR + command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. You can edit multiple objects, although changes are applied one at a time. The command - accepts filenames as well as command line arguments, although the files you point to must + accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources. Editing is done with the API version used to fetch the resource. @@ -53,16 +53,16 @@ var ( saved copy to include the latest resource version.`)) editExample = templates.Examples(i18n.T(` - # Edit the service named 'docker-registry': + # Edit the service named 'docker-registry' kubectl edit svc/docker-registry # Use an alternative editor KUBE_EDITOR="nano" kubectl edit svc/docker-registry - # Edit the job 'myjob' in JSON using the v1 API format: + # Edit the job 'myjob' in JSON using the v1 API format kubectl edit job.v1.batch/myjob -o json - # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation: + # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation kubectl edit deployment/mydeployment -o yaml --save-config`)) ) diff --git a/pkg/cmd/exec/exec.go b/pkg/cmd/exec/exec.go index 5c8923d4..436e547d 100644 --- a/pkg/cmd/exec/exec.go +++ b/pkg/cmd/exec/exec.go @@ -46,21 +46,21 @@ import ( var ( execExample = templates.Examples(i18n.T(` - # Get output from running 'date' command from pod mypod, using the first container by default + # Get output from running the 'date' command from pod mypod, using the first container by default kubectl exec mypod -- date - # Get output from running 'date' command in ruby-container from pod mypod + # Get output from running the 'date' command in ruby-container from pod mypod kubectl exec mypod -c ruby-container -- date - # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod mypod + # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client kubectl exec mypod -c ruby-container -i -t -- bash -il - # List contents of /usr from the first container of pod mypod and sort by modification time. + # List contents of /usr from the first container of pod mypod and sort by modification time # If the command you want to execute in the pod has any flags in common (e.g. -i), - # you must use two dashes (--) to separate your command's flags/arguments. + # you must use two dashes (--) to separate your command's flags/arguments # Also note, do not surround your command and its flags/arguments with quotes - # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr"). + # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr") kubectl exec mypod -i -t -- ls -t /usr # Get output from running 'date' command from the first pod of the deployment mydeployment, using the first container by default diff --git a/pkg/cmd/explain/explain.go b/pkg/cmd/explain/explain.go index 53816ee3..0ae86b1d 100644 --- a/pkg/cmd/explain/explain.go +++ b/pkg/cmd/explain/explain.go @@ -33,7 +33,7 @@ import ( var ( explainLong = templates.LongDesc(i18n.T(` - List the fields for supported resources + List the fields for supported resources. This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier: @@ -76,7 +76,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericclioptions.I cmd := &cobra.Command{ Use: "explain RESOURCE", DisableFlagsInUseLine: true, - Short: i18n.T("Documentation of resources"), + Short: i18n.T("Get documentation for a resource"), Long: explainLong + "\n\n" + cmdutil.SuggestAPIResources(parent), Example: explainExamples, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/expose/expose.go b/pkg/cmd/expose/expose.go index c95421dc..8e3a2951 100644 --- a/pkg/cmd/expose/expose.go +++ b/pkg/cmd/expose/expose.go @@ -59,10 +59,10 @@ var ( `) + exposeResources) exposeExample = templates.Examples(i18n.T(` - # Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000. + # Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000 kubectl expose rc nginx --port=80 --target-port=8000 - # Create a service for a replication controller identified by type and name specified in "nginx-controller.yaml", which serves on port 80 and connects to the containers on port 8000. + # Create a service for a replication controller identified by type and name specified in "nginx-controller.yaml", which serves on port 80 and connects to the containers on port 8000 kubectl expose -f nginx-controller.yaml --port=80 --target-port=8000 # Create a service for a pod valid-pod, which serves on port 444 with the name "frontend" @@ -74,10 +74,10 @@ var ( # Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video-stream'. kubectl expose rc streamer --port=4100 --protocol=UDP --name=video-stream - # Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000. + # Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000 kubectl expose rs nginx --port=80 --target-port=8000 - # Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000. + # Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000 kubectl expose deployment nginx --port=80 --target-port=8000`)) ) @@ -131,7 +131,7 @@ func NewCmdExposeService(f cmdutil.Factory, streams genericclioptions.IOStreams) cmd := &cobra.Command{ Use: "expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]", DisableFlagsInUseLine: true, - Short: i18n.T("Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service"), + Short: i18n.T("Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service"), Long: exposeLong, Example: exposeExample, ValidArgsFunction: util.SpecifiedResourceTypeAndNameCompletionFunc(f, validArgs), diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index 3252bb14..f2e07bee 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -90,7 +90,7 @@ type GetOptions struct { var ( getLong = templates.LongDesc(i18n.T(` - Display one or many resources + Display one or many resources. Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the @@ -103,37 +103,37 @@ var ( of the --template flag, you can filter the attributes of the fetched resources.`)) getExample = templates.Examples(i18n.T(` - # List all pods in ps output format. + # List all pods in ps output format kubectl get pods - # List all pods in ps output format with more information (such as node name). + # List all pods in ps output format with more information (such as node name) kubectl get pods -o wide - # List a single replication controller with specified NAME in ps output format. + # List a single replication controller with specified NAME in ps output format kubectl get replicationcontroller web - # List deployments in JSON output format, in the "v1" version of the "apps" API group: + # List deployments in JSON output format, in the "v1" version of the "apps" API group kubectl get deployments.v1.apps -o json - # List a single pod in JSON output format. + # List a single pod in JSON output format kubectl get -o json pod web-pod-13je7 - # List a pod identified by type and name specified in "pod.yaml" in JSON output format. + # List a pod identified by type and name specified in "pod.yaml" in JSON output format kubectl get -f pod.yaml -o json - # List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml. + # List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml kubectl get -k dir/ - # Return only the phase value of the specified pod. + # Return only the phase value of the specified pod kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}} - # List resource information in custom columns. + # List resource information in custom columns kubectl get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image - # List all replication controllers and services together in ps output format. + # List all replication controllers and services together in ps output format kubectl get rc,services - # List one or more resources by their type and names. + # List one or more resources by their type and names kubectl get rc/web service/frontend pods/web-pod-13je7`)) ) diff --git a/pkg/cmd/label/label.go b/pkg/cmd/label/label.go index 5781b6e6..0041e414 100644 --- a/pkg/cmd/label/label.go +++ b/pkg/cmd/label/label.go @@ -88,15 +88,15 @@ var ( Update the labels on a resource. * A label key and value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters each. - * Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app + * Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app. * If --overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error. * If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used.`)) labelExample = templates.Examples(i18n.T(` - # Update pod 'foo' with the label 'unhealthy' and the value 'true'. + # Update pod 'foo' with the label 'unhealthy' and the value 'true' kubectl label pods foo unhealthy=true - # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value. + # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value kubectl label --overwrite pods foo status=unhealthy # Update all pods in the namespace @@ -105,11 +105,11 @@ var ( # Update a pod identified by the type and name in "pod.json" kubectl label -f pod.json status=unhealthy - # Update pod 'foo' only if the resource is unchanged from version 1. + # Update pod 'foo' only if the resource is unchanged from version 1 kubectl label pods foo status=unhealthy --resource-version=1 - # Update pod 'foo' by removing a label named 'bar' if it exists. - # Does not require the --overwrite flag. + # Update pod 'foo' by removing a label named 'bar' if it exists + # Does not require the --overwrite flag kubectl label pods foo bar-`)) ) diff --git a/pkg/cmd/patch/patch.go b/pkg/cmd/patch/patch.go index f98fe9e8..b4e49f5e 100644 --- a/pkg/cmd/patch/patch.go +++ b/pkg/cmd/patch/patch.go @@ -76,24 +76,24 @@ type PatchOptions struct { var ( patchLong = templates.LongDesc(i18n.T(` - Update field(s) of a resource using strategic merge patch, a JSON merge patch, or a JSON patch. + Update fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch. JSON and YAML formats are accepted.`)) patchExample = templates.Examples(i18n.T(` - # Partially update a node using a strategic merge patch. Specify the patch as JSON. + # Partially update a node using a strategic merge patch, specifying the patch as JSON kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' - # Partially update a node using a strategic merge patch. Specify the patch as YAML. + # Partially update a node using a strategic merge patch, specifying the patch as YAML kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true' - # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch. + # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}' - # Update a container's image; spec.containers[*].name is required because it's a merge key. + # Update a container's image; spec.containers[*].name is required because it's a merge key kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}' - # Update a container's image using a json patch with positional arrays. + # Update a container's image using a JSON patch with positional arrays kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]'`)) ) @@ -112,7 +112,7 @@ func NewCmdPatch(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr cmd := &cobra.Command{ Use: "patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE]", DisableFlagsInUseLine: true, - Short: i18n.T("Update field(s) of a resource"), + Short: i18n.T("Update fields of a resource"), Long: patchLong, Example: patchExample, ValidArgsFunction: util.ResourceTypeAndNameCompletionFunc(f), diff --git a/pkg/cmd/plugin/plugin.go b/pkg/cmd/plugin/plugin.go index a8197839..db8bcfd0 100644 --- a/pkg/cmd/plugin/plugin.go +++ b/pkg/cmd/plugin/plugin.go @@ -59,7 +59,7 @@ func NewCmdPlugin(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra cmd := &cobra.Command{ Use: "plugin [flags]", DisableFlagsInUseLine: true, - Short: i18n.T("Provides utilities for interacting with plugins."), + Short: i18n.T("Provides utilities for interacting with plugins"), Long: pluginLong, Run: func(cmd *cobra.Command, args []string) { cmdutil.DefaultSubCommandRun(streams.ErrOut)(cmd, args) @@ -87,7 +87,7 @@ func NewCmdPluginList(f cmdutil.Factory, streams genericclioptions.IOStreams) *c cmd := &cobra.Command{ Use: "list", - Short: i18n.T("list all visible plugin executables on a user's PATH"), + Short: i18n.T("List all visible plugin executables on a user's PATH"), Long: pluginListLong, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(cmd)) diff --git a/pkg/cmd/portforward/portforward.go b/pkg/cmd/portforward/portforward.go index 4770d109..6c9fdba5 100644 --- a/pkg/cmd/portforward/portforward.go +++ b/pkg/cmd/portforward/portforward.go @@ -66,7 +66,7 @@ var ( Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted. If there are multiple pods matching the criteria, a pod will be selected automatically. The - forwarding session ends when the selected pod terminates, and rerun of the command is needed + forwarding session ends when the selected pod terminates, and a rerun of the command is needed to resume forwarding.`)) portforwardExample = templates.Examples(i18n.T(` diff --git a/pkg/cmd/proxy/proxy.go b/pkg/cmd/proxy/proxy.go index 7ebb6753..76c60dc9 100644 --- a/pkg/cmd/proxy/proxy.go +++ b/pkg/cmd/proxy/proxy.go @@ -66,31 +66,31 @@ const ( var ( proxyLong = templates.LongDesc(i18n.T(` Creates a proxy server or application-level gateway between localhost and - the Kubernetes API Server. It also allows serving static content over specified + the Kubernetes API server. It also allows serving static content over specified HTTP path. All incoming data enters through one port and gets forwarded to - the remote kubernetes API Server port, except for the path matching the static content path.`)) + the remote Kubernetes API server port, except for the path matching the static content path.`)) proxyExample = templates.Examples(i18n.T(` - # To proxy all of the kubernetes api and nothing else. + # To proxy all of the Kubernetes API and nothing else kubectl proxy --api-prefix=/ - # To proxy only part of the kubernetes api and also some static files. + # To proxy only part of the Kubernetes API and also some static files # You can get pods info with 'curl localhost:8001/api/v1/pods' kubectl proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/ - # To proxy the entire kubernetes api at a different root. + # To proxy the entire Kubernetes API at a different root # You can get pods info with 'curl localhost:8001/custom/api/v1/pods' kubectl proxy --api-prefix=/custom/ - # Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/ + # Run a proxy to the Kubernetes API server on port 8011, serving static content from ./local/www/ kubectl proxy --port=8011 --www=./local/www/ - # Run a proxy to kubernetes apiserver on an arbitrary local port. - # The chosen port for the server will be output to stdout. + # Run a proxy to the Kubernetes API server on an arbitrary local port + # The chosen port for the server will be output to stdout kubectl proxy --port=0 - # Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api - # This makes e.g. the pods api available at localhost:8001/k8s-api/v1/pods/ + # Run a proxy to the Kubernetes API server, changing the API prefix to k8s-api + # This makes e.g. the pods API available at localhost:8001/k8s-api/v1/pods/ kubectl proxy --api-prefix=/k8s-api`)) ) diff --git a/pkg/cmd/replace/replace.go b/pkg/cmd/replace/replace.go index 5ac2047c..a5e33103 100644 --- a/pkg/cmd/replace/replace.go +++ b/pkg/cmd/replace/replace.go @@ -46,7 +46,7 @@ import ( var ( replaceLong = templates.LongDesc(i18n.T(` - Replace a resource by filename or stdin. + Replace a resource by file name or stdin. JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by @@ -54,10 +54,10 @@ var ( $ kubectl get TYPE NAME -o yaml`)) replaceExample = templates.Examples(i18n.T(` - # Replace a pod using the data in pod.json. + # Replace a pod using the data in pod.json kubectl replace -f ./pod.json - # Replace a pod based on the JSON passed into stdin. + # Replace a pod based on the JSON passed into stdin cat pod.json | kubectl replace -f - # Update a single-container pod's image version (tag) to v4 @@ -112,7 +112,7 @@ func NewCmdReplace(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobr cmd := &cobra.Command{ Use: "replace -f FILENAME", DisableFlagsInUseLine: true, - Short: i18n.T("Replace a resource by filename or stdin"), + Short: i18n.T("Replace a resource by file name or stdin"), Long: replaceLong, Example: replaceExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/rollout/rollout_pause.go b/pkg/cmd/rollout/rollout_pause.go index b1ddd497..82d8d19a 100644 --- a/pkg/cmd/rollout/rollout_pause.go +++ b/pkg/cmd/rollout/rollout_pause.go @@ -55,16 +55,16 @@ type PauseOptions struct { var ( pauseLong = templates.LongDesc(i18n.T(` - Mark the provided resource as paused + Mark the provided resource as paused. Paused resources will not be reconciled by a controller. Use "kubectl rollout resume" to resume a paused resource. Currently only deployments support being paused.`)) pauseExample = templates.Examples(` - # Mark the nginx deployment as paused. Any current state of - # the deployment will continue its function, new updates to the deployment will not - # have an effect as long as the deployment is paused. + # Mark the nginx deployment as paused + # Any current state of the deployment will continue its function; new updates + # to the deployment will not have an effect as long as the deployment is paused kubectl rollout pause deployment/nginx`) ) diff --git a/pkg/cmd/rollout/rollout_restart.go b/pkg/cmd/rollout/rollout_restart.go index 13a86ab2..a3b66dd5 100644 --- a/pkg/cmd/rollout/rollout_restart.go +++ b/pkg/cmd/rollout/rollout_restart.go @@ -57,13 +57,13 @@ var ( restartLong = templates.LongDesc(i18n.T(` Restart a resource. - Resource will be rollout restarted.`)) + Resource rollout will be restarted.`)) restartExample = templates.Examples(` # Restart a deployment kubectl rollout restart deployment/nginx - # Restart a daemonset + # Restart a daemon set kubectl rollout restart daemonset/abc`) ) diff --git a/pkg/cmd/rollout/rollout_resume.go b/pkg/cmd/rollout/rollout_resume.go index 8659809c..9b67290c 100644 --- a/pkg/cmd/rollout/rollout_resume.go +++ b/pkg/cmd/rollout/rollout_resume.go @@ -56,7 +56,7 @@ type ResumeOptions struct { var ( resumeLong = templates.LongDesc(i18n.T(` - Resume a paused resource + Resume a paused resource. Paused resources will not be reconciled by a controller. By resuming a resource, we allow it to be reconciled again. diff --git a/pkg/cmd/rollout/rollout_undo.go b/pkg/cmd/rollout/rollout_undo.go index aabf67d1..873acdcd 100644 --- a/pkg/cmd/rollout/rollout_undo.go +++ b/pkg/cmd/rollout/rollout_undo.go @@ -53,16 +53,16 @@ type UndoOptions struct { var ( undoLong = templates.LongDesc(i18n.T(` - Rollback to a previous rollout.`)) + Roll back to a previous rollout.`)) undoExample = templates.Examples(` - # Rollback to the previous deployment + # Roll back to the previous deployment kubectl rollout undo deployment/abc - # Rollback to daemonset revision 3 + # Roll back to daemonset revision 3 kubectl rollout undo daemonset/abc --to-revision=3 - # Rollback to the previous deployment with dry-run + # Roll back to the previous deployment with dry-run kubectl rollout undo --dry-run=server deployment/abc`) ) diff --git a/pkg/cmd/run/run.go b/pkg/cmd/run/run.go index d9861ae8..edaff054 100644 --- a/pkg/cmd/run/run.go +++ b/pkg/cmd/run/run.go @@ -60,31 +60,31 @@ var ( runLong = templates.LongDesc(i18n.T(`Create and run a particular image in a pod.`)) runExample = templates.Examples(i18n.T(` - # Start a nginx pod. + # Start a nginx pod kubectl run nginx --image=nginx - # Start a hazelcast pod and let the container expose port 5701. + # Start a hazelcast pod and let the container expose port 5701 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 - # Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container. + # Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default" - # Start a hazelcast pod and set labels "app=hazelcast" and "env=prod" in the container. + # Start a hazelcast pod and set labels "app=hazelcast" and "env=prod" in the container kubectl run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod" - # Dry run. Print the corresponding API objects without creating them. + # Dry run; print the corresponding API objects without creating them kubectl run nginx --image=nginx --dry-run=client - # Start a nginx pod, but overload the spec with a partial set of values parsed from JSON. + # Start a nginx pod, but overload the spec with a partial set of values parsed from JSON kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }' - # Start a busybox pod and keep it in the foreground, don't restart it if it exits. + # Start a busybox pod and keep it in the foreground, don't restart it if it exits kubectl run -i -t busybox --image=busybox --restart=Never - # Start the nginx pod using the default command, but use custom arguments (arg1 .. argN) for that command. + # Start the nginx pod using the default command, but use custom arguments (arg1 .. argN) for that command kubectl run nginx --image=nginx -- ... - # Start the nginx pod using a different command and custom arguments. + # Start the nginx pod using a different command and custom arguments kubectl run nginx --image=nginx --command -- ... `)) ) diff --git a/pkg/cmd/scale/scale.go b/pkg/cmd/scale/scale.go index a87c3e8e..fd26e187 100644 --- a/pkg/cmd/scale/scale.go +++ b/pkg/cmd/scale/scale.go @@ -38,7 +38,7 @@ import ( var ( scaleLong = templates.LongDesc(i18n.T(` - Set a new size for a Deployment, ReplicaSet, Replication Controller, or StatefulSet. + Set a new size for a deployment, replica set, replication controller, or stateful set. Scale also allows users to specify one or more preconditions for the scale action. @@ -47,19 +47,19 @@ var ( scale is sent to the server.`)) scaleExample = templates.Examples(i18n.T(` - # Scale a replicaset named 'foo' to 3. + # Scale a replica set named 'foo' to 3 kubectl scale --replicas=3 rs/foo - # Scale a resource identified by type and name specified in "foo.yaml" to 3. + # Scale a resource identified by type and name specified in "foo.yaml" to 3 kubectl scale --replicas=3 -f foo.yaml - # If the deployment named mysql's current size is 2, scale mysql to 3. + # If the deployment named mysql's current size is 2, scale mysql to 3 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql - # Scale multiple replication controllers. + # Scale multiple replication controllers kubectl scale --replicas=5 rc/foo rc/bar rc/baz - # Scale statefulset named 'web' to 3. + # Scale stateful set named 'web' to 3 kubectl scale --replicas=3 statefulset/web`)) ) @@ -111,7 +111,7 @@ func NewCmdScale(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobr cmd := &cobra.Command{ Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)", DisableFlagsInUseLine: true, - Short: i18n.T("Set a new size for a Deployment, ReplicaSet or Replication Controller"), + Short: i18n.T("Set a new size for a deployment, replica set, or replication controller"), Long: scaleLong, Example: scaleExample, ValidArgsFunction: util.SpecifiedResourceTypeAndNameCompletionFunc(f, validArgs), diff --git a/pkg/cmd/set/set.go b/pkg/cmd/set/set.go index 54b7aed1..952e7d14 100644 --- a/pkg/cmd/set/set.go +++ b/pkg/cmd/set/set.go @@ -26,7 +26,7 @@ import ( var ( setLong = templates.LongDesc(i18n.T(` - Configure application resources + Configure application resources. These commands help you make changes to existing application resources.`)) ) diff --git a/pkg/cmd/set/set_image.go b/pkg/cmd/set/set_image.go index 5adcf925..27a8da9e 100644 --- a/pkg/cmd/set/set_image.go +++ b/pkg/cmd/set/set_image.go @@ -75,7 +75,7 @@ var ( `) + imageResources) imageExample = templates.Examples(` - # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'. + # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox' kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1 # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1' @@ -107,7 +107,7 @@ func NewCmdImage(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra. cmd := &cobra.Command{ Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N", DisableFlagsInUseLine: true, - Short: i18n.T("Update image of a pod template"), + Short: i18n.T("Update the image of a pod template"), Long: imageLong, Example: imageExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/set/set_resources.go b/pkg/cmd/set/set_resources.go index 04dcfafc..544759a3 100644 --- a/pkg/cmd/set/set_resources.go +++ b/pkg/cmd/set/set_resources.go @@ -39,9 +39,9 @@ import ( var ( resourcesLong = templates.LongDesc(i18n.T(` - Specify compute resource requirements (cpu, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits. + Specify compute resource requirements (CPU, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits. - for each compute resource, if a limit is specified and a request is omitted, the request will default to the limit. + For each compute resource, if a limit is specified and a request is omitted, the request will default to the limit. Possible resources include (case insensitive): %s.`)) diff --git a/pkg/cmd/set/set_selector.go b/pkg/cmd/set/set_selector.go index a4c40db2..62bd64cc 100644 --- a/pkg/cmd/set/set_selector.go +++ b/pkg/cmd/set/set_selector.go @@ -72,7 +72,7 @@ var ( If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.`)) selectorExample = templates.Examples(` - # set the labels and selector before creating a deployment/service pair. + # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -`) ) diff --git a/pkg/cmd/set/set_serviceaccount.go b/pkg/cmd/set/set_serviceaccount.go index 02349ea1..625ccea5 100644 --- a/pkg/cmd/set/set_serviceaccount.go +++ b/pkg/cmd/set/set_serviceaccount.go @@ -41,17 +41,17 @@ var ( serviceaccountResources = i18n.T(`replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset`) serviceaccountLong = templates.LongDesc(i18n.T(` - Update ServiceAccount of pod template resources. + Update the service account of pod template resources. Possible resources (case insensitive) can be: `) + serviceaccountResources) serviceaccountExample = templates.Examples(i18n.T(` - # Set Deployment nginx-deployment's ServiceAccount to serviceaccount1 + # Set deployment nginx-deployment's service account to serviceaccount1 kubectl set serviceaccount deployment nginx-deployment serviceaccount1 - # Print the result (in yaml format) of updated nginx deployment with serviceaccount from local file, without hitting apiserver + # Print the result (in YAML format) of updated nginx deployment with the service account from local file, without hitting the API server kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run=client -o yaml `)) ) @@ -99,7 +99,7 @@ func NewCmdServiceAccount(f cmdutil.Factory, streams genericclioptions.IOStreams Use: "serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT", DisableFlagsInUseLine: true, Aliases: []string{"sa"}, - Short: i18n.T("Update ServiceAccount of a resource"), + Short: i18n.T("Update the service account of a resource"), Long: serviceaccountLong, Example: serviceaccountExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/set/set_subject.go b/pkg/cmd/set/set_subject.go index ec6974fe..9de0a9d1 100644 --- a/pkg/cmd/set/set_subject.go +++ b/pkg/cmd/set/set_subject.go @@ -38,16 +38,16 @@ import ( var ( subjectLong = templates.LongDesc(i18n.T(` - Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding.`)) + Update the user, group, or service account in a role binding or cluster role binding.`)) subjectExample = templates.Examples(` - # Update a ClusterRoleBinding for serviceaccount1 + # Update a cluster role binding for serviceaccount1 kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1 - # Update a RoleBinding for user1, user2, and group1 + # Update a role binding for user1, user2, and group1 kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1 - # Print the result (in yaml format) of updating rolebinding subjects from a local, without hitting the server + # Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml`) ) @@ -96,7 +96,7 @@ func NewCmdSubject(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobr cmd := &cobra.Command{ Use: "subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]", DisableFlagsInUseLine: true, - Short: i18n.T("Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding"), + Short: i18n.T("Update the user, group, or service account in a role binding or cluster role binding"), Long: subjectLong, Example: subjectExample, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/cmd/taint/taint.go b/pkg/cmd/taint/taint.go index 33b1608a..ec59d14c 100644 --- a/pkg/cmd/taint/taint.go +++ b/pkg/cmd/taint/taint.go @@ -72,17 +72,17 @@ var ( * A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect. * The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[1]d characters. - * Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app + * Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app. * The value is optional. If given, it must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to %[2]d characters. * The effect must be NoSchedule, PreferNoSchedule or NoExecute. * Currently taint can only apply to node.`)) taintExample = templates.Examples(i18n.T(` - # Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'. - # If a taint with that key and effect already exists, its value is replaced as specified. + # Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule' + # If a taint with that key and effect already exists, its value is replaced as specified kubectl taint nodes foo dedicated=special-user:NoSchedule - # Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists. + # Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists kubectl taint nodes foo dedicated:NoSchedule- # Remove from node 'foo' all the taints with key 'dedicated' diff --git a/pkg/cmd/top/top.go b/pkg/cmd/top/top.go index 051c7fb3..70acf046 100644 --- a/pkg/cmd/top/top.go +++ b/pkg/cmd/top/top.go @@ -47,7 +47,7 @@ var ( func NewCmdTop(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "top", - Short: i18n.T("Display Resource (CPU/Memory) usage."), + Short: i18n.T("Display resource (CPU/memory) usage"), Long: topLong, Run: cmdutil.DefaultSubCommandRun(streams.ErrOut), } diff --git a/pkg/cmd/top/top_node.go b/pkg/cmd/top/top_node.go index 5febad85..de744e6c 100644 --- a/pkg/cmd/top/top_node.go +++ b/pkg/cmd/top/top_node.go @@ -55,7 +55,7 @@ type TopNodeOptions struct { var ( topNodeLong = templates.LongDesc(i18n.T(` - Display Resource (CPU/Memory) usage of nodes. + Display resource (CPU/memory) usage of nodes. The top-node command allows you to see the resource consumption of nodes.`)) @@ -78,7 +78,7 @@ func NewCmdTopNode(f cmdutil.Factory, o *TopNodeOptions, streams genericclioptio cmd := &cobra.Command{ Use: "node [NAME | -l label]", DisableFlagsInUseLine: true, - Short: i18n.T("Display Resource (CPU/Memory) usage of nodes"), + Short: i18n.T("Display resource (CPU/memory) usage of nodes"), Long: topNodeLong, Example: topNodeExample, ValidArgsFunction: util.ResourceNameCompletionFunc(f, "node"), diff --git a/pkg/cmd/top/top_pod.go b/pkg/cmd/top/top_pod.go index 6c1e725b..770e8b05 100644 --- a/pkg/cmd/top/top_pod.go +++ b/pkg/cmd/top/top_pod.go @@ -65,7 +65,7 @@ const metricsCreationDelay = 2 * time.Minute var ( topPodLong = templates.LongDesc(i18n.T(` - Display Resource (CPU/Memory) usage of pods. + Display resource (CPU/memory) usage of pods. The 'top pod' command allows you to see the resource consumption of pods. @@ -97,7 +97,7 @@ func NewCmdTopPod(f cmdutil.Factory, o *TopPodOptions, streams genericclioptions cmd := &cobra.Command{ Use: "pod [NAME | -l label]", DisableFlagsInUseLine: true, - Short: i18n.T("Display Resource (CPU/Memory) usage of pods"), + Short: i18n.T("Display resource (CPU/memory) usage of pods"), Long: topPodLong, Example: topPodExample, ValidArgsFunction: util.ResourceNameCompletionFunc(f, "pod"), diff --git a/pkg/cmd/version/version.go b/pkg/cmd/version/version.go index 7f95146c..b261b416 100644 --- a/pkg/cmd/version/version.go +++ b/pkg/cmd/version/version.go @@ -71,7 +71,7 @@ func NewCmdVersion(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *co cmd := &cobra.Command{ Use: "version", Short: i18n.T("Print the client and server version information"), - Long: i18n.T("Print the client and server version information for the current context"), + Long: i18n.T("Print the client and server version information for the current context."), Example: versionExample, Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(f, cmd)) diff --git a/pkg/cmd/wait/wait.go b/pkg/cmd/wait/wait.go index cbd32318..65417947 100644 --- a/pkg/cmd/wait/wait.go +++ b/pkg/cmd/wait/wait.go @@ -56,16 +56,16 @@ var ( by providing the "delete" keyword as the value to the --for flag. A successful message will be printed to stdout indicating when the specified - condition has been met. One can use -o option to change to output destination.`)) + condition has been met. You can use -o option to change to output destination.`)) waitExample = templates.Examples(i18n.T(` - # Wait for the pod "busybox1" to contain the status condition of type "Ready". + # Wait for the pod "busybox1" to contain the status condition of type "Ready" kubectl wait --for=condition=Ready pod/busybox1 - # The default value of status condition is true, you can set false. + # The default value of status condition is true; you can set it to false kubectl wait --for=condition=Ready=false pod/busybox1 - # Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command. + # Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command kubectl delete pod/busybox1 kubectl wait --for=delete pod/busybox1 --timeout=60s`)) ) @@ -112,7 +112,7 @@ func NewCmdWait(restClientGetter genericclioptions.RESTClientGetter, streams gen cmd := &cobra.Command{ Use: "wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available]", - Short: i18n.T("Experimental: Wait for a specific condition on one or many resources."), + Short: i18n.T("Experimental: Wait for a specific condition on one or many resources"), Long: waitLong, Example: waitExample,