update commented examples just remove $

This commit is contained in:
AdoHe
2016-02-29 09:41:09 -05:00
parent 1d4a9e88e0
commit 9cc668f7c6
107 changed files with 388 additions and 388 deletions

View File

@@ -60,23 +60,23 @@ kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=V
```
# 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-
```
### Options
@@ -129,7 +129,7 @@ $ kubectl annotate pods foo description-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]()

View File

@@ -52,10 +52,10 @@ kubectl apply -f FILENAME
```
# 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 -
```
### Options
@@ -100,7 +100,7 @@ $ cat pod.json | kubectl apply -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 22-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_apply.md?pixel)]()

View File

@@ -49,14 +49,14 @@ kubectl attach POD -c CONTAINER
```
# 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
```
### Options
@@ -99,7 +99,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]()

View File

@@ -52,10 +52,10 @@ kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MA
```
# 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
```
### Options
@@ -111,7 +111,7 @@ $ kubectl autoscale rc foo --max=5 --cpu-percent=80
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_autoscale.md?pixel)]()

View File

@@ -44,7 +44,7 @@ kubectl config current-context
```
# Display the current-context
$ kubectl config current-context
kubectl config current-context
```
### Options inherited from parent commands
@@ -79,7 +79,7 @@ $ kubectl config current-context
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 9-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_current-context.md?pixel)]()

View File

@@ -50,13 +50,13 @@ kubectl config set-cluster NAME [--server=server] [--certificate-authority=path/
```
# 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
```
### Options
@@ -97,7 +97,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 8-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]()

View File

@@ -50,7 +50,7 @@ kubectl config set-context NAME [--cluster=cluster_nickname] [--user=user_nickna
```
# 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
```
### Options
@@ -90,7 +90,7 @@ $ kubectl config set-context gce --user=cluster-admin
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]()

View File

@@ -63,13 +63,13 @@ kubectl config set-credentials NAME [--client-certificate=path/to/certfile] [--c
```
# 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
```
### Options
@@ -110,7 +110,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 8-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]()

View File

@@ -51,10 +51,10 @@ kubectl config view
```
# 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}'
```
### Options
@@ -105,7 +105,7 @@ $ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()

View File

@@ -53,14 +53,14 @@ kubectl convert -f FILENAME
```
# 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 -
```
@@ -112,7 +112,7 @@ $ kubectl convert -f . | kubectl create -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_convert.md?pixel)]()

View File

@@ -45,7 +45,7 @@ kubectl cordon NODE
```
# Mark node "foo" as unschedulable.
$ kubectl cordon foo
kubectl cordon foo
```
@@ -81,7 +81,7 @@ $ kubectl cordon foo
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 4-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cordon.md?pixel)]()

View File

@@ -51,10 +51,10 @@ kubectl create -f FILENAME
```
# 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 -
```
### Options
@@ -103,7 +103,7 @@ $ cat pod.json | kubectl create -f -
* [kubectl create namespace](kubectl_create_namespace.md) - Create a namespace with the specified name.
* [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand.
###### Auto generated by spf13/cobra on 17-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]()

View File

@@ -54,13 +54,13 @@ kubectl create configmap NAME [--type=string] [--from-file=[key=]source] [--from
```
# 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
```
### Options
@@ -114,7 +114,7 @@ kubectl create configmap NAME [--type=string] [--from-file=[key=]source] [--from
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin
###### Auto generated by spf13/cobra on 18-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_configmap.md?pixel)]()

View File

@@ -45,7 +45,7 @@ kubectl create namespace NAME [--dry-run]
```
# Create a new namespace named my-namespace
$ kubectl create namespace my-namespace
kubectl create namespace my-namespace
```
### Options
@@ -97,7 +97,7 @@ kubectl create namespace NAME [--dry-run]
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_namespace.md?pixel)]()

View File

@@ -55,13 +55,13 @@ kubectl create secret generic NAME [--type=string] [--from-file=[key=]source] [-
```
# 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
```
### Options
@@ -116,7 +116,7 @@ kubectl create secret generic NAME [--type=string] [--from-file=[key=]source] [-
* [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand.
###### Auto generated by spf13/cobra on 18-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret_generic.md?pixel)]()

View File

@@ -57,22 +57,22 @@ kubectl delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)])
```
# 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
```
### Options
@@ -120,7 +120,7 @@ $ kubectl delete pods --all
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]()

View File

@@ -63,23 +63,23 @@ kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)
```
# 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
```
### Options
@@ -121,7 +121,7 @@ $ kubectl describe pods frontend
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]()

View File

@@ -67,13 +67,13 @@ kubectl edit (RESOURCE/NAME | -f FILENAME)
```
# 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
```
### Options
@@ -119,7 +119,7 @@ kubectl edit (RESOURCE/NAME | -f FILENAME)
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 22-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_edit.md?pixel)]()

View File

