Skip to content

Commit

Permalink
Use bash comments in kubectl examples
Browse files Browse the repository at this point in the history
Comments in kubectl examples should use bash comments, not Go comments.
So, replaces // by # for example strings.
  • Loading branch information
apeeyush committed Aug 12, 2015
1 parent 5c08d27 commit 05e069d
Show file tree
Hide file tree
Showing 63 changed files with 270 additions and 270 deletions.
10 changes: 5 additions & 5 deletions docs/man/man1/kubectl-attach.1
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ Attach to a a process that is already running inside an existing container.
.RS

.nf
// get output from running pod 123456\-7890, using the first container by default
# get output from running pod 123456\-7890, using the first container by default
$ kubectl attach 123456\-7890
// get output from ruby\-container from pod 123456\-7890

# get output from ruby\-container from pod 123456\-7890
$ kubectl attach 123456\-7890 \-c ruby\-container date

// switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
// and sends stdout/stderr from 'bash' back to the client
# switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
# and sends stdout/stderr from 'bash' back to the client
$ kubectl attach 123456\-7890 \-c ruby\-container \-i \-t

.fi
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-config-set-cluster.1
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ Specifying a name that already exists will merge new fields on top of existing v
.RS

.nf
// 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
# Embed certificate authority data for the e2e cluster entry
$ kubectl config set\-cluster e2e \-\-certificate\-authority=\~/.kube/e2e/kubernetes.ca.crt

// Disable cert checking for the dev cluster entry
# Disable cert checking for the dev cluster entry
$ kubectl config set\-cluster e2e \-\-insecure\-skip\-tls\-verify=true

.fi
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-config-set-context.1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Specifying a name that already exists will merge new fields on top of existing v
.RS

.nf
// Set the user field on the gce context entry without touching other values
# Set the user field on the gce context entry without touching other values
$ kubectl config set\-context gce \-\-user=cluster\-admin

.fi
Expand Down
8 changes: 4 additions & 4 deletions docs/man/man1/kubectl-config-set-credentials.1
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ Bearer token and basic auth are mutually exclusive.
.RS

.nf
// Set only the "client\-key" field on the "cluster\-admin"
// entry, without touching other values:
# Set only the "client\-key" field on the "cluster\-admin"
# entry, without touching other values:
$ kubectl config set\-credentials cluster\-admin \-\-client\-key=\~/.kube/admin.key

// Set basic auth for the "cluster\-admin" entry
# Set basic auth for the "cluster\-admin" entry
$ kubectl config set\-credentials cluster\-admin \-\-username=admin \-\-password=uXFGweU9l35qcif

// Embed client certificate data in the "cluster\-admin" entry
# Embed client certificate data in the "cluster\-admin" entry
$ kubectl config set\-credentials cluster\-admin \-\-client\-certificate=\~/.kube/admin.crt \-\-embed\-certs=true

.fi
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-config-view.1
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values
.RS

.nf
// Show Merged kubeconfig settings.
# Show Merged kubeconfig settings.
$ kubectl config view

// Get the password for the e2e user
# Get the password for the e2e user
$ kubectl config view \-o template \-\-template='{{range .users}}{{ if eq .name "e2e" }}{{ index .user.password }}{{end}}{{end}}'

.fi
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-create.1
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ JSON and YAML formats are accepted.
.RS

.nf
// 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 \-

.fi
Expand Down
10 changes: 5 additions & 5 deletions docs/man/man1/kubectl-delete.1
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ will be lost along with the rest of the resource.
.RS

.nf
// 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 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 label name=myLabel.
# Delete pods and services with label name=myLabel.
$ kubectl delete pods,services \-l name=myLabel

// Delete a pod with UID 1234\-56\-7890\-234234\-456456.
# Delete a pod with UID 1234\-56\-7890\-234234\-456456.
$ kubectl delete pod 1234\-56\-7890\-234234\-456456

// Delete all pods
# Delete all pods
$ kubectl delete pods \-\-all

.fi
Expand Down
14 changes: 7 additions & 7 deletions docs/man/man1/kubectl-describe.1
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,23 @@ namespaces (ns) or secrets.
.RS

