+
Updating an application
+
Users expect applications to be available all the time and developers are expected to deploy new versions of them several times a day. In Kubernetes this is done with rolling updates. Rolling updates allows Deployments to occur with zero downtime by incrementally updating Pods instances with new ones. The new Pods will be scheduled on Nodes with available resources.
In the previous module we scaled our application to run multiple instances. This is a requirement for performing updates without affecting application availability. By default, the maximum number of Pods that can be unavailable during the update and the maximum number of new Pods that can be created, is one. Both options can be configured to either numbers or percentages (of Pods).
@@ -61,19 +62,19 @@
@@ -121,7 +122,7 @@
diff --git a/docs/tutorials/stateless-application/deployment-scale.yaml b/docs/tutorials/stateless-application/deployment-scale.yaml
new file mode 100644
index 0000000000..2968b88360
--- /dev/null
+++ b/docs/tutorials/stateless-application/deployment-scale.yaml
@@ -0,0 +1,16 @@
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ name: nginx-deployment
+spec:
+ replicas: 4
+ template:
+ metadata:
+ labels:
+ app: nginx
+ spec:
+ containers:
+ - name: nginx
+ image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8
+ ports:
+ - containerPort: 80
diff --git a/docs/tutorials/stateless-application/run-stateless-application-deployment.md b/docs/tutorials/stateless-application/run-stateless-application-deployment.md
index 70aeb925c2..20a7aff243 100644
--- a/docs/tutorials/stateless-application/run-stateless-application-deployment.md
+++ b/docs/tutorials/stateless-application/run-stateless-application-deployment.md
@@ -94,6 +94,30 @@ specifies that the deployment should be updated to use nginx 1.8.
kubectl get pods -l app=nginx
+### Scaling the application by increasing the replica count
+
+You can increase the number of pods in your Deployment by applying a new YAML
+file. This YAML file sets `replicas` to 4, which specifies that the Deployment
+should have four pods:
+
+{% include code.html language="yaml" file="deployment-scale.yaml" ghlink="/docs/tutorials/stateless-application/deployment-scale.yaml" %}
+
+1. Apply the new YAML file:
+
+ kubectl apply -f $REPO/docs/tutorials/stateless-application/deployment-scale.yaml
+
+1. Verify that the Deployment has four pods:
+
+ kubectl get pods
+
+ The output is similar to this:
+
+ NAME READY STATUS RESTARTS AGE
+ nginx-deployment-148880595-4zdqq 1/1 Running 0 25s
+ nginx-deployment-148880595-6zgi1 1/1 Running 0 25s
+ nginx-deployment-148880595-fxcez 1/1 Running 0 2m
+ nginx-deployment-148880595-rwovn 1/1 Running 0 2m
+
### Deleting a deployment
Delete the deployment by name:
diff --git a/docs/user-guide/accessing-the-cluster.md b/docs/user-guide/accessing-the-cluster.md
index c42adb4c6e..6f78ab5293 100644
--- a/docs/user-guide/accessing-the-cluster.md
+++ b/docs/user-guide/accessing-the-cluster.md
@@ -27,7 +27,7 @@ $ kubectl config view
```
Many of the [examples](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/) provide an introduction to using
-kubectl and complete documentation is found in the [kubectl manual](/docs/user-guide/kubectl/kubectl).
+kubectl and complete documentation is found in the [kubectl manual](/docs/user-guide/kubectl/index).
### Directly accessing the REST API
diff --git a/docs/user-guide/connecting-applications.md b/docs/user-guide/connecting-applications.md
index 4f0b804a4e..f75187d6c6 100644
--- a/docs/user-guide/connecting-applications.md
+++ b/docs/user-guide/connecting-applications.md
@@ -9,7 +9,7 @@ assignees:
* TOC
{:toc}
-# The Kubernetes model for connecting containers
+## The Kubernetes model for connecting containers
Now that you have a continuously running, replicated application you can expose it on a network. Before discussing the Kubernetes approach to networking, it is worthwhile to contrast it with the "normal" way networking works with Docker.
diff --git a/docs/user-guide/connecting-to-applications-port-forward.md b/docs/user-guide/connecting-to-applications-port-forward.md
index 742730229f..5876d2ab48 100644
--- a/docs/user-guide/connecting-to-applications-port-forward.md
+++ b/docs/user-guide/connecting-to-applications-port-forward.md
@@ -1,50 +1,50 @@
----
-assignees:
-- caesarxuchao
-- mikedanese
-
----
-
-kubectl port-forward forwards connections to a local port to a port on a pod. Its man page is available [here](/docs/user-guide/kubectl/kubectl_port-forward). Compared to [kubectl proxy](/docs/user-guide/accessing-the-cluster/#using-kubectl-proxy), `kubectl port-forward` is more generic as it can forward TCP traffic while `kubectl proxy` can only forward HTTP traffic. This guide demonstrates how to use `kubectl port-forward` to connect to a Redis database, which may be useful for database debugging.
-
-## Creating a Redis master
-
-```shell
-$ kubectl create -f examples/redis/redis-master.yaml
-pods/redis-master
-```
-
-wait until the Redis master pod is Running and Ready,
-
-```shell
-$ kubectl get pods
-NAME READY STATUS RESTARTS AGE
-redis-master 2/2 Running 0 41s
-```
-
-## Connecting to the Redis master[a]
-
-The Redis master is listening on port 6379, to verify this,
-
-```shell{% raw %}
-$ kubectl get pods redis-master --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
-6379{% endraw %}
-```
-
-then we forward the port 6379 on the local workstation to the port 6379 of pod redis-master,
-
-```shell
-$ kubectl port-forward redis-master 6379:6379
-I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:6379 -> 6379
-I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 -> 6379
-```
-
-To verify the connection is successful, we run a redis-cli on the local workstation,
-
-```shell
-$ redis-cli
-127.0.0.1:6379> ping
-PONG
-```
-
-Now one can debug the database from the local workstation.
+---
+assignees:
+- caesarxuchao
+- mikedanese
+
+---
+
+kubectl port-forward forwards connections to a local port to a port on a pod. Its man page is available [here](/docs/user-guide/kubectl/kubectl_port-forward). Compared to [kubectl proxy](/docs/user-guide/accessing-the-cluster/#using-kubectl-proxy), `kubectl port-forward` is more generic as it can forward TCP traffic while `kubectl proxy` can only forward HTTP traffic. This guide demonstrates how to use `kubectl port-forward` to connect to a Redis database, which may be useful for database debugging.
+
+## Creating a Redis master
+
+```shell
+$ kubectl create -f examples/redis/redis-master.yaml
+pods/redis-master
+```
+
+wait until the Redis master pod is Running and Ready,
+
+```shell
+$ kubectl get pods
+NAME READY STATUS RESTARTS AGE
+redis-master 2/2 Running 0 41s
+```
+
+## Connecting to the Redis master[a]
+
+The Redis master is listening on port 6379, to verify this,
+
+```shell{% raw %}
+$ kubectl get pods redis-master --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}'
+6379{% endraw %}
+```
+
+then we forward the port 6379 on the local workstation to the port 6379 of pod redis-master,
+
+```shell
+$ kubectl port-forward redis-master 6379:6379
+I0710 14:43:38.274550 3655 portforward.go:225] Forwarding from 127.0.0.1:6379 -> 6379
+I0710 14:43:38.274797 3655 portforward.go:225] Forwarding from [::1]:6379 -> 6379
+```
+
+To verify the connection is successful, we run a redis-cli on the local workstation,
+
+```shell
+$ redis-cli
+127.0.0.1:6379> ping
+PONG
+```
+
+Now one can debug the database from the local workstation.
diff --git a/docs/user-guide/connecting-to-applications-proxy.md b/docs/user-guide/connecting-to-applications-proxy.md
index 4e9867a339..5404d2e769 100644
--- a/docs/user-guide/connecting-to-applications-proxy.md
+++ b/docs/user-guide/connecting-to-applications-proxy.md
@@ -1,32 +1,32 @@
----
-assignees:
-- caesarxuchao
-- lavalamp
-
----
-
-You have seen the [basics](/docs/user-guide/accessing-the-cluster) about `kubectl proxy` and `apiserver proxy`. This guide shows how to use them together to access a service([kube-ui](/docs/user-guide/ui)) running on the Kubernetes cluster from your workstation.
-
-
-## Getting the apiserver proxy URL of kube-ui
-
-kube-ui is deployed as a cluster add-on. To find its apiserver proxy URL,
-
-```shell
-$ kubectl cluster-info | grep "KubeUI"
-KubeUI is running at https://173.255.119.104/api/v1/proxy/namespaces/kube-system/services/kube-ui
-```
-
-if this command does not find the URL, try the steps [here](/docs/user-guide/ui/#accessing-the-ui).
-
-
-## Connecting to the kube-ui service from your local workstation
-
-The above proxy URL is an access to the kube-ui service provided by the apiserver. To access it, you still need to authenticate to the apiserver. `kubectl proxy` can handle the authentication.
-
-```shell
-$ kubectl proxy --port=8001
-Starting to serve on localhost:8001
-```
-
+---
+assignees:
+- caesarxuchao
+- lavalamp
+
+---
+
+You have seen the [basics](/docs/user-guide/accessing-the-cluster) about `kubectl proxy` and `apiserver proxy`. This guide shows how to use them together to access a service([kube-ui](/docs/user-guide/ui)) running on the Kubernetes cluster from your workstation.
+
+
+## Getting the apiserver proxy URL of kube-ui
+
+kube-ui is deployed as a cluster add-on. To find its apiserver proxy URL,
+
+```shell
+$ kubectl cluster-info | grep "KubeUI"
+KubeUI is running at https://173.255.119.104/api/v1/proxy/namespaces/kube-system/services/kube-ui
+```
+
+if this command does not find the URL, try the steps [here](/docs/user-guide/ui/#accessing-the-ui).
+
+
+## Connecting to the kube-ui service from your local workstation
+
+The above proxy URL is an access to the kube-ui service provided by the apiserver. To access it, you still need to authenticate to the apiserver. `kubectl proxy` can handle the authentication.
+
+```shell
+$ kubectl proxy --port=8001
+Starting to serve on localhost:8001
+```
+
Now you can access the kube-ui service on your local workstation at [http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kube-ui](http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/kube-ui)
\ No newline at end of file
diff --git a/docs/user-guide/getting-into-containers.md b/docs/user-guide/getting-into-containers.md
index 25f0f5a3e4..f45da7b0eb 100644
--- a/docs/user-guide/getting-into-containers.md
+++ b/docs/user-guide/getting-into-containers.md
@@ -1,74 +1,74 @@
----
-assignees:
-- caesarxuchao
-- mikedanese
-
----
-
-Developers can use `kubectl exec` to run commands in a container. This guide demonstrates two use cases.
-
-## Using kubectl exec to check the environment variables of a container
-
-Kubernetes exposes [services](/docs/user-guide/services/#environment-variables) through environment variables. It is convenient to check these environment variables using `kubectl exec`.
-
-We first create a pod and a service,
-
-```shell
-$ kubectl create -f examples/guestbook/redis-master-controller.yaml
-$ kubectl create -f examples/guestbook/redis-master-service.yaml
-```
-wait until the pod is Running and Ready,
-
-```shell
-$ kubectl get pod
-NAME READY REASON RESTARTS AGE
-redis-master-ft9ex 1/1 Running 0 12s
-```
-
-then we can check the environment variables of the pod,
-
-```shell
-$ kubectl exec redis-master-ft9ex env
-...
-REDIS_MASTER_SERVICE_PORT=6379
-REDIS_MASTER_SERVICE_HOST=10.0.0.219
-...
-```
-
-We can use these environment variables in applications to find the service.
-
-
-## Using kubectl exec to check the mounted volumes
-
-It is convenient to use `kubectl exec` to check if the volumes are mounted as expected.
-We first create a Pod with a volume mounted at /data/redis,
-
-```shell
-kubectl create -f docs/user-guide/walkthrough/pod-redis.yaml
-```
-
-wait until the pod is Running and Ready,
-
-```shell
-$ kubectl get pods
-NAME READY REASON RESTARTS AGE
-storage 1/1 Running 0 1m
-```
-
-we then use `kubectl exec` to verify that the volume is mounted at /data/redis,
-
-```shell
-$ kubectl exec storage ls /data
-redis
-```
-
-## Using kubectl exec to open a bash terminal in a pod
-
-After all, open a terminal in a pod is the most direct way to introspect the pod. Assuming the pod/storage is still running, run
-
-```shell
-$ kubectl exec -ti storage -- bash
-root@storage:/data#
-```
-
+---
+assignees:
+- caesarxuchao
+- mikedanese
+
+---
+
+Developers can use `kubectl exec` to run commands in a container. This guide demonstrates two use cases.
+
+## Using kubectl exec to check the environment variables of a container
+
+Kubernetes exposes [services](/docs/user-guide/services/#environment-variables) through environment variables. It is convenient to check these environment variables using `kubectl exec`.
+
+We first create a pod and a service,
+
+```shell
+$ kubectl create -f examples/guestbook/redis-master-controller.yaml
+$ kubectl create -f examples/guestbook/redis-master-service.yaml
+```
+wait until the pod is Running and Ready,
+
+```shell
+$ kubectl get pod
+NAME READY REASON RESTARTS AGE
+redis-master-ft9ex 1/1 Running 0 12s
+```
+
+then we can check the environment variables of the pod,
+
+```shell
+$ kubectl exec redis-master-ft9ex env
+...
+REDIS_MASTER_SERVICE_PORT=6379
+REDIS_MASTER_SERVICE_HOST=10.0.0.219
+...
+```
+
+We can use these environment variables in applications to find the service.
+
+
+## Using kubectl exec to check the mounted volumes
+
+It is convenient to use `kubectl exec` to check if the volumes are mounted as expected.
+We first create a Pod with a volume mounted at /data/redis,
+
+```shell
+kubectl create -f docs/user-guide/walkthrough/pod-redis.yaml
+```
+
+wait until the pod is Running and Ready,
+
+```shell
+$ kubectl get pods
+NAME READY REASON RESTARTS AGE
+storage 1/1 Running 0 1m
+```
+
+we then use `kubectl exec` to verify that the volume is mounted at /data/redis,
+
+```shell
+$ kubectl exec storage ls /data
+redis
+```
+
+## Using kubectl exec to open a bash terminal in a pod
+
+After all, open a terminal in a pod is the most direct way to introspect the pod. Assuming the pod/storage is still running, run
+
+```shell
+$ kubectl exec -ti storage -- bash
+root@storage:/data#
+```
+
This gets you a terminal.
\ No newline at end of file
diff --git a/docs/user-guide/kubectl-conventions.md b/docs/user-guide/kubectl-conventions.md
index f4398362da..a22973f16f 100644
--- a/docs/user-guide/kubectl-conventions.md
+++ b/docs/user-guide/kubectl-conventions.md
@@ -8,11 +8,11 @@ assignees:
* TOC
{:toc}
-## Using `kubectl` in Reusable Scripts
+## Using `kubectl` in Reusable Scripts
If you need stable output in a script, you should:
-* Request one of the machine-oriented output forms, such as `-o name`, `-o json`, `-o yaml`, `-o go-template`, or `-o jsonpath`
+* Request one of the machine-oriented output forms, such as `-o name`, `-o json`, `-o yaml`, `-o go-template`, or `-o jsonpath`
* Specify `--output-version`, since those output forms (other than `-o name`) output the resource using a particular API version
* Specify `--generator` to pin to a specific behavior forever, if using generator-based commands (such as `kubectl run` or `kubectl expose`)
* Don't rely on context, preferences, or other implicit state
@@ -27,8 +27,46 @@ In order for `kubectl run` to satisfy infrastructure as code:
* If the image is lightly parameterized, capture the parameters in a checked-in script, or at least use `--record`, to annotate the created objects with the command line.
* If the image is heavily parameterized, definitely check in the script.
* If features are needed that are not expressible via `kubectl run` flags, switch to configuration files checked into source control.
-* Pin to a specific generator version, such as `kubectl run --generator=deployment/v1beta1`
+* Pin to a specific [generator](#generators) version, such as `kubectl run --generator=deployment/v1beta1`
+
+#### Generators
+
+`kubectl run` allows you to generate the following resources (using `--generator` flag):
+
+* Pod - use `run-pod/v1`.
+* Replication controller - use `run/v1`.
+* Deployment - use `deployment/v1beta1`.
+* Job (using `extension/v1beta1` endpoint) - use `job/v1beta1`.
+* Job - use `job/v1`.
+* ScheduledJob - use `scheduledjob/v2alpha1`.
+
+Additionally, if you didn't specify a generator flag, other flags will suggest using
+a specific generator. Below table shows which flags force using specific generators,
+depending on your cluster version:
+
+| Generated Resource | Cluster v1.4 | Cluster v1.3 | Cluster v1.2 | Cluster v1.1 and eariler |
+|:----------------------:|-----------------------|-----------------------|--------------------------------------------|--------------------------------------------|
+| Pod | `--restart=Never` | `--restart=Never` | `--generator=run-pod/v1` | `--restart=OnFailure` OR `--restart=Never` |
+| Replication Controller | `--generator=run/v1` | `--generator=run/v1` | `--generator=run/v1` | `--restart=Always` |
+| Deployment | `--restart=Always` | `--restart=Always` | `--restart=Always` | N/A |
+| Job | `--restart=OnFailure` | `--restart=OnFailure` | `--restart=OnFailure` OR `--restart=Never` | N/A |
+| Scheduled Job | `--schedule=
` | N/A | N/A | N/A |
+
+Note that these flags will use a default generator only when you have not specified
+any flag. This also means that combining `--generator` with other flags won't
+change the generator you specified. For example, in a 1.4 cluster, if you specify
+`--restart=Always`, a Deployment will be created; if you specify `--restart=Always`
+and `--generator=run/v1`, a Replication Controller will be created instead.
+This becomes handy if you want to pin to a specific behavior with the generator,
+even when the defaulted generator is changed in the future.
+
+Finally, the order in which flags set the generator is: schedule flag has the highest
+priority, then restart policy and finally the generator itself.
+
+If in doubt about the final resource being created, you can always use `--dry-run`
+flag, which will provide the object to be submitted to the cluster.
+
### `kubectl apply`
-* To use `kubectl apply` to update resources, always create resources initially with `kubectl apply` or with `--save-config`. See [managing resources with kubectl apply](/docs/user-guide/managing-deployments/#kubectl-apply) for the reason behind it.
+* To use `kubectl apply` to update resources, always create resources initially with `kubectl apply` or with `--save-config`. See [managing resources with kubectl apply](/docs/user-guide/managing-deployments/#kubectl-apply) for the reason behind it.
diff --git a/docs/user-guide/kubectl-overview.md b/docs/user-guide/kubectl-overview.md
index b0a6c5cc5a..bb587a9f91 100644
--- a/docs/user-guide/kubectl-overview.md
+++ b/docs/user-guide/kubectl-overview.md
@@ -5,7 +5,7 @@ assignees:
---
-Use this overview of the `kubectl` command line interface to help you start running commands against Kubernetes clusters. This overview quickly covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation.
+Use this overview of the `kubectl` command line interface to help you start running commands against Kubernetes clusters. This overview quickly covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/user-guide/kubectl) reference documentation.
TODO: Auto-generate this file to ensure it's always in sync with any `kubectl` changes, see [#14177](http://pr.k8s.io/14177).
@@ -77,7 +77,7 @@ Operation | Syntax | Description
`stop` | `kubectl stop` | Deprecated: Instead, see `kubectl delete`.
`version` | `kubectl version [--client] [flags]` | Display the Kubernetes version running on the client and server.
-Remember: For more about command operations, see the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation.
+Remember: For more about command operations, see the [kubectl](/docs/user-guide/kubectl) reference documentation.
## Resource types
@@ -85,29 +85,37 @@ The following table includes a list of all the supported resource types and thei
Resource type | Abbreviated alias
-------------------- | --------------------
-`componentstatuses` | `cs`
-`daemonsets` | `ds`
-`deployments` |
-`events` | `ev`
-`endpoints` | `ep`
-`horizontalpodautoscalers` | `hpa`
-`ingresses` | `ing`
+`clusters` |
+`componentstatuses` |`cs`
+`configmaps` |`cm`
+`daemonsets` |`ds`
+`deployments` |`deploy`
+`endpoints` |`ep`
+`events` |`ev`
+`horizontalpodautoscalers` |`hpa`
+`ingresses` |`ing`
`jobs` |
-`limitranges` | `limits`
-`nodes` | `no`
-`namespaces` | `ns`
-`pods` | `po`
-`persistentvolumes` | `pv`
-`persistentvolumeclaims` | `pvc`
-`resourcequotas` | `quota`
-`replicationcontrollers` | `rc`
+`limitranges` |`limits`
+`namespaces` |`ns`
+`networkpolicies` |
+`nodes` |`no`
+`persistentvolumeclaims` |`pvc`
+`persistentvolumes` |`pv`
+`pods` |`po`
+`podsecuritypolicies` |`psp`
+`podtemplates` |
+`replicasets` |`rs`
+`replicationcontrollers` |`rc`
+`resourcequotas` |`quota`
`secrets` |
-`serviceaccounts` |
-`services` | `svc`
+`serviceaccounts` |`sa`
+`services` |`svc`
+`storageclasses` |
+`thirdpartyresources` |
## Output options
-Use the following sections for information about how you can format or sort the output of certain commands. For details about which commands support the various output options, see the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation.
+Use the following sections for information about how you can format or sort the output of certain commands. For details about which commands support the various output options, see the [kubectl](/docs/user-guide/kubectl) reference documentation.
### Formatting output
@@ -138,7 +146,7 @@ In this example, the following command outputs the details for a single pod as a
`$ kubectl get pod web-pod-13je7 -o=yaml`
-Remember: See the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation for details about which output format is supported by each command.
+Remember: See the [kubectl](/docs/user-guide/kubectl) reference documentation for details about which output format is supported by each command.
#### Custom columns
@@ -273,4 +281,4 @@ $ kubectl logs -f
## Next steps
-Start using the [kubectl](/docs/user-guide/kubectl/kubectl) commands.
+Start using the [kubectl](/docs/user-guide/kubectl) commands.
diff --git a/docs/user-guide/logging.md b/docs/user-guide/logging.md
index 54f9e77e61..d329016c7b 100644
--- a/docs/user-guide/logging.md
+++ b/docs/user-guide/logging.md
@@ -1,80 +1,80 @@
----
-assignees:
-- mikedanese
-
----
-
-This page is designed to help you use logs to troubleshoot issues with your Kubernetes solution.
-
-## Logging by Kubernetes Components
-
-Kubernetes components, such as kubelet and apiserver, use the [glog](https://godoc.org/github.com/golang/glog) logging library. Developer conventions for logging severity are described in [docs/devel/logging.md](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/docs/devel/logging.md).
-
-## Examining the logs of running containers
-
-The logs of a running container may be fetched using the command `kubectl logs`. For example, given
-this pod specification [counter-pod.yaml](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/blog-logging/counter-pod.yaml), which has a container which writes out some text to standard
-output every second. (You can find different pod specifications [here](https://github.com/kubernetes/kubernetes.github.io/tree/{{page.docsbranch}}/docs/user-guide/logging-demo/).)
-
-{% include code.html language="yaml" file="counter-pod.yaml" k8slink="/examples/blog-logging/counter-pod.yaml" %}
-
-we can run the pod:
-
-```shell
-$ kubectl create -f ./counter-pod.yaml
-pods/counter
-```
-
-and then fetch the logs:
-
-```shell
-$ kubectl logs counter
-0: Tue Jun 2 21:37:31 UTC 2015
-1: Tue Jun 2 21:37:32 UTC 2015
-2: Tue Jun 2 21:37:33 UTC 2015
-3: Tue Jun 2 21:37:34 UTC 2015
-4: Tue Jun 2 21:37:35 UTC 2015
-5: Tue Jun 2 21:37:36 UTC 2015
-...
-```
-
-If a pod has more than one container then you need to specify which container's log files should
-be fetched e.g.
-
-```shell
-$ kubectl logs kube-dns-v3-7r1l9 etcd
-2015/06/23 00:43:10 etcdserver: start to snapshot (applied: 30003, lastsnap: 20002)
-2015/06/23 00:43:10 etcdserver: compacted log at index 30003
-2015/06/23 00:43:10 etcdserver: saved snapshot at index 30003
-2015/06/23 02:05:42 etcdserver: start to snapshot (applied: 40004, lastsnap: 30003)
-2015/06/23 02:05:42 etcdserver: compacted log at index 40004
-2015/06/23 02:05:42 etcdserver: saved snapshot at index 40004
-2015/06/23 03:28:31 etcdserver: start to snapshot (applied: 50005, lastsnap: 40004)
-2015/06/23 03:28:31 etcdserver: compacted log at index 50005
-2015/06/23 03:28:31 etcdserver: saved snapshot at index 50005
-2015/06/23 03:28:56 filePurge: successfully removed file default.etcd/member/wal/0000000000000000-0000000000000000.wal
-2015/06/23 04:51:03 etcdserver: start to snapshot (applied: 60006, lastsnap: 50005)
-2015/06/23 04:51:03 etcdserver: compacted log at index 60006
-2015/06/23 04:51:03 etcdserver: saved snapshot at index 60006
-...
-```
-
-## Cluster level logging to Google Cloud Logging
-
-The getting started guide [Cluster Level Logging to Google Cloud Logging](/docs/getting-started-guides/logging)
-explains how container logs are ingested into [Google Cloud Logging](https://cloud.google.com/logging/docs/)
-and shows how to query the ingested logs.
-
-## Cluster level logging with Elasticsearch and Kibana
-
-The getting started guide [Cluster Level Logging with Elasticsearch and Kibana](/docs/getting-started-guides/logging-elasticsearch)
-describes how to ingest cluster level logs into Elasticsearch and view them using Kibana.
-
-## Ingesting Application Log Files
-
-Cluster level logging only collects the standard output and standard error output of the applications
-running in containers. The guide [Collecting log files from within containers with Fluentd and sending them to the Google Cloud Logging service](https://github.com/kubernetes/contrib/blob/master/logging/fluentd-sidecar-gcp/README.md) explains how the log files of applications can also be ingested into Google Cloud logging.
-
-## Known issues
-
+---
+assignees:
+- mikedanese
+
+---
+
+This page is designed to help you use logs to troubleshoot issues with your Kubernetes solution.
+
+## Logging by Kubernetes Components
+
+Kubernetes components, such as kubelet and apiserver, use the [glog](https://godoc.org/github.com/golang/glog) logging library. Developer conventions for logging severity are described in [docs/devel/logging.md](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/docs/devel/logging.md).
+
+## Examining the logs of running containers
+
+The logs of a running container may be fetched using the command `kubectl logs`. For example, given
+this pod specification [counter-pod.yaml](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/blog-logging/counter-pod.yaml), which has a container which writes out some text to standard
+output every second. (You can find different pod specifications [here](https://github.com/kubernetes/kubernetes.github.io/tree/{{page.docsbranch}}/docs/user-guide/logging-demo/).)
+
+{% include code.html language="yaml" file="counter-pod.yaml" k8slink="/examples/blog-logging/counter-pod.yaml" %}
+
+we can run the pod:
+
+```shell
+$ kubectl create -f ./counter-pod.yaml
+pods/counter
+```
+
+and then fetch the logs:
+
+```shell
+$ kubectl logs counter
+0: Tue Jun 2 21:37:31 UTC 2015
+1: Tue Jun 2 21:37:32 UTC 2015
+2: Tue Jun 2 21:37:33 UTC 2015
+3: Tue Jun 2 21:37:34 UTC 2015
+4: Tue Jun 2 21:37:35 UTC 2015
+5: Tue Jun 2 21:37:36 UTC 2015
+...
+```
+
+If a pod has more than one container then you need to specify which container's log files should
+be fetched e.g.
+
+```shell
+$ kubectl logs kube-dns-v3-7r1l9 etcd
+2015/06/23 00:43:10 etcdserver: start to snapshot (applied: 30003, lastsnap: 20002)
+2015/06/23 00:43:10 etcdserver: compacted log at index 30003
+2015/06/23 00:43:10 etcdserver: saved snapshot at index 30003
+2015/06/23 02:05:42 etcdserver: start to snapshot (applied: 40004, lastsnap: 30003)
+2015/06/23 02:05:42 etcdserver: compacted log at index 40004
+2015/06/23 02:05:42 etcdserver: saved snapshot at index 40004
+2015/06/23 03:28:31 etcdserver: start to snapshot (applied: 50005, lastsnap: 40004)
+2015/06/23 03:28:31 etcdserver: compacted log at index 50005
+2015/06/23 03:28:31 etcdserver: saved snapshot at index 50005
+2015/06/23 03:28:56 filePurge: successfully removed file default.etcd/member/wal/0000000000000000-0000000000000000.wal
+2015/06/23 04:51:03 etcdserver: start to snapshot (applied: 60006, lastsnap: 50005)
+2015/06/23 04:51:03 etcdserver: compacted log at index 60006
+2015/06/23 04:51:03 etcdserver: saved snapshot at index 60006
+...
+```
+
+## Cluster level logging to Google Cloud Logging
+
+The getting started guide [Cluster Level Logging to Google Cloud Logging](/docs/getting-started-guides/logging)
+explains how container logs are ingested into [Google Cloud Logging](https://cloud.google.com/logging/docs/)
+and shows how to query the ingested logs.
+
+## Cluster level logging with Elasticsearch and Kibana
+
+The getting started guide [Cluster Level Logging with Elasticsearch and Kibana](/docs/getting-started-guides/logging-elasticsearch)
+describes how to ingest cluster level logs into Elasticsearch and view them using Kibana.
+
+## Ingesting Application Log Files
+
+Cluster level logging only collects the standard output and standard error output of the applications
+running in containers. The guide [Collecting log files from within containers with Fluentd and sending them to the Google Cloud Logging service](https://github.com/kubernetes/contrib/blob/master/logging/fluentd-sidecar-gcp/README.md) explains how the log files of applications can also be ingested into Google Cloud logging.
+
+## Known issues
+
Kubernetes does log rotation for Kubernetes components and docker containers. The command `kubectl logs` currently only read the latest logs, not all historical ones.
\ No newline at end of file
diff --git a/docs/user-guide/monitoring.md b/docs/user-guide/monitoring.md
index 6125291421..0c5f673708 100644
--- a/docs/user-guide/monitoring.md
+++ b/docs/user-guide/monitoring.md
@@ -6,7 +6,7 @@ assignees:
Understanding how an application behaves when deployed is crucial to scaling the application and providing a reliable service. In a Kubernetes cluster, application performance can be examined at many different levels: containers, [pods](/docs/user-guide/pods), [services](/docs/user-guide/services), and whole clusters. As part of Kubernetes we want to provide users with detailed resource usage information about their running applications at all these levels. This will give users deep insights into how their applications are performing and where possible application bottlenecks may be found. In comes [Heapster](https://github.com/kubernetes/heapster), a project meant to provide a base monitoring platform on Kubernetes.
-### Overview
+## Overview
Heapster is a cluster-wide aggregator of monitoring and event data. It currently supports Kubernetes natively and works on all Kubernetes setups. Heapster runs as a pod in the cluster, similar to how any Kubernetes application would run. The Heapster pod discovers all nodes in the cluster and queries usage information from the nodes' [Kubelet](https://releases.k8s.io/{{page.githubbranch}}/DESIGN.md#kubelet)s, the on-machine Kubernetes agent. The Kubelet itself fetches the data from [cAdvisor](https://github.com/google/cadvisor). Heapster groups the information by pod along with the relevant labels. This data is then pushed to a configurable backend for storage and visualization. Currently supported backends include [InfluxDB](http://influxdb.com/) (with [Grafana](http://grafana.org/) for visualization), [Google Cloud Monitoring](https://cloud.google.com/monitoring/) and many others described in more details [here](https://github.com/kubernetes/heapster/blob/master/docs/sink-configuration.md). The overall architecture of the service can be seen below:
diff --git a/docs/user-guide/petset/bootstrapping/index.md b/docs/user-guide/petset/bootstrapping/index.md
index e9b04fc135..03ba721edc 100644
--- a/docs/user-guide/petset/bootstrapping/index.md
+++ b/docs/user-guide/petset/bootstrapping/index.md
@@ -8,7 +8,7 @@
This purpose of this guide is to help you become familiar with the runtime initialization of [Pet Sets](/docs/user-guide/petset). This guide assumes the same prerequisites, and uses the same terminology as the [Pet Set user document](/docs/user-guide/petset).
-The most common way to initialize the runtime in a containerized environment, is through a custom [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint). While this is not necessarily bad, making your application pid 1, and treating containers as processes in general is good for a few reasons outside the scope of this document. Doing so allows you to run docker images from third-party vendors without modification. We will not be writing custom entrypoints for this example, but using a feature called [init containers](http://releases.k8s.io/{{page.githubbranch}}/docs/proposals/container-init.md), to explain 2 common patterns that come up deploying Pet Sets.
+The most common way to initialize the runtime in a containerized environment, is through a custom [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint). While this is not necessarily bad, making your application pid 1, and treating containers as processes in general is good for a few reasons outside the scope of this document. Doing so allows you to run docker images from third-party vendors without modification. We will not be writing custom entrypoints for this example, but using a feature called [init containers](http://kubernetes.io/docs/user-guide/production-pods/#handling-initialization), to explain 2 common patterns that come up deploying Pet Sets.
1. Transferring state across Pet restart, so that a future Pet is initialized with the computations of its past incarnation
2. Initializing the runtime environment of a Pet based on existing conditions, like a list of currently healthy peers
diff --git a/docs/user-guide/pods/index.md b/docs/user-guide/pods/index.md
index 4c16b66074..b5de192d83 100644
--- a/docs/user-guide/pods/index.md
+++ b/docs/user-guide/pods/index.md
@@ -150,7 +150,9 @@ Pod is exposed as a primitive in order to facilitate:
* clean composition of Kubelet-level functionality with cluster-level functionality — Kubelet is effectively the "pod controller"
* high-availability applications, which will expect pods to be replaced in advance of their termination and certainly in advance of deletion, such as in the case of planned evictions, image prefetching, or live pod migration [#3949](http://issue.k8s.io/3949)
-The current best practice for pets is to create a replication controller with `replicas` equal to `1` and a corresponding service. If you find this cumbersome, please comment on [issue #260](http://issue.k8s.io/260).
+There is new first-class support for pet-like pods with the [PetSet](/docs/user-guide/petset/) feature (currently in alpha).
+For prior versions of Kubernetes, best practice for pets is to create a replication controller with `replicas` equal to `1` and a corresponding service.
+
## Termination of Pods
diff --git a/docs/user-guide/rolling-updates.md b/docs/user-guide/rolling-updates.md
index 63d3622c89..c9ba5d3d27 100644
--- a/docs/user-guide/rolling-updates.md
+++ b/docs/user-guide/rolling-updates.md
@@ -12,7 +12,7 @@ assignees:
To update a service without an outage, `kubectl` supports what is called ['rolling update'](/docs/user-guide/kubectl/kubectl_rolling-update), which updates one pod at a time, rather than taking down the entire service at the same time. See the [rolling update design document](https://github.com/kubernetes/kubernetes/blob/{{page.githubbranch}}/docs/design/simple-rolling-update.md) and the [example of rolling update](/docs/user-guide/update-demo/) for more information.
Note that `kubectl rolling-update` only supports Replication Controllers. However, if you deploy applications with Replication Controllers,
-consider switching them to [Deployments](/docs/user-guide/deployments/). A Deployments is a higher-level controller that automates rolling updates
+consider switching them to [Deployments](/docs/user-guide/deployments/). A Deployment is a higher-level controller that automates rolling updates
of applications declaratively, and therefore is recommended. If you still want to keep your Replication Controllers and use `kubectl rolling-update`, keep reading:
A rolling update applies changes to the configuration of pods being managed by
diff --git a/docs/user-guide/secrets/index.md b/docs/user-guide/secrets/index.md
index ab8eb9388e..f9931bfbf5 100644
--- a/docs/user-guide/secrets/index.md
+++ b/docs/user-guide/secrets/index.md
@@ -284,7 +284,7 @@ For example, you can specify a default mode like this:
"image": "redis",
"volumeMounts": [{
"name": "foo",
- "mountPath": "/etc/foo",
+ "mountPath": "/etc/foo"
}]
}],
"volumes": [{
@@ -322,7 +322,7 @@ permission for different files like this:
"image": "redis",
"volumeMounts": [{
"name": "foo",
- "mountPath": "/etc/foo",
+ "mountPath": "/etc/foo"
}]
}],
"volumes": [{
@@ -377,7 +377,7 @@ To use a secret in an environment variable in a pod:
1. Modify your Pod definition in each container that you wish to consume the value of a secret key to add an environment variable for each secret key you wish to consume. The environment variable that consumes the secret key should populate the secret's name and key in `env[x].valueFrom.secretKeyRef`.
1. Modify your image and/or command line so that the program looks for values in the specified environment variables
-This is an example of a pod that mounts a secret in a volume:
+This is an example of a pod that uses secrets from environment variables:
```yaml
apiVersion: v1
@@ -543,9 +543,9 @@ credentials.
Make the secrets:
```shell
-$ kubectl create secret generic prod-db-secret --from-literal=user=produser --from-literal=password=Y4nys7f11
+$ kubectl create secret generic prod-db-secret --from-literal=username=produser --from-literal=password=Y4nys7f11
secret "prod-db-secret" created
-$ kubectl create secret generic test-db-secret --from-literal=user=testuser --from-literal=password=iluvtests
+$ kubectl create secret generic test-db-secret --from-literal=username=testuser --from-literal=password=iluvtests
secret "test-db-secret" created
```
diff --git a/docs/user-guide/thirdpartyresources.md b/docs/user-guide/thirdpartyresources.md
new file mode 100644
index 0000000000..d8f2bc5ba9
--- /dev/null
+++ b/docs/user-guide/thirdpartyresources.md
@@ -0,0 +1,118 @@
+---
+assignees:
+- IanLewis
+
+---
+
+* TOC
+{:toc}
+
+## What is ThirdPartyResource?
+
+Kubernetes comes with many built-in API objects. However, there are often times when you might need to extend Kubernetes with their own API objects in order to do custom automation.
+
+`ThirdPartyResource` objects are a way to extend the Kubernetes API with a new API object type. The new API object type will be given an API endpoint URL and support CRUD operations, and watch API. You can then create custom objects using this API endpoint. You can think of `ThirdPartyResources` as being much like the schema for a database table. Once you have created the table, you can then start storing rows in the table. Once created, `ThirdPartyResources` can act as the data model behind custom controllers or automation programs.
+
+## Structure of a ThirdPartyResource
+
+Each `ThirdPartyResource` has the following:
+
+ * `metadata` - Standard Kubernetes object metadata.
+ * `kind` - The kind of the resources described by this third party resource.
+ * `description` - A free text description of the resource.
+ * `versions` - A list of the versions of the resource.
+
+The `kind` for a `ThirdPartyResource` takes the form `.`. You are expected to provide a unique kind and domain name in order to avoid conflicts with other `ThirdPartyResource` objects. Kind names will be converted to CamelCase when creating instances of the `ThirdPartyResource`. Hypens in the `kind` are assumed to be word breaks. For instance the kind `camel-case` would be converted to `CamelCase` but `camelcase` would be converted to `Camelcase`.
+
+Other fields on the `ThirdPartyResource` are treated as custom data fields. These fields can hold arbitrary JSON data and have any structure.
+
+You can view the full documentation about `ThirdPartyResources` using the `explain` command in kubectl.
+
+```
+$ kubectl explain thirdpartyresource
+```
+
+## Creating a ThirdPartyResource
+
+When you user create a new `ThirdPartyResource`, the Kubernetes API Server reacts by creating a new, namespaced RESTful resource path. For now, non-namespaced objects are not supported. As with existing built-in objects, deleting a namespace deletes all custom objects in that namespace. `ThirdPartyResources` themselves are non-namespaced and are available to all namespaces.
+
+For example, if a save the following `ThirdPartyResource` to `resource.yaml`:
+
+```yaml
+apiVersion: extensions/v1beta1
+kind: ThirdPartyResource
+metadata:
+ name: cron-tab.stable.example.com
+description: "A specification of a Pod to run on a cron style schedule"
+versions:
+- name: v1
+```
+
+And create it:
+
+```shell
+$ kubectl create -f resource.yaml
+thirdpartyresource "cron-tab.stable.example.com" created
+```
+
+Then a new RESTful API endpoint is created at:
+
+`/apis/stable.example.com/v1/namespaces//crontabs/...`
+
+This endpoint URL can then be used to create and manage custom objects.
+
+## Creating Custom Objects
+
+After the `ThirdPartyResource` object has been created you can create custom objects. Custom objects can contain custom fields. These fields can contain arbitrary JSON.
+In the following example, a `cronSpec` and `image` custom fields are set to the custom `CronTab` object. If you save the following YAML to `my-crontab.yaml`:
+
+```yaml
+apiVersion: "stable.example.com/v1"
+kind: CronTab
+metadata:
+ name: my-new-cron-object
+cronSpec: "* * * * /5"
+image: my-awesome-cron-image
+```
+
+and create it:
+
+```shell
+$ kubectl create -f my-crontab.yaml
+crontab "my-new-cron-object" created
+```
+
+You can then manage our `CronTab` objects using kubectl. Note that resource names are not case-sensitive when using kubectl:
+
+```shell
+$ kubectl get crontab
+NAME LABELS DATA
+my-new-cron-object {"apiVersion":"stable.example.com/v1","cronSpec":"...
+```
+
+You can also view the raw JSON data. Here you can see that it contains the custom `cronSpec` and `image` fields from the yaml you used to create it:
+
+```yaml
+$ kubectl get crontab -o json
+{
+ "kind": "List",
+ "apiVersion": "v1",
+ "metadata": {},
+ "items": [
+ {
+ "apiVersion": "stable.example.com/v1",
+ "cronSpec": "* * * * /5",
+ "image": "my-awesome-cron-image",
+ "kind": "CronTab",
+ "metadata": {
+ "creationTimestamp": "2016-09-29T04:59:00Z",
+ "name": "my-new-cron-object",
+ "namespace": "default",
+ "resourceVersion": "12601503",
+ "selfLink": "/apis/stable.example.com/v1/namespaces/default/crontabs/my-new-cron-object",
+ "uid": "6f65e7a3-8601-11e6-a23e-42010af0000c"
+ }
+ }
+ ]
+}
+```
diff --git a/index.html b/index.html
index 3c940304ba..cf01ad2e92 100644
--- a/index.html
+++ b/index.html
@@ -14,7 +14,7 @@ title: Production-Grade Container Orchestration
Production-Grade Container Orchestration
Automated container deployment, scaling, and management
diff --git a/js/redirects.js b/js/redirects.js
new file mode 100644
index 0000000000..dc3cbb56ed
--- /dev/null
+++ b/js/redirects.js
@@ -0,0 +1,60 @@
+$( document ).ready(function() {
+ var oldURLs=["/README.md","/README.html",".html",".md","/v1.1/","/v1.0/"];
+ var fwdDirs=["examples/","cluster/","docs/devel","docs/design"];
+ var doRedirect = false;
+ var notHere = false;
+ var forwardingURL=window.location.href;
+
+ var redirects = [{
+ "from": "third_party/swagger-ui",
+ "to": "http://kubernetes.io/kubernetes/third_party/swagger-ui/"
+ },
+ {
+ "from": "resource-quota",
+ "to": "http://kubernetes.io/docs/admin/resourcequota/"
+ },
+ {
+ "from": "horizontal-pod-autoscaler",
+ "to": "http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/"
+ },
+ {
+ "from": "docs/roadmap",
+ "to": "https://github.com/kubernetes/kubernetes/milestones/"
+ },
+ {
+ "from": "api-ref/",
+ "to": "https://github.com/kubernetes/kubernetes/milestones/"
+ },
+ {
+ "from": "docs/user-guide/overview",
+ "to": "http://kubernetes.io/docs/whatisk8s/"
+ }];
+
+ for (i=0;i