@@ -49,14 +49,14 @@ kubectl exec POD [-c CONTAINER] -- COMMAND [args...]
```
# 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
```
### Options
@@ -100,7 +100,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]()

View File

@@ -50,10 +50,10 @@ kubectl explain RESOURCE
```
# 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
```
### Options
@@ -94,7 +94,7 @@ $ kubectl explain pods.spec.containers
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 24-Nov-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_explain.md?pixel)]()

View File

@@ -56,22 +56,22 @@ kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP] [--t
```
# 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
```
### Options
@@ -135,7 +135,7 @@ $ kubectl expose rs nginx --port=80 --target-port=8000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()

View File

@@ -58,28 +58,28 @@ kubectl get [(-o|--output=)json|yaml|wide|go-template=...|go-template-file=...|j
```
# 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
```
### Options
@@ -133,7 +133,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()

View File

@@ -53,23 +53,23 @@ kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_
```
# Update pod 'foo' with the label 'unhealthy' and the value 'true'.
$ kubectl label pods foo unhealthy=true
kubectl label pods foo unhealthy=true
# Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value.
$ kubectl label --overwrite pods foo status=unhealthy
kubectl label --overwrite pods foo status=unhealthy
# Update all pods in the namespace
$ kubectl label pods --all status=unhealthy
kubectl label pods --all status=unhealthy
# Update a pod identified by the type and name in "pod.json"
$ kubectl label -f pod.json status=unhealthy
kubectl label -f pod.json status=unhealthy
# Update pod 'foo' only if the resource is unchanged from version 1.
$ kubectl label pods foo status=unhealthy --resource-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.
$ kubectl label pods foo bar-
kubectl label pods foo bar-
```
### Options
@@ -123,7 +123,7 @@ $ kubectl label pods foo bar-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]()

View File

@@ -49,19 +49,19 @@ kubectl logs [-f] [-p] POD [-c CONTAINER]
```
# Return snapshot logs from pod nginx with only one container
$ kubectl logs nginx
kubectl logs nginx
# Return snapshot of previous terminated ruby container logs from pod web-1
$ kubectl logs -p -c ruby web-1
kubectl logs -p -c ruby web-1
# Begin streaming the logs of the ruby container in pod web-1
$ kubectl logs -f -c ruby web-1
kubectl logs -f -c ruby web-1
# Display only the most recent 20 lines of output in pod nginx
$ kubectl logs --tail=20 nginx
kubectl logs --tail=20 nginx
# Show all logs from pod nginx written in the last hour
$ kubectl logs --since=1h nginx
kubectl logs --since=1h nginx
```
### Options
@@ -109,7 +109,7 @@ $ kubectl logs --since=1h nginx
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]()

View File

@@ -50,16 +50,16 @@ kubectl port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT
```
# Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
$ kubectl port-forward mypod 5000 6000
kubectl port-forward mypod 5000 6000
# Listen on port 8888 locally, forwarding to 5000 in the pod
$ kubectl port-forward mypod 8888:5000
kubectl port-forward mypod 8888:5000
# Listen on a random port locally, forwarding to 5000 in the pod
$ kubectl port-forward mypod :5000
kubectl port-forward mypod :5000
# Listen on a random port locally, forwarding to 5000 in the pod
$ kubectl port-forward mypod 0:5000
kubectl port-forward mypod 0:5000
```
### Options
@@ -100,7 +100,7 @@ $ kubectl port-forward mypod 0:5000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]()

View File

@@ -64,15 +64,15 @@ kubectl proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-pref
```
# Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/
$ kubectl proxy --port=8011 --www=./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.
$ kubectl proxy --port=0
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/
$ kubectl proxy --api-prefix=/k8s-api
kubectl proxy --api-prefix=/k8s-api
```
### Options
@@ -123,7 +123,7 @@ $ kubectl proxy --api-prefix=/k8s-api
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 8-Dec-2015
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]()

View File