.nf
// Describe a node
# Describe a node
$ kubectl describe nodes kubernetes\-minion\-emt8.c.myproject.internal

// Describe a pod
# Describe a pod
$ kubectl describe pods/nginx

// Describe a pod using the data in pod.json.
# Describe a pod using the data in pod.json.
$ kubectl describe \-f pod.json

// Describe all pods
# Describe all pods
$ kubectl describe pods

// Describe pods by label name=myLabel
# Describe pods by label name=myLabel
$ 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).
# 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).
$ kubectl describe pods frontend

.fi
Expand Down
8 changes: 4 additions & 4 deletions docs/man/man1/kubectl-exec.1
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ Execute a command in a container.
.RS

.nf
// get output from running 'date' from pod 123456\-7890, using the first container by default
# get output from running 'date' from pod 123456\-7890, using the first container by default
$ kubectl exec 123456\-7890 date

// get output from running 'date' in ruby\-container from pod 123456\-7890
# get output from running 'date' in ruby\-container from pod 123456\-7890
$ kubectl exec 123456\-7890 \-c ruby\-container date

// switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
// and sends stdout/stderr from 'bash' back to the client
# switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
# and sends stdout/stderr from 'bash' back to the client
$ kubectl exec 123456\-7890 \-c ruby\-container \-i \-t \-\- bash \-il

.fi
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-expose.1
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,16 @@ re\-use the labels from the resource it exposes.
.RS

.nf
// Creates a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000.
# Creates 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

# Creates 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

// Creates a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx\-https"
# Creates a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx\-https"
$ kubectl expose service nginx \-\-port=443 \-\-target\-port=8443 \-\-name=nginx\-https

// Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video\-stream'.
# 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

.fi
Expand Down
14 changes: 7 additions & 7 deletions docs/man/man1/kubectl-get.1
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,25 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
.RS

.nf
// 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 a single pod in JSON output format.
# List a single pod in JSON output format.
$ kubectl get \-o json pod web\-pod\-13je7

// Return only the phase value of the specified pod.
# Return only the phase value of the specified pod.
$ kubectl get \-o template web\-pod\-13je7 \-\-template={{.status.phase}} \-\-api\-version=v1

// 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

.fi
Expand Down
12 changes: 6 additions & 6 deletions docs/man/man1/kubectl-label.1
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,20 @@ If \-\-resource\-version is specified, then updates will use this resource versi
.RS

.nf
// 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
# Update all pods in the namespace
$ kubectl label pods \-\-all 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\-

.fi
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-logs.1
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ Print the logs for a container in a pod. If the pod has only one container, the
.RS

.nf
// Returns snapshot of ruby\-container logs from pod 123456\-7890.
# Returns snapshot of ruby\-container logs from pod 123456\-7890.
$ kubectl logs 123456\-7890 ruby\-container

// Returns snapshot of previous terminated ruby\-container logs from pod 123456\-7890.
# Returns snapshot of previous terminated ruby\-container logs from pod 123456\-7890.
$ kubectl logs \-p 123456\-7890 ruby\-container

// Starts streaming of ruby\-container logs from pod 123456\-7890.
# Starts streaming of ruby\-container logs from pod 123456\-7890.
$ kubectl logs \-f 123456\-7890 ruby\-container

.fi
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-patch.1
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ Please refer to the models in

.nf

// Partially update a node using strategic merge patch
# Partially update a node using strategic merge patch
kubectl patch node k8s\-node\-1 \-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"}]}}'

.fi
Expand Down
8 changes: 4 additions & 4 deletions docs/man/man1/kubectl-port-forward.1
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ Forward one or more local ports to a pod.

.nf

// listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
# listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
$ kubectl port\-forward mypod 5000 6000

// listens on port 8888 locally, forwarding to 5000 in the pod
# listens on port 8888 locally, forwarding to 5000 in the pod
$ kubectl port\-forward mypod 8888:5000

