Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update commented examples just remove Prompts ('$') #22177

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/man/man1/kubectl-annotate.1
Expand Up @@ -186,23 +186,23 @@ horizontalpodautoscalers (hpa), resourcequotas (quota) or secrets.
.nf
# 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'
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'
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.
$ kubectl annotate \-\-overwrite pods foo description='my frontend running nginx'
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'
kubectl annotate pods \-\-all description='my frontend running nginx'

# Update pod 'foo' only if the resource is unchanged from version 1.
$ kubectl annotate pods foo description='my frontend running nginx' \-\-resource\-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.
$ kubectl annotate pods foo description\-
kubectl annotate pods foo description\-

.fi
.RE
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-apply.1
Expand Up @@ -142,10 +142,10 @@ JSON and YAML formats are accepted.

.nf
# Apply the configuration in pod.json to a pod.
$ kubectl apply \-f ./pod.json
kubectl apply \-f ./pod.json

# Apply the JSON passed into stdin to a pod.
$ cat pod.json | kubectl apply \-f \-
cat pod.json | kubectl apply \-f \-

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-attach.1
Expand Up @@ -130,14 +130,14 @@ Attach to a process that is already running inside an existing container.

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

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

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

.fi
.RE
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-autoscale.1
Expand Up @@ -189,10 +189,10 @@ An autoscaler can automatically increase or decrease number of pods deployed wit

.nf
# Auto scale a deployment "foo", with the number of pods between 2 to 10, target CPU utilization at a default value that server applies:
$ kubectl autoscale deployment foo \-\-min=2 \-\-max=10
kubectl autoscale deployment foo \-\-min=2 \-\-max=10

# Auto scale a replication controller "foo", with the number of pods between 1 to 5, target CPU utilization at 80%:
$ kubectl autoscale rc foo \-\-max=5 \-\-cpu\-percent=80
kubectl autoscale rc foo \-\-max=5 \-\-cpu\-percent=80

.fi
.RE
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-config-current-context.1
Expand Up @@ -116,7 +116,7 @@ Displays the current\-context

.nf
# Display the current\-context
$ kubectl config current\-context
kubectl config current\-context

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

.nf
# 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
kubectl config set\-cluster e2e \-\-server=https://1.2.3.4

# Embed certificate authority data for the e2e cluster entry
$ kubectl config set\-cluster e2e \-\-certificate\-authority=\~/.kube/e2e/kubernetes.ca.crt
kubectl config set\-cluster e2e \-\-certificate\-authority=\~/.kube/e2e/kubernetes.ca.crt

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

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

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

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-config-set-credentials.1
Expand Up @@ -139,13 +139,13 @@ Bearer token and basic auth are mutually exclusive.
.nf
# 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
kubectl config set\-credentials cluster\-admin \-\-client\-key=\~/.kube/admin.key

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

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

.fi
.RE
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-config-view.1
Expand Up @@ -168,10 +168,10 @@ You can use \-\-output jsonpath={...} to extract specific values using a jsonpat

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

# Get the password for the e2e user
$ kubectl config view \-o jsonpath='{.users[?(@.name == "e2e")].user.password}'
kubectl config view \-o jsonpath='{.users[?(@.name == "e2e")].user.password}'

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-convert.1
Expand Up @@ -175,14 +175,14 @@ to change to output destination.

.nf
# Convert 'pod.yaml' to latest version and print to stdout.
$ kubectl convert \-f pod.yaml
kubectl convert \-f pod.yaml

# Convert the live state of the resource specified by 'pod.yaml' to the latest version
# and print to stdout in json format.
$ kubectl convert \-f pod.yaml \-\-local \-o json
kubectl convert \-f pod.yaml \-\-local \-o json

# Convert all files under current directory to latest version and create them all.
$ kubectl convert \-f . | kubectl create \-f \-
kubectl convert \-f . | kubectl create \-f \-


.fi
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-cordon.1
Expand Up @@ -116,7 +116,7 @@ Mark node as unschedulable.

.nf
# Mark node "foo" as unschedulable.
$ kubectl cordon foo
kubectl cordon foo


.fi
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-create-configmap.1
Expand Up @@ -189,13 +189,13 @@ symlinks, devices, pipes, etc).

.nf
# Create a new configmap named my\-config with keys for each file in folder bar
$ kubectl create configmap generic my\-config \-\-from\-file=path/to/bar
kubectl create configmap generic my\-config \-\-from\-file=path/to/bar

# Create a new configmap named my\-config with specified keys instead of names on disk
$ kubectl create configmap generic my\-config \-\-from\-file=ssh\-privatekey=\~/.ssh/id\_rsa \-\-from\-file=ssh\-publickey=\~/.ssh/id\_rsa.pub
kubectl create configmap generic my\-config \-\-from\-file=ssh\-privatekey=\~/.ssh/id\_rsa \-\-from\-file=ssh\-publickey=\~/.ssh/id\_rsa.pub

# Create a new configMap named my\-config with key1=config1 and key2=config2
$ kubectl create configmap generic my\-config \-\-from\-literal=key1=config1 \-\-from\-literal=key2=config2
kubectl create configmap generic my\-config \-\-from\-literal=key1=config1 \-\-from\-literal=key2=config2

.fi
.RE
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-create-namespace.1
Expand Up @@ -169,7 +169,7 @@ Create a namespace with the specified name.

.nf
# Create a new namespace named my\-namespace
$ kubectl create namespace my\-namespace
kubectl create namespace my\-namespace

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-create-secret-generic.1
Expand Up @@ -193,13 +193,13 @@ symlinks, devices, pipes, etc).

