From 88ca365f11e926aa32765ea67eeb59f9c9d98942 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sun, 17 Feb 2019 03:55:36 +0000 Subject: [PATCH] Use # not // for comments (#12672) Bourne-style shells don't use // --- content/en/docs/reference/kubectl/overview.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/content/en/docs/reference/kubectl/overview.md b/content/en/docs/reference/kubectl/overview.md index 3fa3836460..3a4b8da314 100644 --- a/content/en/docs/reference/kubectl/overview.md +++ b/content/en/docs/reference/kubectl/overview.md @@ -258,52 +258,52 @@ Use the following set of examples to help you familiarize yourself with running `kubectl create` - Create a resource from a file or stdin. ```shell -// Create a service using the definition in example-service.yaml. +# Create a service using the definition in example-service.yaml. $ kubectl create -f example-service.yaml -// Create a replication controller using the definition in example-controller.yaml. +# Create a replication controller using the definition in example-controller.yaml. $ kubectl create -f example-controller.yaml -// Create the objects that are defined in any .yaml, .yml, or .json file within the directory. +# Create the objects that are defined in any .yaml, .yml, or .json file within the directory. $ kubectl create -f ``` `kubectl get` - List one or more resources. ```shell -// List all pods in plain-text output format. +# List all pods in plain-text output format. $ kubectl get pods -// List all pods in plain-text output format and include additional information (such as node name). +# List all pods in plain-text output format and include additional information (such as node name). $ kubectl get pods -o wide -// List the replication controller with the specified name in plain-text output format. Tip: You can shorten and replace the 'replicationcontroller' resource type with the alias 'rc'. +# List the replication controller with the specified name in plain-text output format. Tip: You can shorten and replace the 'replicationcontroller' resource type with the alias 'rc'. $ kubectl get replicationcontroller -// List all replication controllers and services together in plain-text output format. +# List all replication controllers and services together in plain-text output format. $ kubectl get rc,services -// List all daemon sets, including uninitialized ones, in plain-text output format. +# List all daemon sets, including uninitialized ones, in plain-text output format. $ kubectl get ds --include-uninitialized -// List all pods running on node server01 +# List all pods running on node server01 $ kubectl get pods --field-selector=spec.nodeName=server01 ``` `kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default. ```shell -// Display the details of the node with name . +# Display the details of the node with name . $ kubectl describe nodes -// Display the details of the pod with name . +# Display the details of the pod with name . $ kubectl describe pods/ -// Display the details of all the pods that are managed by the replication controller named . -// Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller. +# Display the details of all the pods that are managed by the replication controller named . +# Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller. $ kubectl describe pods -// Describe all pods, not including uninitialized ones +# Describe all pods, not including uninitialized ones $ kubectl describe pods --include-uninitialized=false ``` @@ -322,39 +322,39 @@ the pods running on it, the events generated for the node etc. `kubectl delete` - Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources. ```shell -// Delete a pod using the type and name specified in the pod.yaml file. +# Delete a pod using the type and name specified in the pod.yaml file. $ kubectl delete -f pod.yaml -// Delete all the pods and services that have the label name=. +# Delete all the pods and services that have the label name=. $ kubectl delete pods,services -l name= -// Delete all the pods and services that have the label name=, including uninitialized ones. +# Delete all the pods and services that have the label name=, including uninitialized ones. $ kubectl delete pods,services -l name= --include-uninitialized -// Delete all pods, including uninitialized ones. +# Delete all pods, including uninitialized ones. $ kubectl delete pods --all ``` `kubectl exec` - Execute a command against a container in a pod. ```shell -// Get output from running 'date' from pod . By default, output is from the first container. +# Get output from running 'date' from pod . By default, output is from the first container. $ kubectl exec date -// Get output from running 'date' in container of pod . +# Get output from running 'date' in container of pod . $ kubectl exec -c date -// Get an interactive TTY and run /bin/bash from pod . By default, output is from the first container. +# Get an interactive TTY and run /bin/bash from pod . By default, output is from the first container. $ kubectl exec -ti /bin/bash ``` `kubectl logs` - Print the logs for a container in a pod. ```shell -// Return a snapshot of the logs from pod . +# Return a snapshot of the logs from pod . $ kubectl logs -// Start streaming the logs from pod . This is similar to the 'tail -f' Linux command. +# Start streaming the logs from pod . This is similar to the 'tail -f' Linux command. $ kubectl logs -f ``` @@ -363,26 +363,26 @@ $ kubectl logs -f Use the following set of examples to help you familiarize yourself with writing and using `kubectl` plugins: ```shell -// create a simple plugin in any language and name the resulting executable file -// so that it begins with the prefix "kubectl-" +# create a simple plugin in any language and name the resulting executable file +# so that it begins with the prefix "kubectl-" $ cat ./kubectl-hello #!/bin/bash # this plugin prints the words "hello world" echo "hello world" -// with our plugin written, let's make it executable +# with our plugin written, let's make it executable $ sudo chmod +x ./kubectl-hello -// and move it to a location in our PATH +# and move it to a location in our PATH $ sudo mv ./kubectl-hello /usr/local/bin -// we have now created and "installed" a kubectl plugin. -// we can begin using our plugin by invoking it from kubectl as if it were a regular command +# we have now created and "installed" a kubectl plugin. +# we can begin using our plugin by invoking it from kubectl as if it were a regular command $ kubectl hello hello world -// we can "uninstall" a plugin, by simply removing it from our PATH +# we can "uninstall" a plugin, by simply removing it from our PATH $ sudo rm /usr/local/bin/kubectl-hello ``` @@ -397,9 +397,9 @@ The following kubectl-compatible plugins are available: /usr/local/bin/kubectl-foo /usr/local/bin/kubectl-bar -// this command can also warn us about plugins that are -// not executable, or that are overshadowed by other -// plugins, for example +# this command can also warn us about plugins that are +# not executable, or that are overshadowed by other +# plugins, for example $ sudo chmod -x /usr/local/bin/kubectl-foo $ kubectl plugin list The following kubectl-compatible plugins are available: @@ -428,10 +428,10 @@ Running the above plugin gives us an output containing the user for the currentl context in our KUBECONFIG file: ```shell -// make the file executable +# make the file executable $ sudo chmod +x ./kubectl-whoami -// and move it into our PATH +# and move it into our PATH $ sudo mv ./kubectl-whoami /usr/local/bin $ kubectl whoami