// listens on a random port locally, forwarding to 5000 in the pod
# listens on a random port locally, forwarding to 5000 in the pod
$ kubectl port\-forward mypod :5000

// listens on a random port locally, forwarding to 5000 in the pod
# listens on a random port locally, forwarding to 5000 in the pod
$ kubectl port\-forward mypod 0:5000

.fi
Expand Down
10 changes: 5 additions & 5 deletions docs/man/man1/kubectl-proxy.1
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ The above lets you 'curl localhost:8001/custom/api/v1/pods'
.RS

.nf
// Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/
# Run a proxy to kubernetes apiserver 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 kubernetes apiserver 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:8011/k8s\-api/v1/pods/
# Run a proxy to kubernetes apiserver, changing the api prefix to k8s\-api
# This makes e.g. the pods api available at localhost:8011/k8s\-api/v1/pods/
$ kubectl proxy \-\-api\-prefix=/k8s\-api

.fi
Expand Down
8 changes: 4 additions & 4 deletions docs/man/man1/kubectl-replace.1
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ Please refer to the models in
.RS

.nf
// 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
# Update a single\-container pod's image version (tag) to v4
kubectl get pod mypod \-o yaml | sed 's/\\(image: myimage\\):.*$/\\1:v4/' | kubectl replace \-f \-

// Force replace, delete and then re\-create the resource
# Force replace, delete and then re\-create the resource
kubectl replace \-\-force \-f ./pod.json

.fi
Expand Down
10 changes: 5 additions & 5 deletions docs/man/man1/kubectl-rolling-update.1
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ existing replication controller and overwrite at least one (common) label in its
.RS

.nf
// Update pods of frontend\-v1 using new replication controller data in frontend\-v2.json.
# Update pods of frontend\-v1 using new replication controller data in frontend\-v2.json.
$ kubectl rolling\-update frontend\-v1 \-f frontend\-v2.json

// Update pods of frontend\-v1 using JSON data passed into stdin.
# Update pods of frontend\-v1 using JSON data passed into stdin.
$ cat frontend\-v2.json | kubectl rolling\-update frontend\-v1 \-f \-

// Update the pods of frontend\-v1 to frontend\-v2 by just changing the image, and switching the
// name of the replication controller.
# Update the pods of frontend\-v1 to frontend\-v2 by just changing the image, and switching the
# name of the replication controller.
$ kubectl rolling\-update frontend\-v1 frontend\-v2 \-\-image=image:v2

// Update the pods of frontend by just changing the image, and keeping the old name
# Update the pods of frontend by just changing the image, and keeping the old name
$ kubectl rolling\-update frontend \-\-image=image:v2


Expand Down
8 changes: 4 additions & 4 deletions docs/man/man1/kubectl-run.1
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ Creates a replication controller to manage the created container(s).
.RS

.nf
// Starts a single instance of nginx.
# Starts a single instance of nginx.
$ kubectl run nginx \-\-image=nginx

// Starts a replicated instance of nginx.
# Starts a replicated instance of nginx.
$ kubectl run nginx \-\-image=nginx \-\-replicas=5

// 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

// Start a single instance of nginx, but overload the spec of the replication controller with a partial set of values parsed from JSON.
# Start a single instance of nginx, but overload the spec of the replication controller with a partial set of values parsed from JSON.
$ kubectl run nginx \-\-image=nginx \-\-overrides='{ "apiVersion": "v1", "spec": { ... } }'

.fi
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-scale.1
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ scale is sent to the server.
.RS

.nf
// Scale replication controller named 'foo' to 3.
# Scale replication controller named 'foo' to 3.
$ kubectl scale \-\-replicas=3 replicationcontrollers foo

// If the replication controller named foo's current size is 2, scale foo to 3.
# If the replication controller named foo's current size is 2, scale foo to 3.
$ kubectl scale \-\-current\-replicas=2 \-\-replicas=3 replicationcontrollers foo

// Scale multiple replication controllers.
# Scale multiple replication controllers.
$ kubectl scale \-\-replicas=5 rc/foo rc/bar

.fi
Expand Down
Loading

0 comments on commit 05e069d

Please sign in to comment.