@@ -55,10 +55,10 @@ kubectl replace -f FILENAME
```
# Replace a pod using the data in pod.json.
$ kubectl replace -f ./pod.json
kubectl replace -f ./pod.json
# Replace a pod based on the JSON passed into stdin.
$ cat pod.json | kubectl replace -f -
cat pod.json | kubectl replace -f -
# 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 -
@@ -114,7 +114,7 @@ kubectl replace --force -f ./pod.json
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 22-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]()

View File

@@ -53,20 +53,20 @@ kubectl rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CO
```
# Update pods of frontend-v1 using new replication controller data in frontend-v2.json.
$ kubectl rolling-update frontend-v1 -f frontend-v2.json
kubectl rolling-update frontend-v1 -f frontend-v2.json
# Update pods of frontend-v1 using JSON data passed into stdin.
$ cat frontend-v2.json | kubectl rolling-update frontend-v1 -f -
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.
$ kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2
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.
$ kubectl rolling-update frontend --image=image:v2
kubectl rolling-update frontend --image=image:v2
# Abort and reverse an existing rollout in progress (from frontend-v1 to frontend-v2).
$ kubectl rolling-update frontend-v1 frontend-v2 --rollback
kubectl rolling-update frontend-v1 frontend-v2 --rollback
```
@@ -125,7 +125,7 @@ $ kubectl rolling-update frontend-v1 frontend-v2 --rollback
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]()

View File

@@ -44,7 +44,7 @@ kubectl rollout SUBCOMMAND
```
# Rollback to the previous deployment
$ kubectl rollout undo deployment/abc
kubectl rollout undo deployment/abc
```
### Options inherited from parent commands
@@ -83,7 +83,7 @@ $ kubectl rollout undo deployment/abc
* [kubectl rollout resume](kubectl_rollout_resume.md) - Resume a paused resource
* [kubectl rollout undo](kubectl_rollout_undo.md) - undoes a previous rollout
###### Auto generated by spf13/cobra on 2-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout.md?pixel)]()

View File

@@ -44,7 +44,7 @@ kubectl rollout history (TYPE NAME | TYPE/NAME) [flags]
```
# View the rollout history of a deployment
$ kubectl rollout history deployment/abc
kubectl rollout history deployment/abc
```
### Options
@@ -86,7 +86,7 @@ $ kubectl rollout history deployment/abc
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 29-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_history.md?pixel)]()

View File

@@ -50,7 +50,7 @@ kubectl rollout pause RESOURCE
# 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
kubectl rollout pause deployment/nginx
```
### Options
@@ -91,7 +91,7 @@ $ kubectl rollout pause deployment/nginx
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 2-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_pause.md?pixel)]()

View File

@@ -48,7 +48,7 @@ kubectl rollout resume RESOURCE
```
# Resume an already paused deployment
$ kubectl rollout resume deployment/nginx
kubectl rollout resume deployment/nginx
```
### Options
@@ -89,7 +89,7 @@ $ kubectl rollout resume deployment/nginx
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 2-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_resume.md?pixel)]()

View File

@@ -44,7 +44,7 @@ kubectl rollout undo (TYPE NAME | TYPE/NAME) [flags]
```
# Rollback to the previous deployment
$ kubectl rollout undo deployment/abc
kubectl rollout undo deployment/abc
```
### Options
@@ -86,7 +86,7 @@ $ kubectl rollout undo deployment/abc
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 29-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_undo.md?pixel)]()

View File

@@ -50,34 +50,34 @@ kubectl run NAME --image=image [--env="key=value"] [--port=port] [--replicas=rep
```
# Start a single instance of nginx.
$ kubectl run nginx --image=nginx
kubectl run nginx --image=nginx
# Start a single instance of hazelcast and let the container expose port 5701 .
$ kubectl run hazelcast --image=hazelcast --port=5701
kubectl run hazelcast --image=hazelcast --port=5701
# Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.
$ kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
# Start a replicated instance of nginx.
$ kubectl run nginx --image=nginx --replicas=5
kubectl run nginx --image=nginx --replicas=5
# Dry run. Print the corresponding API objects without creating them.
$ kubectl run nginx --image=nginx --dry-run
kubectl run nginx --image=nginx --dry-run
# Start a single instance of nginx, but overload the spec of the deployment with a partial set of values parsed from JSON.
$ kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
# Start a single instance of busybox and keep it in the foreground, don't restart it if it exits.
$ kubectl run -i --tty busybox --image=busybox --restart=Never
kubectl run -i --tty busybox --image=busybox --restart=Never
# Start the nginx container using the default command, but use custom arguments (arg1 .. argN) for that command.
$ kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
kubectl run nginx --image=nginx -- <arg1> <arg2> ... <argN>
# Start the nginx container using a different command and custom arguments.
$ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
# Start the perl container to compute π to 2000 places and print it out.
$ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
```
### Options
@@ -147,7 +147,7 @@ $ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'pri
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 14-Feb-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]()

View File

@@ -54,19 +54,19 @@ kubectl scale [--resource-version=version] [--current-replicas=count] --replicas
```
# Scale replication controller named 'foo' to 3.
$ kubectl scale --replicas=3 rc/foo
kubectl scale --replicas=3 rc/foo
# Scale a resource identified by type and name specified in "foo.yaml" to 3.
$ kubectl scale --replicas=3 -f foo.yaml
kubectl scale --replicas=3 -f foo.yaml
# If the deployment named mysql's current size is 2, scale mysql to 3.
$ kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
# Scale multiple replication controllers.
$ kubectl scale --replicas=5 rc/foo rc/bar rc/baz
kubectl scale --replicas=5 rc/foo rc/bar rc/baz
# Scale job named 'cron' to 3.
$ kubectl scale --replicas=3 job/cron
kubectl scale --replicas=3 job/cron
```
### Options
@@ -113,7 +113,7 @@ $ kubectl scale --replicas=3 job/cron
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 22-Jan-2016
###### Auto generated by spf13/cobra on 29-Feb-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]()