.nf
# Create a new secret named my\-secret with keys for each file in folder bar
$ kubectl create secret generic my\-secret \-\-from\-file=path/to/bar
kubectl create secret generic my\-secret \-\-from\-file=path/to/bar

# Create a new secret named my\-secret with specified keys instead of names on disk
$ kubectl create secret generic my\-secret \-\-from\-file=ssh\-privatekey=\~/.ssh/id\_rsa \-\-from\-file=ssh\-publickey=\~/.ssh/id\_rsa.pub
kubectl create secret generic my\-secret \-\-from\-file=ssh\-privatekey=\~/.ssh/id\_rsa \-\-from\-file=ssh\-publickey=\~/.ssh/id\_rsa.pub

# Create a new secret named my\-secret with key1=supersecret and key2=topsecret
$ kubectl create secret generic my\-secret \-\-from\-literal=key1=supersecret \-\-from\-literal=key2=topsecret
kubectl create secret generic my\-secret \-\-from\-literal=key1=supersecret \-\-from\-literal=key2=topsecret

.fi
.RE
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-create.1
Expand Up @@ -145,10 +145,10 @@ JSON and YAML formats are accepted.

.nf
# Create a pod using the data in pod.json.
$ kubectl create \-f ./pod.json
kubectl create \-f ./pod.json

# Create a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl create \-f \-
cat pod.json | kubectl create \-f \-

.fi
.RE
Expand Down
12 changes: 6 additions & 6 deletions docs/man/man1/kubectl-delete.1
Expand Up @@ -161,22 +161,22 @@ will be lost along with the rest of the resource.

.nf
# Delete a pod using the type and name specified in pod.json.
$ kubectl delete \-f ./pod.json
kubectl delete \-f ./pod.json

# Delete a pod based on the type and name in the JSON passed into stdin.
$ cat pod.json | kubectl delete \-f \-
cat pod.json | kubectl delete \-f \-

# Delete pods and services with same names "baz" and "foo"
$ kubectl delete pod,service baz foo
kubectl delete pod,service baz foo

# Delete pods and services with label name=myLabel.
$ kubectl delete pods,services \-l name=myLabel
kubectl delete pods,services \-l name=myLabel

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

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

.fi
.RE
Expand Down
12 changes: 6 additions & 6 deletions docs/man/man1/kubectl-describe.1
Expand Up @@ -144,23 +144,23 @@ endpoints (ep) or secrets.

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

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

# Describe a pod identified by type and name in "pod.json"
$ kubectl describe \-f pod.json
kubectl describe \-f pod.json

# Describe all pods
$ kubectl describe pods
kubectl describe pods

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

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-edit.1
Expand Up @@ -163,13 +163,13 @@ saved copy to include the latest resource version.

.nf
# Edit the service named 'docker\-registry':
$ kubectl edit svc/docker\-registry
kubectl edit svc/docker\-registry

# Use an alternative editor
$ KUBE\_EDITOR="nano" kubectl edit svc/docker\-registry
KUBE\_EDITOR="nano" kubectl edit svc/docker\-registry

# Edit the service 'docker\-registry' in JSON using the v1 API format:
$ kubectl edit svc/docker\-registry \-\-output\-version=v1 \-o json
kubectl edit svc/docker\-registry \-\-output\-version=v1 \-o json

.fi
.RE
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-exec.1
Expand Up @@ -134,14 +134,14 @@ Execute a command in a container.

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

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

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

.fi
.RE
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/kubectl-explain.1
Expand Up @@ -129,10 +129,10 @@ or endpoints (ep).

.nf
# Get the documentation of the resource and its fields
$ kubectl explain pods
kubectl explain pods

# Get the documentation of a specific field of a resource
$ kubectl explain pods.spec.containers
kubectl explain pods.spec.containers

.fi
.RE
Expand Down
12 changes: 6 additions & 6 deletions docs/man/man1/kubectl-expose.1
Expand Up @@ -229,22 +229,22 @@ if no labels are specified, the new service will re\-use the labels from the res

.nf
# 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
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.
$ kubectl expose \-f nginx\-controller.yaml \-\-port=80 \-\-target\-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"
$ kubectl expose pod valid\-pod \-\-port=444 \-\-name=frontend
kubectl expose pod valid\-pod \-\-port=444 \-\-name=frontend

# Create 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
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'.
$ kubectl expose rc streamer \-\-port=4100 \-\-protocol=udp \-\-name=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.
$ kubectl expose rs nginx \-\-port=80 \-\-target\-port=8000
kubectl expose rs nginx \-\-port=80 \-\-target\-port=8000

.fi
.RE
Expand Down
16 changes: 8 additions & 8 deletions docs/man/man1/kubectl-get.1
Expand Up @@ -188,28 +188,28 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(

.nf
# List all pods in ps output format.
$ kubectl get pods
kubectl get pods

# List all pods in ps output format with more information (such as node name).
$ kubectl get pods \-o wide
kubectl get pods \-o wide

# List a single replication controller with specified NAME in ps output format.
$ kubectl get replicationcontroller web
kubectl get replicationcontroller web

# List a single pod in JSON output format.
$ kubectl get \-o json pod web\-pod\-13je7
kubectl get \-o json pod web\-pod\-13je7

# List a pod identified by type and name specified in "pod.yaml" in JSON output format.
$ kubectl get \-f pod.yaml \-o json
kubectl get \-f pod.yaml \-o json

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

# List all replication controllers and services together in ps output format.
$ kubectl get rc,services
kubectl get rc,services

# List one or more resources by their type and names.
$ kubectl get rc/web service/frontend pods/web\-pod\-13je7
kubectl get rc/web service/frontend pods/web\-pod\-13je7

.fi
.RE
Expand Down