Commit 33f18628 authored by Tim Hockin's avatar Tim Hockin

Run gendocs

parent aacc4c86
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Documentation: releases.k8s.io/HEAD # Kubernetes Documentation: releases.k8s.io/HEAD
* The [User's guide](user-guide/README.md) is for anyone who wants to run programs and * The [User's guide](user-guide/README.md) is for anyone who wants to run programs and
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Cluster Admin Guide # Kubernetes Cluster Admin Guide
The cluster admin guide is for anyone creating or administering a Kubernetes cluster. The cluster admin guide is for anyone creating or administering a Kubernetes cluster.
...@@ -72,6 +73,7 @@ If you are modifying an existing guide which uses Salt, this document explains [ ...@@ -72,6 +73,7 @@ If you are modifying an existing guide which uses Salt, this document explains [
project.](salt.md). project.](salt.md).
## Upgrading a cluster ## Upgrading a cluster
[Upgrading a cluster](cluster-management.md). [Upgrading a cluster](cluster-management.md).
## Managing nodes ## Managing nodes
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Configuring APIserver ports # Configuring APIserver ports
This document describes what ports the kubernetes apiserver This document describes what ports the kubernetes apiserver
...@@ -42,6 +43,7 @@ in [Accessing the cluster](../user-guide/accessing-the-cluster.md). ...@@ -42,6 +43,7 @@ in [Accessing the cluster](../user-guide/accessing-the-cluster.md).
## Ports and IPs Served On ## Ports and IPs Served On
The Kubernetes API is served by the Kubernetes APIServer process. Typically, The Kubernetes API is served by the Kubernetes APIServer process. Typically,
there is one of these running on a single kubernetes-master node. there is one of these running on a single kubernetes-master node.
...@@ -93,6 +95,7 @@ variety of uses cases: ...@@ -93,6 +95,7 @@ variety of uses cases:
setup time. Kubelets use cert-based auth, while kube-proxy uses token-based auth. setup time. Kubelets use cert-based auth, while kube-proxy uses token-based auth.
## Expected changes ## Expected changes
- Policy will limit the actions kubelets can do via the authed port. - Policy will limit the actions kubelets can do via the authed port.
- Scheduler and Controller-manager will use the Secure Port too. They - Scheduler and Controller-manager will use the Secure Port too. They
will then be able to run on different machines than the apiserver. will then be able to run on different machines than the apiserver.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Admission Controllers # Admission Controllers
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Authentication Plugins # Authentication Plugins
Kubernetes uses client certificates, tokens, or http basic auth to authenticate users for API calls. Kubernetes uses client certificates, tokens, or http basic auth to authenticate users for API calls.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Authorization Plugins # Authorization Plugins
...@@ -53,6 +54,7 @@ The following implementations are available, and are selected by flag: ...@@ -53,6 +54,7 @@ The following implementations are available, and are selected by flag:
`ABAC` allows for user-configured authorization policy. ABAC stands for Attribute-Based Access Control. `ABAC` allows for user-configured authorization policy. ABAC stands for Attribute-Based Access Control.
## ABAC Mode ## ABAC Mode
### Request Attributes ### Request Attributes
A request has 4 attributes that can be considered for authorization: A request has 4 attributes that can be considered for authorization:
...@@ -105,6 +107,7 @@ To permit any user to do something, write a policy with the user property unset. ...@@ -105,6 +107,7 @@ To permit any user to do something, write a policy with the user property unset.
To permit an action Policy with an unset namespace applies regardless of namespace. To permit an action Policy with an unset namespace applies regardless of namespace.
### Examples ### Examples
1. Alice can do anything: `{"user":"alice"}` 1. Alice can do anything: `{"user":"alice"}`
2. Kubelet can read any pods: `{"user":"kubelet", "resource": "pods", "readonly": true}` 2. Kubelet can read any pods: `{"user":"kubelet", "resource": "pods", "readonly": true}`
3. Kubelet can read and write events: `{"user":"kubelet", "resource": "events"}` 3. Kubelet can read and write events: `{"user":"kubelet", "resource": "events"}`
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Cluster Admin Guide: Cluster Components # Kubernetes Cluster Admin Guide: Cluster Components
This document outlines the various binary components that need to run to This document outlines the various binary components that need to run to
...@@ -92,6 +93,7 @@ These controllers include: ...@@ -92,6 +93,7 @@ These controllers include:
selects a node for them to run on. selects a node for them to run on.
### addons ### addons
Addons are pods and services that implement cluster features. They don't run on Addons are pods and services that implement cluster features. They don't run on
the master VM, but currently the default setup scripts that make the API calls the master VM, but currently the default setup scripts that make the API calls
to create these pods and services does run on the master VM. See: to create these pods and services does run on the master VM. See:
......
...@@ -30,9 +30,11 @@ Documentation for other releases can be found at ...@@ -30,9 +30,11 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Large Cluster # Kubernetes Large Cluster
## Support ## Support
At v1.0, Kubernetes supports clusters up to 100 nodes with 30 pods per node and 1-2 container per pod (as defined in the [1.0 roadmap](../../docs/roadmap.md#reliability-and-performance)). At v1.0, Kubernetes supports clusters up to 100 nodes with 30 pods per node and 1-2 container per pod (as defined in the [1.0 roadmap](../../docs/roadmap.md#reliability-and-performance)).
## Setup ## Setup
...@@ -59,6 +61,7 @@ To avoid running into cloud provider quota issues, when creating a cluster with ...@@ -59,6 +61,7 @@ To avoid running into cloud provider quota issues, when creating a cluster with
* Gating the setup script so that it brings up new node VMs in smaller batches with waits in between, because some cloud providers rate limit the creation of VMs. * Gating the setup script so that it brings up new node VMs in smaller batches with waits in between, because some cloud providers rate limit the creation of VMs.
### Addon Resources ### Addon Resources
To prevent memory leaks or other resource issues in [cluster addons](../../cluster/addons/) from consuming all the resources available on a node, Kubernetes sets resource limits on addon containers to limit the CPU and Memory resources they can consume (See PR [#10653](https://github.com/GoogleCloudPlatform/kubernetes/pull/10653/files) and [#10778](https://github.com/GoogleCloudPlatform/kubernetes/pull/10778/files)). To prevent memory leaks or other resource issues in [cluster addons](../../cluster/addons/) from consuming all the resources available on a node, Kubernetes sets resource limits on addon containers to limit the CPU and Memory resources they can consume (See PR [#10653](https://github.com/GoogleCloudPlatform/kubernetes/pull/10653/files) and [#10778](https://github.com/GoogleCloudPlatform/kubernetes/pull/10778/files)).
For example: For example:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Cluster Management # Cluster Management
This doc is in progress. This doc is in progress.
......
...@@ -30,13 +30,16 @@ Documentation for other releases can be found at ...@@ -30,13 +30,16 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Cluster Troubleshooting # Cluster Troubleshooting
This doc is about cluster troubleshooting; we assume you have already ruled out your application as the root cause of the This doc is about cluster troubleshooting; we assume you have already ruled out your application as the root cause of the
problem you are experiencing. See problem you are experiencing. See
the [application troubleshooting guide](../user-guide/application-troubleshooting.md) for tips on application debugging. the [application troubleshooting guide](../user-guide/application-troubleshooting.md) for tips on application debugging.
You may also visit [troubleshooting document](../troubleshooting.md) for more information. You may also visit [troubleshooting document](../troubleshooting.md) for more information.
## Listing your cluster ## Listing your cluster
The first thing to debug in your cluster is if your nodes are all registered correctly. The first thing to debug in your cluster is if your nodes are all registered correctly.
Run Run
...@@ -48,15 +51,18 @@ kubectl get nodes ...@@ -48,15 +51,18 @@ kubectl get nodes
And verify that all of the nodes you expect to see are present and that they are all in the ```Ready``` state. And verify that all of the nodes you expect to see are present and that they are all in the ```Ready``` state.
## Looking at logs ## Looking at logs
For now, digging deeper into the cluster requires logging into the relevant machines. Here are the locations For now, digging deeper into the cluster requires logging into the relevant machines. Here are the locations
of the relevant log files. (note that on systemd-based systems, you may need to use ```journalctl``` instead) of the relevant log files. (note that on systemd-based systems, you may need to use ```journalctl``` instead)
### Master ### Master
* /var/log/kube-apiserver.log - API Server, responsible for serving the API * /var/log/kube-apiserver.log - API Server, responsible for serving the API
* /var/log/kube-scheduler.log - Scheduler, responsible for making scheduling decisions * /var/log/kube-scheduler.log - Scheduler, responsible for making scheduling decisions
* /var/log/kube-controller-manager.log - Controller that manages replication controllers * /var/log/kube-controller-manager.log - Controller that manages replication controllers
### Worker Nodes ### Worker Nodes
* /var/log/kubelet.log - Kubelet, responsible for running containers on the node * /var/log/kubelet.log - Kubelet, responsible for running containers on the node
* /var/log/kube-proxy.log - Kube Proxy, responsible for service load balancing * /var/log/kube-proxy.log - Kube Proxy, responsible for service load balancing
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# DNS Integration with Kubernetes # DNS Integration with Kubernetes
As of kubernetes 0.8, DNS is offered as a [cluster add-on](../../cluster/addons/README.md). As of kubernetes 0.8, DNS is offered as a [cluster add-on](../../cluster/addons/README.md).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# High Availability Kubernetes Clusters # High Availability Kubernetes Clusters
**Table of Contents** **Table of Contents**
...@@ -43,6 +44,7 @@ Documentation for other releases can be found at ...@@ -43,6 +44,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: GENERATED_TOC --> <!-- END MUNGE: GENERATED_TOC -->
## Introduction ## Introduction
This document describes how to build a high-availability (HA) Kubernetes cluster. This is a fairly advanced topic. This document describes how to build a high-availability (HA) Kubernetes cluster. This is a fairly advanced topic.
Users who merely want to experiment with Kubernetes are encouraged to use configurations that are simpler to set up such as Users who merely want to experiment with Kubernetes are encouraged to use configurations that are simpler to set up such as
the simple [Docker based single node cluster instructions](../../docs/getting-started-guides/docker.md), the simple [Docker based single node cluster instructions](../../docs/getting-started-guides/docker.md),
...@@ -52,6 +54,7 @@ Also, at this time high availability support for Kubernetes is not continuously ...@@ -52,6 +54,7 @@ Also, at this time high availability support for Kubernetes is not continuously
be working to add this continuous testing, but for now the single-node master installations are more heavily tested. be working to add this continuous testing, but for now the single-node master installations are more heavily tested.
## Overview ## Overview
Setting up a truly reliable, highly available distributed system requires a number of steps, it is akin to Setting up a truly reliable, highly available distributed system requires a number of steps, it is akin to
wearing underwear, pants, a belt, suspenders, another pair of underwear, and another pair of pants. We go into each wearing underwear, pants, a belt, suspenders, another pair of underwear, and another pair of pants. We go into each
of these steps in detail, but a summary is given here to help guide and orient the user. of these steps in detail, but a summary is given here to help guide and orient the user.
...@@ -68,6 +71,7 @@ Here's what the system should look like when it's finished: ...@@ -68,6 +71,7 @@ Here's what the system should look like when it's finished:
Ready? Let's get started. Ready? Let's get started.
## Initial set-up ## Initial set-up
The remainder of this guide assumes that you are setting up a 3-node clustered master, where each machine is running some flavor of Linux. The remainder of this guide assumes that you are setting up a 3-node clustered master, where each machine is running some flavor of Linux.
Examples in the guide are given for Debian distributions, but they should be easily adaptable to other distributions. Examples in the guide are given for Debian distributions, but they should be easily adaptable to other distributions.
Likewise, this set up should work whether you are running in a public or private cloud provider, or if you are running Likewise, this set up should work whether you are running in a public or private cloud provider, or if you are running
...@@ -78,6 +82,7 @@ instructions at [https://get.k8s.io](https://get.k8s.io) ...@@ -78,6 +82,7 @@ instructions at [https://get.k8s.io](https://get.k8s.io)
describe easy installation for single-master clusters on a variety of platforms. describe easy installation for single-master clusters on a variety of platforms.
## Reliable nodes ## Reliable nodes
On each master node, we are going to run a number of processes that implement the Kubernetes API. The first step in making these reliable is On each master node, we are going to run a number of processes that implement the Kubernetes API. The first step in making these reliable is
to make sure that each automatically restarts when it fails. To achieve this, we need to install a process watcher. We choose to use to make sure that each automatically restarts when it fails. To achieve this, we need to install a process watcher. We choose to use
the ```kubelet``` that we run on each of the worker nodes. This is convenient, since we can use containers to distribute our binaries, we can the ```kubelet``` that we run on each of the worker nodes. This is convenient, since we can use containers to distribute our binaries, we can
...@@ -98,6 +103,7 @@ On systemd systems you ```systemctl enable kubelet``` and ```systemctl enable do ...@@ -98,6 +103,7 @@ On systemd systems you ```systemctl enable kubelet``` and ```systemctl enable do
## Establishing a redundant, reliable data storage layer ## Establishing a redundant, reliable data storage layer
The central foundation of a highly available solution is a redundant, reliable storage layer. The number one rule of high-availability is The central foundation of a highly available solution is a redundant, reliable storage layer. The number one rule of high-availability is
to protect the data. Whatever else happens, whatever catches on fire, if you have the data, you can rebuild. If you lose the data, you're to protect the data. Whatever else happens, whatever catches on fire, if you have the data, you can rebuild. If you lose the data, you're
done. done.
...@@ -109,6 +115,7 @@ size of the cluster from three to five nodes. If that is still insufficient, yo ...@@ -109,6 +115,7 @@ size of the cluster from three to five nodes. If that is still insufficient, yo
[even more redundancy to your storage layer](#even-more-reliable-storage). [even more redundancy to your storage layer](#even-more-reliable-storage).
### Clustering etcd ### Clustering etcd
The full details of clustering etcd are beyond the scope of this document, lots of details are given on the The full details of clustering etcd are beyond the scope of this document, lots of details are given on the
[etcd clustering page](https://github.com/coreos/etcd/blob/master/Documentation/clustering.md). This example walks through [etcd clustering page](https://github.com/coreos/etcd/blob/master/Documentation/clustering.md). This example walks through
a simple cluster set up, using etcd's built in discovery to build our cluster. a simple cluster set up, using etcd's built in discovery to build our cluster.
...@@ -130,6 +137,7 @@ for ```${NODE_IP}``` on each machine. ...@@ -130,6 +137,7 @@ for ```${NODE_IP}``` on each machine.
#### Validating your cluster #### Validating your cluster
Once you copy this into all three nodes, you should have a clustered etcd set up. You can validate with Once you copy this into all three nodes, you should have a clustered etcd set up. You can validate with
``` ```
...@@ -146,6 +154,7 @@ You can also validate that this is working with ```etcdctl set foo bar``` on one ...@@ -146,6 +154,7 @@ You can also validate that this is working with ```etcdctl set foo bar``` on one
on a different node. on a different node.
### Even more reliable storage ### Even more reliable storage
Of course, if you are interested in increased data reliability, there are further options which makes the place where etcd Of course, if you are interested in increased data reliability, there are further options which makes the place where etcd
installs it's data even more reliable than regular disks (belts *and* suspenders, ftw!). installs it's data even more reliable than regular disks (belts *and* suspenders, ftw!).
...@@ -162,9 +171,11 @@ for each node. Throughout these instructions, we assume that this storage is mo ...@@ -162,9 +171,11 @@ for each node. Throughout these instructions, we assume that this storage is mo
## Replicated API Servers ## Replicated API Servers
Once you have replicated etcd set up correctly, we will also install the apiserver using the kubelet. Once you have replicated etcd set up correctly, we will also install the apiserver using the kubelet.
### Installing configuration files ### Installing configuration files
First you need to create the initial log file, so that Docker mounts a file instead of a directory: First you need to create the initial log file, so that Docker mounts a file instead of a directory:
``` ```
...@@ -183,12 +194,14 @@ Next, you need to create a ```/srv/kubernetes/``` directory on each node. This ...@@ -183,12 +194,14 @@ Next, you need to create a ```/srv/kubernetes/``` directory on each node. This
The easiest way to create this directory, may be to copy it from the master node of a working cluster, or you can manually generate these files yourself. The easiest way to create this directory, may be to copy it from the master node of a working cluster, or you can manually generate these files yourself.
### Starting the API Server ### Starting the API Server
Once these files exist, copy the [kube-apiserver.yaml](high-availability/kube-apiserver.yaml) into ```/etc/kubernetes/manifests/``` on each master node. Once these files exist, copy the [kube-apiserver.yaml](high-availability/kube-apiserver.yaml) into ```/etc/kubernetes/manifests/``` on each master node.
The kubelet monitors this directory, and will automatically create an instance of the ```kube-apiserver``` container using the pod definition specified The kubelet monitors this directory, and will automatically create an instance of the ```kube-apiserver``` container using the pod definition specified
in the file. in the file.
### Load balancing ### Load balancing
At this point, you should have 3 apiservers all working correctly. If you set up a network load balancer, you should At this point, you should have 3 apiservers all working correctly. If you set up a network load balancer, you should
be able to access your cluster via that load balancer, and see traffic balancing between the apiserver instances. Setting be able to access your cluster via that load balancer, and see traffic balancing between the apiserver instances. Setting
up a load balancer will depend on the specifics of your platform, for example instructions for the Google Cloud up a load balancer will depend on the specifics of your platform, for example instructions for the Google Cloud
...@@ -203,6 +216,7 @@ For external users of the API (e.g. the ```kubectl``` command line interface, co ...@@ -203,6 +216,7 @@ For external users of the API (e.g. the ```kubectl``` command line interface, co
them to talk to the external load balancer's IP address. them to talk to the external load balancer's IP address.
## Master elected components ## Master elected components
So far we have set up state storage, and we have set up the API server, but we haven't run anything that actually modifies So far we have set up state storage, and we have set up the API server, but we haven't run anything that actually modifies
cluster state, such as the controller manager and scheduler. To achieve this reliably, we only want to have one actor modifying state at a time, but we want replicated cluster state, such as the controller manager and scheduler. To achieve this reliably, we only want to have one actor modifying state at a time, but we want replicated
instances of these actors, in case a machine dies. To achieve this, we are going to use a lease-lock in etcd to perform instances of these actors, in case a machine dies. To achieve this, we are going to use a lease-lock in etcd to perform
...@@ -226,6 +240,7 @@ by copying [kube-scheduler.yaml](high-availability/kube-scheduler.yaml) and [kub ...@@ -226,6 +240,7 @@ by copying [kube-scheduler.yaml](high-availability/kube-scheduler.yaml) and [kub
directory. directory.
### Running the podmaster ### Running the podmaster
Now that the configuration files are in place, copy the [podmaster.yaml](high-availability/podmaster.yaml) config file into ```/etc/kubernetes/manifests/``` Now that the configuration files are in place, copy the [podmaster.yaml](high-availability/podmaster.yaml) config file into ```/etc/kubernetes/manifests/```
As before, the kubelet on the node monitors this directory, and will start an instance of the podmaster using the pod specification provided in ```podmaster.yaml```. As before, the kubelet on the node monitors this directory, and will start an instance of the podmaster using the pod specification provided in ```podmaster.yaml```.
...@@ -236,6 +251,7 @@ the kubelet will restart them. If any of these nodes fail, the process will mov ...@@ -236,6 +251,7 @@ the kubelet will restart them. If any of these nodes fail, the process will mov
node. node.
## Conclusion ## Conclusion
At this point, you are done (yeah!) with the master components, but you still need to add worker nodes (boo!). At this point, you are done (yeah!) with the master components, but you still need to add worker nodes (boo!).
If you have an existing cluster, this is as simple as reconfiguring your kubelets to talk to the load-balanced endpoint, and If you have an existing cluster, this is as simple as reconfiguring your kubelets to talk to the load-balanced endpoint, and
...@@ -244,7 +260,7 @@ restarting the kubelets on each node. ...@@ -244,7 +260,7 @@ restarting the kubelets on each node.
If you are turning up a fresh cluster, you will need to install the kubelet and kube-proxy on each worker node, and If you are turning up a fresh cluster, you will need to install the kubelet and kube-proxy on each worker node, and
set the ```--apiserver``` flag to your replicated endpoint. set the ```--apiserver``` flag to your replicated endpoint.
##Vagrant up! ## Vagrant up!
We indeed have an initial proof of concept tester for this, which is available [here](../../examples/high-availability/). We indeed have an initial proof of concept tester for this, which is available [here](../../examples/high-availability/).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kube-apiserver ## kube-apiserver
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kube-controller-manager ## kube-controller-manager
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kube-proxy ## kube-proxy
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kube-scheduler ## kube-scheduler
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubelet ## kubelet
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Considerations for running multiple Kubernetes clusters # Considerations for running multiple Kubernetes clusters
You may want to set up multiple kubernetes clusters, both to You may want to set up multiple kubernetes clusters, both to
...@@ -65,6 +66,7 @@ Reasons to have multiple clusters include: ...@@ -65,6 +66,7 @@ Reasons to have multiple clusters include:
- test clusters to canary new Kubernetes releases or other cluster software. - test clusters to canary new Kubernetes releases or other cluster software.
## Selecting the right number of clusters ## Selecting the right number of clusters
The selection of the number of kubernetes clusters may be a relatively static choice, only revisited occasionally. The selection of the number of kubernetes clusters may be a relatively static choice, only revisited occasionally.
By contrast, the number of nodes in a cluster and the number of pods in a service may be change frequently according to By contrast, the number of nodes in a cluster and the number of pods in a service may be change frequently according to
load and growth. load and growth.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Networking in Kubernetes # Networking in Kubernetes
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Node # Node
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes OpenVSwitch GRE/VxLAN networking # Kubernetes OpenVSwitch GRE/VxLAN networking
This document describes how OpenVSwitch is used to setup networking between pods across nodes. This document describes how OpenVSwitch is used to setup networking between pods across nodes.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Administering Resource Quotas # Administering Resource Quotas
Kubernetes can limit both the number of objects created in a namespace, and the Kubernetes can limit both the number of objects created in a namespace, and the
...@@ -49,7 +50,8 @@ Resource Quota is enforced in a particular namespace when there is a ...@@ -49,7 +50,8 @@ Resource Quota is enforced in a particular namespace when there is a
See [ResourceQuota design doc](../design/admission_control_resource_quota.md) for more information. See [ResourceQuota design doc](../design/admission_control_resource_quota.md) for more information.
## Object Count Quota ## Object Count Quota
The number of objects of a given type can be restricted. The following types The number of objects of a given type can be restricted. The following types
are supported: are supported:
...@@ -65,7 +67,8 @@ are supported: ...@@ -65,7 +67,8 @@ are supported:
For example, `pods` quota counts and enforces a maximum on the number of `pods` For example, `pods` quota counts and enforces a maximum on the number of `pods`
created in a single namespace. created in a single namespace.
## Compute Resource Quota ## Compute Resource Quota
The total number of objects of a given type can be restricted. The following types The total number of objects of a given type can be restricted. The following types
are supported: are supported:
...@@ -83,6 +86,7 @@ Any resource that is not part of core Kubernetes must follow the resource naming ...@@ -83,6 +86,7 @@ Any resource that is not part of core Kubernetes must follow the resource naming
This means the resource must have a fully-qualified name (i.e. mycompany.org/shinynewresource) This means the resource must have a fully-qualified name (i.e. mycompany.org/shinynewresource)
## Viewing and Setting Quotas ## Viewing and Setting Quotas
Kubectl supports creating, updating, and viewing quotas Kubectl supports creating, updating, and viewing quotas
``` ```
...@@ -123,6 +127,7 @@ services 3 5 ...@@ -123,6 +127,7 @@ services 3 5
``` ```
## Quota and Cluster Capacity ## Quota and Cluster Capacity
Resource Quota objects are independent of the Cluster Capacity. They are Resource Quota objects are independent of the Cluster Capacity. They are
expressed in absolute units. expressed in absolute units.
...@@ -136,6 +141,7 @@ writing a 'controller' which watches the quota usage and adjusts the quota ...@@ -136,6 +141,7 @@ writing a 'controller' which watches the quota usage and adjusts the quota
hard limits of each namespace. hard limits of each namespace.
## Example ## Example
See a [detailed example for how to use resource quota](../user-guide/resourcequota/). See a [detailed example for how to use resource quota](../user-guide/resourcequota/).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Using Salt to configure Kubernetes # Using Salt to configure Kubernetes
The Kubernetes cluster can be configured using Salt. The Kubernetes cluster can be configured using Salt.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Cluster Admin Guide to Service Accounts # Cluster Admin Guide to Service Accounts
*This is a Cluster Administrator guide to service accounts. It assumes knowledge of *This is a Cluster Administrator guide to service accounts. It assumes knowledge of
...@@ -57,7 +58,7 @@ for a number of reasons: ...@@ -57,7 +58,7 @@ for a number of reasons:
accounts for components of that system. Because service accounts can be created accounts for components of that system. Because service accounts can be created
ad-hoc and have namespaced names, such config is portable. ad-hoc and have namespaced names, such config is portable.
## Service account automation ## Service account automation
Three separate components cooperate to implement the automation around service accounts: Three separate components cooperate to implement the automation around service accounts:
- A Service account admission controller - A Service account admission controller
...@@ -78,6 +79,7 @@ It acts synchronously to modify pods as they are created or updated. When this p ...@@ -78,6 +79,7 @@ It acts synchronously to modify pods as they are created or updated. When this p
6. It adds a `volumeSource` to each container of the pod mounted at `/var/run/secrets/kubernetes.io/serviceaccount`. 6. It adds a `volumeSource` to each container of the pod mounted at `/var/run/secrets/kubernetes.io/serviceaccount`.
### Token Controller ### Token Controller
TokenController runs as part of controller-manager. It acts asynchronously. It: TokenController runs as part of controller-manager. It acts asynchronously. It:
- observes serviceAccount creation and creates a corresponding Secret to allow API access. - observes serviceAccount creation and creates a corresponding Secret to allow API access.
- observes serviceAccount deletion and deletes all corresponding ServiceAccountToken Secrets - observes serviceAccount deletion and deletes all corresponding ServiceAccountToken Secrets
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# The Kubernetes API # The Kubernetes API
Primary system and API concepts are documented in the [User guide](user-guide/README.md). Primary system and API concepts are documented in the [User guide](user-guide/README.md).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Design Overview # Kubernetes Design Overview
Kubernetes is a system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications. Kubernetes is a system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# K8s Identity and Access Management Sketch # K8s Identity and Access Management Sketch
This document suggests a direction for identity and access management in the Kubernetes system. This document suggests a direction for identity and access management in the Kubernetes system.
...@@ -43,6 +44,7 @@ High level goals are: ...@@ -43,6 +44,7 @@ High level goals are:
- Ease integration with existing enterprise and hosted scenarios. - Ease integration with existing enterprise and hosted scenarios.
### Actors ### Actors
Each of these can act as normal users or attackers. Each of these can act as normal users or attackers.
- External Users: People who are accessing applications running on K8s (e.g. a web site served by webserver running in a container on K8s), but who do not have K8s API access. - External Users: People who are accessing applications running on K8s (e.g. a web site served by webserver running in a container on K8s), but who do not have K8s API access.
- K8s Users : People who access the K8s API (e.g. create K8s API objects like Pods) - K8s Users : People who access the K8s API (e.g. create K8s API objects like Pods)
...@@ -51,6 +53,7 @@ Each of these can act as normal users or attackers. ...@@ -51,6 +53,7 @@ Each of these can act as normal users or attackers.
- K8s Admin means K8s Cluster Admins and K8s Project Admins taken together. - K8s Admin means K8s Cluster Admins and K8s Project Admins taken together.
### Threats ### Threats
Both intentional attacks and accidental use of privilege are concerns. Both intentional attacks and accidental use of privilege are concerns.
For both cases it may be useful to think about these categories differently: For both cases it may be useful to think about these categories differently:
...@@ -81,6 +84,7 @@ K8s Cluster assets: ...@@ -81,6 +84,7 @@ K8s Cluster assets:
This document is primarily about protecting K8s User assets and K8s cluster assets from other K8s Users and K8s Project and Cluster Admins. This document is primarily about protecting K8s User assets and K8s cluster assets from other K8s Users and K8s Project and Cluster Admins.
### Usage environments ### Usage environments
Cluster in Small organization: Cluster in Small organization:
- K8s Admins may be the same people as K8s Users. - K8s Admins may be the same people as K8s Users.
- few K8s Admins. - few K8s Admins.
...@@ -112,6 +116,7 @@ Pods configs should be largely portable between Org-run and hosted configuration ...@@ -112,6 +116,7 @@ Pods configs should be largely portable between Org-run and hosted configuration
# Design # Design
Related discussion: Related discussion:
- https://github.com/GoogleCloudPlatform/kubernetes/issues/442 - https://github.com/GoogleCloudPlatform/kubernetes/issues/442
- https://github.com/GoogleCloudPlatform/kubernetes/issues/443 - https://github.com/GoogleCloudPlatform/kubernetes/issues/443
...@@ -125,7 +130,9 @@ K8s distribution should include templates of config, and documentation, for simp ...@@ -125,7 +130,9 @@ K8s distribution should include templates of config, and documentation, for simp
Features in this doc are divided into "Initial Feature", and "Improvements". Initial features would be candidates for version 1.00. Features in this doc are divided into "Initial Feature", and "Improvements". Initial features would be candidates for version 1.00.
## Identity ## Identity
###userAccount
### userAccount
K8s will have a `userAccount` API object. K8s will have a `userAccount` API object.
- `userAccount` has a UID which is immutable. This is used to associate users with objects and to record actions in audit logs. - `userAccount` has a UID which is immutable. This is used to associate users with objects and to record actions in audit logs.
- `userAccount` has a name which is a string and human readable and unique among userAccounts. It is used to refer to users in Policies, to ensure that the Policies are human readable. It can be changed only when there are no Policy objects or other objects which refer to that name. An email address is a suggested format for this field. - `userAccount` has a name which is a string and human readable and unique among userAccounts. It is used to refer to users in Policies, to ensure that the Policies are human readable. It can be changed only when there are no Policy objects or other objects which refer to that name. An email address is a suggested format for this field.
...@@ -158,7 +165,8 @@ Enterprise Profile: ...@@ -158,7 +165,8 @@ Enterprise Profile:
- each service using the API has own `userAccount` too. (e.g. `scheduler`, `repcontroller`) - each service using the API has own `userAccount` too. (e.g. `scheduler`, `repcontroller`)
- automated jobs to denormalize the ldap group info into the local system list of users into the K8s userAccount file. - automated jobs to denormalize the ldap group info into the local system list of users into the K8s userAccount file.
###Unix accounts ### Unix accounts
A `userAccount` is not a Unix user account. The fact that a pod is started by a `userAccount` does not mean that the processes in that pod's containers run as a Unix user with a corresponding name or identity. A `userAccount` is not a Unix user account. The fact that a pod is started by a `userAccount` does not mean that the processes in that pod's containers run as a Unix user with a corresponding name or identity.
Initially: Initially:
...@@ -170,7 +178,8 @@ Improvements: ...@@ -170,7 +178,8 @@ Improvements:
- requires docker to integrate user namespace support, and deciding what getpwnam() does for these uids. - requires docker to integrate user namespace support, and deciding what getpwnam() does for these uids.
- any features that help users avoid use of privileged containers (https://github.com/GoogleCloudPlatform/kubernetes/issues/391) - any features that help users avoid use of privileged containers (https://github.com/GoogleCloudPlatform/kubernetes/issues/391)
###Namespaces ### Namespaces
K8s will have a have a `namespace` API object. It is similar to a Google Compute Engine `project`. It provides a namespace for objects created by a group of people co-operating together, preventing name collisions with non-cooperating groups. It also serves as a reference point for authorization policies. K8s will have a have a `namespace` API object. It is similar to a Google Compute Engine `project`. It provides a namespace for objects created by a group of people co-operating together, preventing name collisions with non-cooperating groups. It also serves as a reference point for authorization policies.
Namespaces are described in [namespaces.md](namespaces.md). Namespaces are described in [namespaces.md](namespaces.md).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Proposal - Admission Control # Kubernetes Proposal - Admission Control
**Related PR:** **Related PR:**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Admission control plugin: LimitRanger # Admission control plugin: LimitRanger
## Background ## Background
...@@ -164,6 +165,7 @@ It is expected we will want to define limits for particular pods or containers b ...@@ -164,6 +165,7 @@ It is expected we will want to define limits for particular pods or containers b
To make a **LimitRangeItem** more restrictive, we will intend to add these additional restrictions at a future point in time. To make a **LimitRangeItem** more restrictive, we will intend to add these additional restrictions at a future point in time.
## Example ## Example
See the [example of Limit Range](../user-guide/limitrange/) for more information. See the [example of Limit Range](../user-guide/limitrange/) for more information.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Admission control plugin: ResourceQuota # Admission control plugin: ResourceQuota
## Background ## Background
...@@ -185,6 +186,7 @@ services 3 5 ...@@ -185,6 +186,7 @@ services 3 5
``` ```
## More information ## More information
See [resource quota document](../admin/resource-quota.md) and the [example of Resource Quota](../user-guide/resourcequota/) for more information. See [resource quota document](../admin/resource-quota.md) and the [example of Resource Quota](../user-guide/resourcequota/) for more information.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes architecture # Kubernetes architecture
A running Kubernetes cluster contains node agents (kubelet) and master components (APIs, scheduler, etc), on top of a distributed storage solution. This diagram shows our desired eventual state, though we're still working on a few things, like making kubelet itself (all our components, really) run within containers, and making the scheduler 100% pluggable. A running Kubernetes cluster contains node agents (kubelet) and master components (APIs, scheduler, etc), on top of a distributed storage solution. This diagram shows our desired eventual state, though we're still working on a few things, like making kubelet itself (all our components, really) run within containers, and making the scheduler 100% pluggable.
...@@ -45,6 +46,7 @@ The Kubernetes node has the services necessary to run application containers and ...@@ -45,6 +46,7 @@ The Kubernetes node has the services necessary to run application containers and
Each node runs Docker, of course. Docker takes care of the details of downloading images and running containers. Each node runs Docker, of course. Docker takes care of the details of downloading images and running containers.
### Kubelet ### Kubelet
The **Kubelet** manages [pods](../user-guide/pods.md) and their containers, their images, their volumes, etc. The **Kubelet** manages [pods](../user-guide/pods.md) and their containers, their images, their volumes, etc.
### Kube-Proxy ### Kube-Proxy
......
...@@ -30,10 +30,12 @@ Documentation for other releases can be found at ...@@ -30,10 +30,12 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Clustering in Kubernetes # Clustering in Kubernetes
## Overview ## Overview
The term "clustering" refers to the process of having all members of the kubernetes cluster find and trust each other. There are multiple different ways to achieve clustering with different security and usability profiles. This document attempts to lay out the user experiences for clustering that Kubernetes aims to address. The term "clustering" refers to the process of having all members of the kubernetes cluster find and trust each other. There are multiple different ways to achieve clustering with different security and usability profiles. This document attempts to lay out the user experiences for clustering that Kubernetes aims to address.
Once a cluster is established, the following is true: Once a cluster is established, the following is true:
......
...@@ -41,6 +41,7 @@ pip install seqdiag ...@@ -41,6 +41,7 @@ pip install seqdiag
Just call `make` to regenerate the diagrams. Just call `make` to regenerate the diagrams.
## Building with Docker ## Building with Docker
If you are on a Mac or your pip install is messed up, you can easily build with docker. If you are on a Mac or your pip install is messed up, you can easily build with docker.
``` ```
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Container Command Execution & Port Forwarding in Kubernetes # Container Command Execution & Port Forwarding in Kubernetes
## Abstract ## Abstract
...@@ -87,12 +88,14 @@ won't be able to work with this mechanism, unless adapters can be written. ...@@ -87,12 +88,14 @@ won't be able to work with this mechanism, unless adapters can be written.
## Process Flow ## Process Flow
### Remote Command Execution Flow ### Remote Command Execution Flow
1. The client connects to the Kubernetes Master to initiate a remote command execution 1. The client connects to the Kubernetes Master to initiate a remote command execution
request request
2. The Master proxies the request to the Kubelet where the container lives 2. The Master proxies the request to the Kubelet where the container lives
3. The Kubelet executes nsenter + the requested command and streams stdin/stdout/stderr back and forth between the client and the container 3. The Kubelet executes nsenter + the requested command and streams stdin/stdout/stderr back and forth between the client and the container
### Port Forwarding Flow ### Port Forwarding Flow
1. The client connects to the Kubernetes Master to initiate a remote command execution 1. The client connects to the Kubernetes Master to initiate a remote command execution
request request
2. The Master proxies the request to the Kubelet where the container lives 2. The Master proxies the request to the Kubelet where the container lives
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Event Compression # Kubernetes Event Compression
This document captures the design of event compression. This document captures the design of event compression.
...@@ -40,11 +41,13 @@ This document captures the design of event compression. ...@@ -40,11 +41,13 @@ This document captures the design of event compression.
Kubernetes components can get into a state where they generate tons of events which are identical except for the timestamp. For example, when pulling a non-existing image, Kubelet will repeatedly generate ```image_not_existing``` and ```container_is_waiting``` events until upstream components correct the image. When this happens, the spam from the repeated events makes the entire event mechanism useless. It also appears to cause memory pressure in etcd (see [#3853](https://github.com/GoogleCloudPlatform/kubernetes/issues/3853)). Kubernetes components can get into a state where they generate tons of events which are identical except for the timestamp. For example, when pulling a non-existing image, Kubelet will repeatedly generate ```image_not_existing``` and ```container_is_waiting``` events until upstream components correct the image. When this happens, the spam from the repeated events makes the entire event mechanism useless. It also appears to cause memory pressure in etcd (see [#3853](https://github.com/GoogleCloudPlatform/kubernetes/issues/3853)).
## Proposal ## Proposal
Each binary that generates events (for example, ```kubelet```) should keep track of previously generated events so that it can collapse recurring events into a single event instead of creating a new instance for each new event. Each binary that generates events (for example, ```kubelet```) should keep track of previously generated events so that it can collapse recurring events into a single event instead of creating a new instance for each new event.
Event compression should be best effort (not guaranteed). Meaning, in the worst case, ```n``` identical (minus timestamp) events may still result in ```n``` event entries. Event compression should be best effort (not guaranteed). Meaning, in the worst case, ```n``` identical (minus timestamp) events may still result in ```n``` event entries.
## Design ## Design
Instead of a single Timestamp, each event object [contains](../../pkg/api/types.go#L1111) the following fields: Instead of a single Timestamp, each event object [contains](../../pkg/api/types.go#L1111) the following fields:
* ```FirstTimestamp util.Time``` * ```FirstTimestamp util.Time```
* The date/time of the first occurrence of the event. * The date/time of the first occurrence of the event.
...@@ -78,11 +81,13 @@ Each binary that generates events: ...@@ -78,11 +81,13 @@ Each binary that generates events:
* An entry for the event is also added to the previously generated events cache. * An entry for the event is also added to the previously generated events cache.
## Issues/Risks ## Issues/Risks
* Compression is not guaranteed, because each component keeps track of event history in memory * Compression is not guaranteed, because each component keeps track of event history in memory
* An application restart causes event history to be cleared, meaning event history is not preserved across application restarts and compression will not occur across component restarts. * An application restart causes event history to be cleared, meaning event history is not preserved across application restarts and compression will not occur across component restarts.
* Because an LRU cache is used to keep track of previously generated events, if too many unique events are generated, old events will be evicted from the cache, so events will only be compressed until they age out of the events cache, at which point any new instance of the event will cause a new entry to be created in etcd. * Because an LRU cache is used to keep track of previously generated events, if too many unique events are generated, old events will be evicted from the cache, so events will only be compressed until they age out of the events cache, at which point any new instance of the event will cause a new entry to be created in etcd.
## Example ## Example
Sample kubectl output Sample kubectl output
``` ```
...@@ -104,6 +109,7 @@ Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1 ...@@ -104,6 +109,7 @@ Thu, 12 Feb 2015 01:13:20 +0000 Thu, 12 Feb 2015 01:13:20 +0000 1
This demonstrates what would have been 20 separate entries (indicating scheduling failure) collapsed/compressed down to 5 entries. This demonstrates what would have been 20 separate entries (indicating scheduling failure) collapsed/compressed down to 5 entries.
## Related Pull Requests/Issues ## Related Pull Requests/Issues
* Issue [#4073](https://github.com/GoogleCloudPlatform/kubernetes/issues/4073): Compress duplicate events * Issue [#4073](https://github.com/GoogleCloudPlatform/kubernetes/issues/4073): Compress duplicate events
* PR [#4157](https://github.com/GoogleCloudPlatform/kubernetes/issues/4157): Add "Update Event" to Kubernetes API * PR [#4157](https://github.com/GoogleCloudPlatform/kubernetes/issues/4157): Add "Update Event" to Kubernetes API
* PR [#4206](https://github.com/GoogleCloudPlatform/kubernetes/issues/4206): Modify Event struct to allow compressing multiple recurring events in to a single event * PR [#4206](https://github.com/GoogleCloudPlatform/kubernetes/issues/4206): Modify Event struct to allow compressing multiple recurring events in to a single event
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Variable expansion in pod command, args, and env # Variable expansion in pod command, args, and env
## Abstract ## Abstract
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Identifiers and Names in Kubernetes # Identifiers and Names in Kubernetes
A summarization of the goals and recommendations for identifiers in Kubernetes. Described in [GitHub issue #199](https://github.com/GoogleCloudPlatform/kubernetes/issues/199). A summarization of the goals and recommendations for identifiers in Kubernetes. Described in [GitHub issue #199](https://github.com/GoogleCloudPlatform/kubernetes/issues/199).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Namespaces # Namespaces
## Abstract ## Abstract
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Networking # Networking
There are 4 distinct networking problems to solve: There are 4 distinct networking problems to solve:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Persistent Storage # Persistent Storage
This document proposes a model for managing persistent, cluster-scoped storage for applications requiring long lived data. This document proposes a model for managing persistent, cluster-scoped storage for applications requiring long lived data.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Design Principles # Design Principles
Principles to follow when extending Kubernetes. Principles to follow when extending Kubernetes.
......
...@@ -48,6 +48,7 @@ The resource model aims to be: ...@@ -48,6 +48,7 @@ The resource model aims to be:
* precise, to avoid misunderstandings and promote pod portability. * precise, to avoid misunderstandings and promote pod portability.
## The resource model ## The resource model
A Kubernetes _resource_ is something that can be requested by, allocated to, or consumed by a pod or container. Examples include memory (RAM), CPU, disk-time, and network bandwidth. A Kubernetes _resource_ is something that can be requested by, allocated to, or consumed by a pod or container. Examples include memory (RAM), CPU, disk-time, and network bandwidth.
Once resources on a node have been allocated to one pod, they should not be allocated to another until that pod is removed or exits. This means that Kubernetes schedulers should ensure that the sum of the resources allocated (requested and granted) to its pods never exceeds the usable capacity of the node. Testing whether a pod will fit on a node is called _feasibility checking_. Once resources on a node have been allocated to one pod, they should not be allocated to another until that pod is removed or exits. This means that Kubernetes schedulers should ensure that the sum of the resources allocated (requested and granted) to its pods never exceeds the usable capacity of the node. Testing whether a pod will fit on a node is called _feasibility checking_.
...@@ -124,9 +125,11 @@ Where: ...@@ -124,9 +125,11 @@ Where:
## Kubernetes-defined resource types ## Kubernetes-defined resource types
The following resource types are predefined ("reserved") by Kubernetes in the `kubernetes.io` namespace, and so cannot be used for user-defined resources. Note that the syntax of all resource types in the resource spec is deliberately similar, but some resource types (e.g., CPU) may receive significantly more support than simply tracking quantities in the schedulers and/or the Kubelet. The following resource types are predefined ("reserved") by Kubernetes in the `kubernetes.io` namespace, and so cannot be used for user-defined resources. Note that the syntax of all resource types in the resource spec is deliberately similar, but some resource types (e.g., CPU) may receive significantly more support than simply tracking quantities in the schedulers and/or the Kubelet.
### Processor cycles ### Processor cycles
* Name: `cpu` (or `kubernetes.io/cpu`) * Name: `cpu` (or `kubernetes.io/cpu`)
* Units: Kubernetes Compute Unit seconds/second (i.e., CPU cores normalized to a canonical "Kubernetes CPU") * Units: Kubernetes Compute Unit seconds/second (i.e., CPU cores normalized to a canonical "Kubernetes CPU")
* Internal representation: milli-KCUs * Internal representation: milli-KCUs
...@@ -141,6 +144,7 @@ Note that requesting 2 KCU won't guarantee that precisely 2 physical cores will ...@@ -141,6 +144,7 @@ Note that requesting 2 KCU won't guarantee that precisely 2 physical cores will
### Memory ### Memory
* Name: `memory` (or `kubernetes.io/memory`) * Name: `memory` (or `kubernetes.io/memory`)
* Units: bytes * Units: bytes
* Compressible? no (at least initially) * Compressible? no (at least initially)
...@@ -152,6 +156,7 @@ rather than decimal ones: "64MiB" rather than "64MB". ...@@ -152,6 +156,7 @@ rather than decimal ones: "64MiB" rather than "64MB".
## Resource metadata ## Resource metadata
A resource type may have an associated read-only ResourceType structure, that contains metadata about the type. For example: A resource type may have an associated read-only ResourceType structure, that contains metadata about the type. For example:
``` ```
...@@ -222,16 +227,19 @@ and predicted ...@@ -222,16 +227,19 @@ and predicted
## Future resource types ## Future resource types
### _[future] Network bandwidth_ ### _[future] Network bandwidth_
* Name: "network-bandwidth" (or `kubernetes.io/network-bandwidth`) * Name: "network-bandwidth" (or `kubernetes.io/network-bandwidth`)
* Units: bytes per second * Units: bytes per second
* Compressible? yes * Compressible? yes
### _[future] Network operations_ ### _[future] Network operations_
* Name: "network-iops" (or `kubernetes.io/network-iops`) * Name: "network-iops" (or `kubernetes.io/network-iops`)
* Units: operations (messages) per second * Units: operations (messages) per second
* Compressible? yes * Compressible? yes
### _[future] Storage space_ ### _[future] Storage space_
* Name: "storage-space" (or `kubernetes.io/storage-space`) * Name: "storage-space" (or `kubernetes.io/storage-space`)
* Units: bytes * Units: bytes
* Compressible? no * Compressible? no
...@@ -239,6 +247,7 @@ and predicted ...@@ -239,6 +247,7 @@ and predicted
The amount of secondary storage space available to a container. The main target is local disk drives and SSDs, although this could also be used to qualify remotely-mounted volumes. Specifying whether a resource is a raw disk, an SSD, a disk array, or a file system fronting any of these, is left for future work. The amount of secondary storage space available to a container. The main target is local disk drives and SSDs, although this could also be used to qualify remotely-mounted volumes. Specifying whether a resource is a raw disk, an SSD, a disk array, or a file system fronting any of these, is left for future work.
### _[future] Storage time_ ### _[future] Storage time_
* Name: storage-time (or `kubernetes.io/storage-time`) * Name: storage-time (or `kubernetes.io/storage-time`)
* Units: seconds per second of disk time * Units: seconds per second of disk time
* Internal representation: milli-units * Internal representation: milli-units
...@@ -247,6 +256,7 @@ The amount of secondary storage space available to a container. The main target ...@@ -247,6 +256,7 @@ The amount of secondary storage space available to a container. The main target
This is the amount of time a container spends accessing disk, including actuator and transfer time. A standard disk drive provides 1.0 diskTime seconds per second. This is the amount of time a container spends accessing disk, including actuator and transfer time. A standard disk drive provides 1.0 diskTime seconds per second.
### _[future] Storage operations_ ### _[future] Storage operations_
* Name: "storage-iops" (or `kubernetes.io/storage-iops`) * Name: "storage-iops" (or `kubernetes.io/storage-iops`)
* Units: operations per second * Units: operations per second
* Compressible? yes * Compressible? yes
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Security in Kubernetes # Security in Kubernetes
Kubernetes should define a reasonable set of security best practices that allows processes to be isolated from each other, from the cluster infrastructure, and which preserves important boundaries between those who manage the cluster, and those who use the cluster. Kubernetes should define a reasonable set of security best practices that allows processes to be isolated from each other, from the cluster infrastructure, and which preserves important boundaries between those who manage the cluster, and those who use the cluster.
......
...@@ -30,8 +30,11 @@ Documentation for other releases can be found at ...@@ -30,8 +30,11 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Security Contexts # Security Contexts
## Abstract ## Abstract
A security context is a set of constraints that are applied to a container in order to achieve the following goals (from [security design](security.md)): A security context is a set of constraints that are applied to a container in order to achieve the following goals (from [security design](security.md)):
1. Ensure a clear isolation between container and the underlying host it runs on 1. Ensure a clear isolation between container and the underlying host it runs on
...@@ -53,11 +56,13 @@ to the container process. ...@@ -53,11 +56,13 @@ to the container process.
Support for user namespaces has recently been [merged](https://github.com/docker/libcontainer/pull/304) into Docker's libcontainer project and should soon surface in Docker itself. It will make it possible to assign a range of unprivileged uids and gids from the host to each container, improving the isolation between host and container and between containers. Support for user namespaces has recently been [merged](https://github.com/docker/libcontainer/pull/304) into Docker's libcontainer project and should soon surface in Docker itself. It will make it possible to assign a range of unprivileged uids and gids from the host to each container, improving the isolation between host and container and between containers.
### External integration with shared storage ### External integration with shared storage
In order to support external integration with shared storage, processes running in a Kubernetes cluster In order to support external integration with shared storage, processes running in a Kubernetes cluster
should be able to be uniquely identified by their Unix UID, such that a chain of ownership can be established. should be able to be uniquely identified by their Unix UID, such that a chain of ownership can be established.
Processes in pods will need to have consistent UID/GID/SELinux category labels in order to access shared disks. Processes in pods will need to have consistent UID/GID/SELinux category labels in order to access shared disks.
## Constraints and Assumptions ## Constraints and Assumptions
* It is out of the scope of this document to prescribe a specific set * It is out of the scope of this document to prescribe a specific set
of constraints to isolate containers from their host. Different use cases need different of constraints to isolate containers from their host. Different use cases need different
settings. settings.
...@@ -96,6 +101,7 @@ be addressed with security contexts: ...@@ -96,6 +101,7 @@ be addressed with security contexts:
## Proposed Design ## Proposed Design
### Overview ### Overview
A *security context* consists of a set of constraints that determine how a container A *security context* consists of a set of constraints that determine how a container
is secured before getting created and run. A security context resides on the container and represents the runtime parameters that will is secured before getting created and run. A security context resides on the container and represents the runtime parameters that will
be used to create and run the container via container APIs. A *security context provider* is passed to the Kubelet so it can have a chance be used to create and run the container via container APIs. A *security context provider* is passed to the Kubelet so it can have a chance
......
...@@ -30,7 +30,8 @@ Documentation for other releases can be found at ...@@ -30,7 +30,8 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
#Service Accounts
# Service Accounts
## Motivation ## Motivation
...@@ -50,6 +51,7 @@ They also may interact with services other than the Kubernetes API, such as: ...@@ -50,6 +51,7 @@ They also may interact with services other than the Kubernetes API, such as:
- accessing files in an NFS volume attached to the pod - accessing files in an NFS volume attached to the pod
## Design Overview ## Design Overview
A service account binds together several things: A service account binds together several things:
- a *name*, understood by users, and perhaps by peripheral systems, for an identity - a *name*, understood by users, and perhaps by peripheral systems, for an identity
- a *principal* that can be authenticated and [authorized](../admin/authorization.md) - a *principal* that can be authenticated and [authorized](../admin/authorization.md)
...@@ -137,6 +139,7 @@ are added to the map of tokens used by the authentication process in the apiserv ...@@ -137,6 +139,7 @@ are added to the map of tokens used by the authentication process in the apiserv
might have some types that do not do anything on apiserver but just get pushed to the kubelet.) might have some types that do not do anything on apiserver but just get pushed to the kubelet.)
### Pods ### Pods
The `PodSpec` is extended to have a `Pods.Spec.ServiceAccountUsername` field. If this is unset, then a The `PodSpec` is extended to have a `Pods.Spec.ServiceAccountUsername` field. If this is unset, then a
default value is chosen. If it is set, then the corresponding value of `Pods.Spec.SecurityContext` is set by the default value is chosen. If it is set, then the corresponding value of `Pods.Spec.SecurityContext` is set by the
Service Account Finalizer (see below). Service Account Finalizer (see below).
...@@ -144,6 +147,7 @@ Service Account Finalizer (see below). ...@@ -144,6 +147,7 @@ Service Account Finalizer (see below).
TBD: how policy limits which users can make pods with which service accounts. TBD: how policy limits which users can make pods with which service accounts.
### Authorization ### Authorization
Kubernetes API Authorization Policies refer to users. Pods created with a `Pods.Spec.ServiceAccountUsername` typically Kubernetes API Authorization Policies refer to users. Pods created with a `Pods.Spec.ServiceAccountUsername` typically
get a `Secret` which allows them to authenticate to the Kubernetes APIserver as a particular user. So any get a `Secret` which allows them to authenticate to the Kubernetes APIserver as a particular user. So any
policy that is desired can be applied to them. policy that is desired can be applied to them.
......
...@@ -30,12 +30,15 @@ Documentation for other releases can be found at ...@@ -30,12 +30,15 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Simple rolling update ## Simple rolling update
This is a lightweight design document for simple [rolling update](../user-guide/kubectl/kubectl_rolling-update.md) in ```kubectl```. This is a lightweight design document for simple [rolling update](../user-guide/kubectl/kubectl_rolling-update.md) in ```kubectl```.
Complete execution flow can be found [here](#execution-details). See the [example of rolling update](../user-guide/update-demo/) for more information. Complete execution flow can be found [here](#execution-details). See the [example of rolling update](../user-guide/update-demo/) for more information.
### Lightweight rollout ### Lightweight rollout
Assume that we have a current replication controller named ```foo``` and it is running image ```image:v1``` Assume that we have a current replication controller named ```foo``` and it is running image ```image:v1```
```kubectl rolling-update foo [foo-v2] --image=myimage:v2``` ```kubectl rolling-update foo [foo-v2] --image=myimage:v2```
...@@ -51,6 +54,7 @@ and the old 'foo' replication controller is deleted. For the purposes of the ro ...@@ -51,6 +54,7 @@ and the old 'foo' replication controller is deleted. For the purposes of the ro
The value of that label is the hash of the complete JSON representation of the```foo-next``` or```foo``` replication controller. The name of this label can be overridden by the user with the ```--deployment-label-key``` flag. The value of that label is the hash of the complete JSON representation of the```foo-next``` or```foo``` replication controller. The name of this label can be overridden by the user with the ```--deployment-label-key``` flag.
#### Recovery #### Recovery
If a rollout fails or is terminated in the middle, it is important that the user be able to resume the roll out. If a rollout fails or is terminated in the middle, it is important that the user be able to resume the roll out.
To facilitate recovery in the case of a crash of the updating process itself, we add the following annotations to each replication controller in the ```kubernetes.io/``` annotation namespace: To facilitate recovery in the case of a crash of the updating process itself, we add the following annotations to each replication controller in the ```kubernetes.io/``` annotation namespace:
* ```desired-replicas``` The desired number of replicas for this replication controller (either N or zero) * ```desired-replicas``` The desired number of replicas for this replication controller (either N or zero)
...@@ -68,6 +72,7 @@ it is assumed that the rollout is nearly completed, and ```foo-next``` is rename ...@@ -68,6 +72,7 @@ it is assumed that the rollout is nearly completed, and ```foo-next``` is rename
### Aborting a rollout ### Aborting a rollout
Abort is assumed to want to reverse a rollout in progress. Abort is assumed to want to reverse a rollout in progress.
```kubectl rolling-update foo [foo-v2] --rollback``` ```kubectl rolling-update foo [foo-v2] --rollback```
...@@ -87,6 +92,7 @@ If the user doesn't specify a ```foo-next``` name, then it is either discovered ...@@ -87,6 +92,7 @@ If the user doesn't specify a ```foo-next``` name, then it is either discovered
then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash-of-next-controller-JSON>``` then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash-of-next-controller-JSON>```
#### Initialization #### Initialization
* If ```foo``` and ```foo-next``` do not exist: * If ```foo``` and ```foo-next``` do not exist:
* Exit, and indicate an error to the user, that the specified controller doesn't exist. * Exit, and indicate an error to the user, that the specified controller doesn't exist.
* If ```foo``` exists, but ```foo-next``` does not: * If ```foo``` exists, but ```foo-next``` does not:
...@@ -102,6 +108,7 @@ then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash- ...@@ -102,6 +108,7 @@ then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash-
* Goto Rollout * Goto Rollout
#### Rollout #### Rollout
* While size of ```foo-next``` < ```desired-replicas``` annotation on ```foo-next``` * While size of ```foo-next``` < ```desired-replicas``` annotation on ```foo-next```
* increase size of ```foo-next``` * increase size of ```foo-next```
* if size of ```foo``` > 0 * if size of ```foo``` > 0
...@@ -109,11 +116,13 @@ then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash- ...@@ -109,11 +116,13 @@ then ```foo-next``` is synthesized using the pattern ```<controller-name>-<hash-
* Goto Rename * Goto Rename
#### Rename #### Rename
* delete ```foo``` * delete ```foo```
* create ```foo``` that is identical to ```foo-next``` * create ```foo``` that is identical to ```foo-next```
* delete ```foo-next``` * delete ```foo-next```
#### Abort #### Abort
* If ```foo-next``` doesn't exist * If ```foo-next``` doesn't exist
* Exit and indicate to the user that they may want to simply do a new rollout with the old version * Exit and indicate to the user that they may want to simply do a new rollout with the old version
* If ```foo``` doesn't exist * If ```foo``` doesn't exist
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes API and Release Versioning # Kubernetes API and Release Versioning
Legend: Legend:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Developer Guide # Kubernetes Developer Guide
The developer guide is for anyone wanting to either write code which directly accesses the The developer guide is for anyone wanting to either write code which directly accesses the
......
...@@ -455,6 +455,7 @@ The following HTTP status codes may be returned by the API. ...@@ -455,6 +455,7 @@ The following HTTP status codes may be returned by the API.
* Returned in response to HTTP OPTIONS requests. * Returned in response to HTTP OPTIONS requests.
#### Error codes #### Error codes
* `307 StatusTemporaryRedirect` * `307 StatusTemporaryRedirect`
* Indicates that the address for the requested resource has changed. * Indicates that the address for the requested resource has changed.
* Suggested client recovery behavior * Suggested client recovery behavior
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# So you want to change the API? # So you want to change the API?
The Kubernetes API has two major components - the internal structures and The Kubernetes API has two major components - the internal structures and
...@@ -365,6 +366,7 @@ $ hack/update-swagger-spec.sh ...@@ -365,6 +366,7 @@ $ hack/update-swagger-spec.sh
The API spec changes should be in a commit separate from your other changes. The API spec changes should be in a commit separate from your other changes.
## Incompatible API changes ## Incompatible API changes
If your change is going to be backward incompatible or might be a breaking change for API If your change is going to be backward incompatible or might be a breaking change for API
consumers, please send an announcement to `kubernetes-dev@googlegroups.com` before consumers, please send an announcement to `kubernetes-dev@googlegroups.com` before
the change gets in. If you are unsure, ask. Also make sure that the change gets documented in the change gets in. If you are unsure, ask. Also make sure that the change gets documented in
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Overview # Overview
This document explains cherry picks are managed on release branches within the This document explains cherry picks are managed on release branches within the
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes CLI/Configuration Roadmap # Kubernetes CLI/Configuration Roadmap
See also issues with the following labels: See also issues with the following labels:
......
...@@ -30,12 +30,15 @@ Documentation for other releases can be found at ...@@ -30,12 +30,15 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubernetes API client libraries ## kubernetes API client libraries
### Supported ### Supported
* [Go](../../pkg/client/) * [Go](../../pkg/client/)
### User Contributed ### User Contributed
*Note: Libraries provided by outside parties are supported by their authors, not the core Kubernetes team* *Note: Libraries provided by outside parties are supported by their authors, not the core Kubernetes team*
* [Java (OSGI)](https://bitbucket.org/amdatulabs/amdatu-kubernetes) * [Java (OSGI)](https://bitbucket.org/amdatulabs/amdatu-kubernetes)
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# On Collaborative Development # On Collaborative Development
Kubernetes is open source, but many of the people working on it do so as their day job. In order to avoid forcing people to be "at work" effectively 24/7, we want to establish some semi-formal protocols around development. Hopefully these rules make things go more smoothly. If you find that this is not the case, please complain loudly. Kubernetes is open source, but many of the people working on it do so as their day job. In order to avoid forcing people to be "at work" effectively 24/7, we want to establish some semi-formal protocols around development. Hopefully these rules make things go more smoothly. If you find that this is not the case, please complain loudly.
......
...@@ -30,11 +30,13 @@ Documentation for other releases can be found at ...@@ -30,11 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Getting started with Vagrant ## Getting started with Vagrant
Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X). Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X).
### Prerequisites ### Prerequisites
1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html 1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html
2. Install one of: 2. Install one of:
1. The latest version of Virtual Box from https://www.virtualbox.org/wiki/Downloads 1. The latest version of Virtual Box from https://www.virtualbox.org/wiki/Downloads
...@@ -371,6 +373,7 @@ export KUBERNETES_MINION_MEMORY=2048 ...@@ -371,6 +373,7 @@ export KUBERNETES_MINION_MEMORY=2048
``` ```
#### I ran vagrant suspend and nothing works! #### I ran vagrant suspend and nothing works!
```vagrant suspend``` seems to mess up the network. It's not supported at this time. ```vagrant suspend``` seems to mess up the network. It's not supported at this time.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Development Guide # Development Guide
# Releases and Official Builds # Releases and Official Builds
...@@ -45,6 +46,7 @@ Kubernetes is written in [Go](http://golang.org) programming language. If you ha ...@@ -45,6 +46,7 @@ Kubernetes is written in [Go](http://golang.org) programming language. If you ha
Below, we outline one of the more common git workflows that core developers use. Other git workflows are also valid. Below, we outline one of the more common git workflows that core developers use. Other git workflows are also valid.
### Visual overview ### Visual overview
![Git workflow](git_workflow.png) ![Git workflow](git_workflow.png)
### Fork the main repository ### Fork the main repository
...@@ -93,6 +95,7 @@ $ git push -f origin myfeature ...@@ -93,6 +95,7 @@ $ git push -f origin myfeature
``` ```
### Creating a pull request ### Creating a pull request
1. Visit http://github.com/$YOUR_GITHUB_USERNAME/kubernetes 1. Visit http://github.com/$YOUR_GITHUB_USERNAME/kubernetes
2. Click the "Compare and pull request" button next to your "myfeature" branch. 2. Click the "Compare and pull request" button next to your "myfeature" branch.
...@@ -102,6 +105,7 @@ $ git push -f origin myfeature ...@@ -102,6 +105,7 @@ $ git push -f origin myfeature
Kubernetes uses [godep](https://github.com/tools/godep) to manage dependencies. It is not strictly required for building Kubernetes but it is required when managing dependencies under the Godeps/ tree, and is required by a number of the build and test scripts. Please make sure that ``godep`` is installed and in your ``$PATH``. Kubernetes uses [godep](https://github.com/tools/godep) to manage dependencies. It is not strictly required for building Kubernetes but it is required when managing dependencies under the Godeps/ tree, and is required by a number of the build and test scripts. Please make sure that ``godep`` is installed and in your ``$PATH``.
### Installing godep ### Installing godep
There are many ways to build and host go binaries. Here is an easy way to get utilities like ```godep``` installed: There are many ways to build and host go binaries. Here is an easy way to get utilities like ```godep``` installed:
1) Ensure that [mercurial](http://mercurial.selenic.com/wiki/Download) is installed on your system. (some of godep's dependencies use the mercurial 1) Ensure that [mercurial](http://mercurial.selenic.com/wiki/Download) is installed on your system. (some of godep's dependencies use the mercurial
...@@ -124,6 +128,7 @@ export PATH=$PATH:$GOPATH/bin ...@@ -124,6 +128,7 @@ export PATH=$PATH:$GOPATH/bin
``` ```
### Using godep ### Using godep
Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep). Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep).
1) Devote a directory to this endeavor: 1) Devote a directory to this endeavor:
...@@ -259,6 +264,7 @@ go run hack/e2e.go --down ...@@ -259,6 +264,7 @@ go run hack/e2e.go --down
``` ```
### Flag options ### Flag options
See the flag definitions in `hack/e2e.go` for more options, such as reusing an existing cluster, here is an overview: See the flag definitions in `hack/e2e.go` for more options, such as reusing an existing cluster, here is an overview:
```sh ```sh
...@@ -309,6 +315,7 @@ go run hack/e2e.go -v -ctl='delete pod foobar' ...@@ -309,6 +315,7 @@ go run hack/e2e.go -v -ctl='delete pod foobar'
``` ```
## Conformance testing ## Conformance testing
End-to-end testing, as described above, is for [development End-to-end testing, as described above, is for [development
distributions](writing-a-getting-started-guide.md). A conformance test is used on distributions](writing-a-getting-started-guide.md). A conformance test is used on
a [versioned distro](writing-a-getting-started-guide.md). a [versioned distro](writing-a-getting-started-guide.md).
...@@ -320,6 +327,7 @@ intended to run against a cluster at a specific binary release of Kubernetes. ...@@ -320,6 +327,7 @@ intended to run against a cluster at a specific binary release of Kubernetes.
See [conformance-test.sh](../../hack/conformance-test.sh). See [conformance-test.sh](../../hack/conformance-test.sh).
## Testing out flaky tests ## Testing out flaky tests
[Instructions here](flaky-tests.md) [Instructions here](flaky-tests.md)
## Regenerating the CLI documentation ## Regenerating the CLI documentation
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# How to get faster PR reviews # How to get faster PR reviews
Most of what is written here is not at all specific to Kubernetes, but it bears Most of what is written here is not at all specific to Kubernetes, but it bears
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Hunting flaky tests in Kubernetes # Hunting flaky tests in Kubernetes
Sometimes unit tests are flaky. This means that due to (usually) race conditions, they will occasionally fail, even though most of the time they pass. Sometimes unit tests are flaky. This means that due to (usually) race conditions, they will occasionally fail, even though most of the time they pass.
We have a goal of 99.9% flake free tests. This means that there is only one flake in one thousand runs of a test. We have a goal of 99.9% flake free tests. This means that there is only one flake in one thousand runs of a test.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Getting Kubernetes Builds # Getting Kubernetes Builds
You can use [hack/get-build.sh](../../hack/get-build.sh) to or use as a reference on how to get the most recent builds with curl. With `get-build.sh` you can grab the most recent stable build, the most recent release candidate, or the most recent build to pass our ci and gce e2e tests (essentially a nightly build). You can use [hack/get-build.sh](../../hack/get-build.sh) to or use as a reference on how to get the most recent builds with curl. With `get-build.sh` you can grab the most recent stable build, the most recent release candidate, or the most recent build to pass our ci and gce e2e tests (essentially a nightly build).
......
...@@ -30,10 +30,13 @@ Documentation for other releases can be found at ...@@ -30,10 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Making release notes ## Making release notes
This documents the process for making release notes for a release. This documents the process for making release notes for a release.
### 1) Note the PR number of the previous release ### 1) Note the PR number of the previous release
Find the most-recent PR that was merged with the previous .0 release. Remember this as $LASTPR. Find the most-recent PR that was merged with the previous .0 release. Remember this as $LASTPR.
_TODO_: Figure out a way to record this somewhere to save the next release engineer time. _TODO_: Figure out a way to record this somewhere to save the next release engineer time.
...@@ -46,6 +49,7 @@ ${KUBERNETES_ROOT}/build/make-release-notes.sh $LASTPR $CURRENTPR ...@@ -46,6 +49,7 @@ ${KUBERNETES_ROOT}/build/make-release-notes.sh $LASTPR $CURRENTPR
``` ```
### 3) Trim the release notes ### 3) Trim the release notes
This generates a list of the entire set of PRs merged since the last minor This generates a list of the entire set of PRs merged since the last minor
release. It is likely long and many PRs aren't worth mentioning. If any of the release. It is likely long and many PRs aren't worth mentioning. If any of the
PRs were cherrypicked into patches on the last minor release, you should exclude PRs were cherrypicked into patches on the last minor release, you should exclude
...@@ -57,9 +61,11 @@ Remove, regroup, organize to your hearts content. ...@@ -57,9 +61,11 @@ Remove, regroup, organize to your hearts content.
### 4) Update CHANGELOG.md ### 4) Update CHANGELOG.md
With the final markdown all set, cut and paste it to the top of ```CHANGELOG.md``` With the final markdown all set, cut and paste it to the top of ```CHANGELOG.md```
### 5) Update the Release page ### 5) Update the Release page
* Switch to the [releases](https://github.com/GoogleCloudPlatform/kubernetes/releases) page. * Switch to the [releases](https://github.com/GoogleCloudPlatform/kubernetes/releases) page.
* Open up the release you are working on. * Open up the release you are working on.
* Cut and paste the final markdown from above into the release notes * Cut and paste the final markdown from above into the release notes
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Profiling Kubernetes # Profiling Kubernetes
This document explain how to plug in profiler and how to profile Kubernetes services. This document explain how to plug in profiler and how to profile Kubernetes services.
...@@ -53,6 +54,7 @@ to the init(c *Config) method in 'pkg/master/master.go' and import 'net/http/ppr ...@@ -53,6 +54,7 @@ to the init(c *Config) method in 'pkg/master/master.go' and import 'net/http/ppr
In most use cases to use profiler service it's enough to do 'import _ net/http/pprof', which automatically registers a handler in the default http.Server. Slight inconvenience is that APIserver uses default server for intra-cluster communication, so plugging profiler to it is not really useful. In 'pkg/master/server/server.go' more servers are created and started as separate goroutines. The one that is usually serving external traffic is secureServer. The handler for this traffic is defined in 'pkg/master/master.go' and stored in Handler variable. It is created from HTTP multiplexer, so the only thing that needs to be done is adding profiler handler functions to this multiplexer. This is exactly what lines after TL;DR do. In most use cases to use profiler service it's enough to do 'import _ net/http/pprof', which automatically registers a handler in the default http.Server. Slight inconvenience is that APIserver uses default server for intra-cluster communication, so plugging profiler to it is not really useful. In 'pkg/master/server/server.go' more servers are created and started as separate goroutines. The one that is usually serving external traffic is secureServer. The handler for this traffic is defined in 'pkg/master/master.go' and stored in Handler variable. It is created from HTTP multiplexer, so the only thing that needs to be done is adding profiler handler functions to this multiplexer. This is exactly what lines after TL;DR do.
## Connecting to the profiler ## Connecting to the profiler
Even when running profiler I found not really straightforward to use 'go tool pprof' with it. The problem is that at least for dev purposes certificates generated for APIserver are not signed by anyone trusted and because secureServer serves only secure traffic it isn't straightforward to connect to the service. The best workaround I found is by creating an ssh tunnel from the kubernetes_master open unsecured port to some external server, and use this server as a proxy. To save everyone looking for correct ssh flags, it is done by running: Even when running profiler I found not really straightforward to use 'go tool pprof' with it. The problem is that at least for dev purposes certificates generated for APIserver are not signed by anyone trusted and because secureServer serves only secure traffic it isn't straightforward to connect to the service. The best workaround I found is by creating an ssh tunnel from the kubernetes_master open unsecured port to some external server, and use this server as a proxy. To save everyone looking for correct ssh flags, it is done by running:
``` ```
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Releasing Kubernetes # Releasing Kubernetes
This document explains how to cut a release, and the theory behind it. If you This document explains how to cut a release, and the theory behind it. If you
...@@ -87,6 +88,7 @@ Where `v0.20.2-322-g974377b` is the git hash you decided on. This will become ...@@ -87,6 +88,7 @@ Where `v0.20.2-322-g974377b` is the git hash you decided on. This will become
our (retroactive) branch point. our (retroactive) branch point.
#### Branching, Tagging and Merging #### Branching, Tagging and Merging
Do the following: Do the following:
1. `export VER=x.y` (e.g. `0.20` for v0.20) 1. `export VER=x.y` (e.g. `0.20` for v0.20)
......
...@@ -30,11 +30,13 @@ Documentation for other releases can be found at ...@@ -30,11 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Scheduler Algorithm in Kubernetes # Scheduler Algorithm in Kubernetes
For each unscheduled Pod, the Kubernetes scheduler tries to find a node across the cluster according to a set of rules. A general introduction to the Kubernetes scheduler can be found at [scheduler.md](scheduler.md). In this document, the algorithm of how to select a node for the Pod is explained. There are two steps before a destination node of a Pod is chosen. The first step is filtering all the nodes and the second is ranking the remaining nodes to find a best fit for the Pod. For each unscheduled Pod, the Kubernetes scheduler tries to find a node across the cluster according to a set of rules. A general introduction to the Kubernetes scheduler can be found at [scheduler.md](scheduler.md). In this document, the algorithm of how to select a node for the Pod is explained. There are two steps before a destination node of a Pod is chosen. The first step is filtering all the nodes and the second is ranking the remaining nodes to find a best fit for the Pod.
## Filtering the nodes ## Filtering the nodes
The purpose of filtering the nodes is to filter out the nodes that do not meet certain requirements of the Pod. For example, if the free resource on a node (measured by the capacity minus the sum of the resource limits of all the Pods that already run on the node) is less than the Pod's required resource, the node should not be considered in the ranking phase so it is filtered out. Currently, there are several "predicates" implementing different filtering policies, including: The purpose of filtering the nodes is to filter out the nodes that do not meet certain requirements of the Pod. For example, if the free resource on a node (measured by the capacity minus the sum of the resource limits of all the Pods that already run on the node) is less than the Pod's required resource, the node should not be considered in the ranking phase so it is filtered out. Currently, there are several "predicates" implementing different filtering policies, including:
- `NoDiskConflict`: Evaluate if a pod can fit due to the volumes it requests, and those that are already mounted. - `NoDiskConflict`: Evaluate if a pod can fit due to the volumes it requests, and those that are already mounted.
......
...@@ -32,6 +32,7 @@ Documentation for other releases can be found at ...@@ -32,6 +32,7 @@ Documentation for other releases can be found at
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Writing a Getting Started Guide # Writing a Getting Started Guide
This page gives some advice for anyone planning to write or update a Getting Started Guide for Kubernetes. This page gives some advice for anyone planning to write or update a Getting Started Guide for Kubernetes.
It also gives some guidelines which reviewers should follow when reviewing a pull request for a It also gives some guidelines which reviewers should follow when reviewing a pull request for a
guide. guide.
...@@ -57,6 +58,7 @@ Distros fall into two categories: ...@@ -57,6 +58,7 @@ Distros fall into two categories:
There are different guidelines for each. There are different guidelines for each.
## Versioned Distro Guidelines ## Versioned Distro Guidelines
These guidelines say *what* to do. See the Rationale section for *why*. These guidelines say *what* to do. See the Rationale section for *why*.
- Send us a PR. - Send us a PR.
- Put the instructions in `docs/getting-started-guides/...`. Scripts go there too. This helps devs easily - Put the instructions in `docs/getting-started-guides/...`. Scripts go there too. This helps devs easily
...@@ -77,6 +79,7 @@ we still want to hear from you. We suggest you write a blog post or a Gist, and ...@@ -77,6 +79,7 @@ we still want to hear from you. We suggest you write a blog post or a Gist, and
Just file an issue or chat us on IRC and one of the committers will link to it from the wiki. Just file an issue or chat us on IRC and one of the committers will link to it from the wiki.
## Development Distro Guidelines ## Development Distro Guidelines
These guidelines say *what* to do. See the Rationale section for *why*. These guidelines say *what* to do. See the Rationale section for *why*.
- the main reason to add a new development distro is to support a new IaaS provider (VM and - the main reason to add a new development distro is to support a new IaaS provider (VM and
network management). This means implementing a new `pkg/cloudprovider/$IAAS_NAME`. network management). This means implementing a new `pkg/cloudprovider/$IAAS_NAME`.
...@@ -93,6 +96,7 @@ These guidelines say *what* to do. See the Rationale section for *why*. ...@@ -93,6 +96,7 @@ These guidelines say *what* to do. See the Rationale section for *why*.
refactoring and feature additions that affect code for their IaaS. refactoring and feature additions that affect code for their IaaS.
## Rationale ## Rationale
- We want people to create Kubernetes clusters with whatever IaaS, Node OS, - We want people to create Kubernetes clusters with whatever IaaS, Node OS,
configuration management tools, and so on, which they are familiar with. The configuration management tools, and so on, which they are familiar with. The
guidelines for **versioned distros** are designed for flexibility. guidelines for **versioned distros** are designed for flexibility.
......
...@@ -55,6 +55,7 @@ they vary from step-by-step instructions to general advice for setting up ...@@ -55,6 +55,7 @@ they vary from step-by-step instructions to general advice for setting up
a kubernetes cluster from scratch. a kubernetes cluster from scratch.
### Local-machine Solutions ### Local-machine Solutions
Local-machine solutions create a single cluster with one or more kubernetes nodes on a single Local-machine solutions create a single cluster with one or more kubernetes nodes on a single
physical machine. Setup is completely automated and doesn't require a cloud provider account. physical machine. Setup is completely automated and doesn't require a cloud provider account.
But their size and availability is limited to that of a single machine. But their size and availability is limited to that of a single machine.
...@@ -66,10 +67,12 @@ The local-machine solutions are: ...@@ -66,10 +67,12 @@ The local-machine solutions are:
### Hosted Solutions ### Hosted Solutions
[Google Container Engine](https://cloud.google.com/container-engine) offers managed Kubernetes [Google Container Engine](https://cloud.google.com/container-engine) offers managed Kubernetes
clusters. clusters.
### Turn-key Cloud Solutions ### Turn-key Cloud Solutions
These solutions allow you to create Kubernetes clusters on range of Cloud IaaS providers with only a These solutions allow you to create Kubernetes clusters on range of Cloud IaaS providers with only a
few commands, and have active community support. few commands, and have active community support.
- [GCE](gce.md) - [GCE](gce.md)
...@@ -90,6 +93,7 @@ If you are interested in supporting Kubernetes on a new platform, check out our ...@@ -90,6 +93,7 @@ If you are interested in supporting Kubernetes on a new platform, check out our
writing a new solution](../../docs/devel/writing-a-getting-started-guide.md). writing a new solution](../../docs/devel/writing-a-getting-started-guide.md).
#### Cloud #### Cloud
These solutions are combinations of cloud provider and OS not covered by the above solutions. These solutions are combinations of cloud provider and OS not covered by the above solutions.
- [AWS + coreos](coreos.md) - [AWS + coreos](coreos.md)
- [GCE + CoreOS](coreos.md) - [GCE + CoreOS](coreos.md)
...@@ -98,6 +102,7 @@ These solutions are combinations of cloud provider and OS not covered by the abo ...@@ -98,6 +102,7 @@ These solutions are combinations of cloud provider and OS not covered by the abo
- [Rackspace + CoreOS](rackspace.md) - [Rackspace + CoreOS](rackspace.md)
#### On-Premises VMs #### On-Premises VMs
- [Vagrant](coreos.md) (uses CoreOS and flannel) - [Vagrant](coreos.md) (uses CoreOS and flannel)
- [CloudStack](cloudstack.md) (uses Ansible, CoreOS and flannel) - [CloudStack](cloudstack.md) (uses Ansible, CoreOS and flannel)
- [Vmware](vsphere.md) (uses Debian) - [Vmware](vsphere.md) (uses Debian)
...@@ -109,6 +114,7 @@ These solutions are combinations of cloud provider and OS not covered by the abo ...@@ -109,6 +114,7 @@ These solutions are combinations of cloud provider and OS not covered by the abo
- [KVM](fedora/flannel_multi_node_cluster.md) (uses Fedora and flannel) - [KVM](fedora/flannel_multi_node_cluster.md) (uses Fedora and flannel)
#### Bare Metal #### Bare Metal
- [Offline](coreos/bare_metal_offline.md) (no internet required. Uses CoreOS and Flannel) - [Offline](coreos/bare_metal_offline.md) (no internet required. Uses CoreOS and Flannel)
- [fedora/fedora_ansible_config.md](fedora/fedora_ansible_config.md) - [fedora/fedora_ansible_config.md](fedora/fedora_ansible_config.md)
- [Fedora single node](fedora/fedora_manual_config.md) - [Fedora single node](fedora/fedora_manual_config.md)
...@@ -118,9 +124,11 @@ These solutions are combinations of cloud provider and OS not covered by the abo ...@@ -118,9 +124,11 @@ These solutions are combinations of cloud provider and OS not covered by the abo
- [Docker Multi Node](docker-multinode.md) - [Docker Multi Node](docker-multinode.md)
#### Integrations #### Integrations
- [Kubernetes on Mesos](mesos.md) (Uses GCE) - [Kubernetes on Mesos](mesos.md) (Uses GCE)
## Table of Solutions ## Table of Solutions
Here are all the solutions mentioned above in table form. Here are all the solutions mentioned above in table form.
IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Getting started on Amazon EC2 with CoreOS # Getting started on Amazon EC2 with CoreOS
The example below creates an elastic Kubernetes cluster with a custom number of worker nodes and a master. The example below creates an elastic Kubernetes cluster with a custom number of worker nodes and a master.
......
...@@ -52,6 +52,7 @@ Getting started on AWS EC2 ...@@ -52,6 +52,7 @@ Getting started on AWS EC2
3. You need an AWS [instance profile and role](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) with EC2 full access. 3. You need an AWS [instance profile and role](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) with EC2 full access.
## Cluster turnup ## Cluster turnup
### Supported procedure: `get-kube` ### Supported procedure: `get-kube`
```bash ```bash
...@@ -89,11 +90,14 @@ If these already exist, make sure you want them to be used here. ...@@ -89,11 +90,14 @@ If these already exist, make sure you want them to be used here.
NOTE: If using an existing keypair named "kubernetes" then you must set the `AWS_SSH_KEY` key to point to your private key. NOTE: If using an existing keypair named "kubernetes" then you must set the `AWS_SSH_KEY` key to point to your private key.
### Alternatives ### Alternatives
A contributed [example](aws-coreos.md) allows you to setup a Kubernetes cluster based on [CoreOS](http://www.coreos.com), either using A contributed [example](aws-coreos.md) allows you to setup a Kubernetes cluster based on [CoreOS](http://www.coreos.com), either using
AWS CloudFormation or EC2 with user data (cloud-config). AWS CloudFormation or EC2 with user data (cloud-config).
## Getting started with your cluster ## Getting started with your cluster
### Command line administration tool: `kubectl` ### Command line administration tool: `kubectl`
The cluster startup script will leave you with a ```kubernetes``` directory on your workstation. The cluster startup script will leave you with a ```kubernetes``` directory on your workstation.
Alternately, you can download the latest Kubernetes release from [this page](https://github.com/GoogleCloudPlatform/kubernetes/releases). Alternately, you can download the latest Kubernetes release from [this page](https://github.com/GoogleCloudPlatform/kubernetes/releases).
...@@ -113,6 +117,7 @@ By default, `kubectl` will use the `kubeconfig` file generated during the cluste ...@@ -113,6 +117,7 @@ By default, `kubectl` will use the `kubeconfig` file generated during the cluste
For more information, please read [kubeconfig files](../../docs/user-guide/kubeconfig-file.md) For more information, please read [kubeconfig files](../../docs/user-guide/kubeconfig-file.md)
### Examples ### Examples
See [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try out your new cluster. See [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try out your new cluster.
The "Guestbook" application is another popular example to get started with Kubernetes: [guestbook example](../../examples/guestbook/) The "Guestbook" application is another popular example to get started with Kubernetes: [guestbook example](../../examples/guestbook/)
...@@ -120,6 +125,7 @@ The "Guestbook" application is another popular example to get started with Kuber ...@@ -120,6 +125,7 @@ The "Guestbook" application is another popular example to get started with Kuber
For more complete applications, please look in the [examples directory](../../examples/) For more complete applications, please look in the [examples directory](../../examples/)
## Tearing down the cluster ## Tearing down the cluster
Make sure the environment variables you used to provision your cluster are still exported, then call the following script inside the Make sure the environment variables you used to provision your cluster are still exported, then call the following script inside the
`kubernetes` directory: `kubernetes` directory:
...@@ -128,6 +134,7 @@ cluster/kube-down.sh ...@@ -128,6 +134,7 @@ cluster/kube-down.sh
``` ```
## Further reading ## Further reading
Please see the [Kubernetes docs](../../docs/) for more details on administering Please see the [Kubernetes docs](../../docs/) for more details on administering
and using a Kubernetes cluster. and using a Kubernetes cluster.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Install and configure kubectl # Install and configure kubectl
## Download the kubectl CLI tool ## Download the kubectl CLI tool
......
...@@ -58,7 +58,9 @@ installed](https://docs.docker.com/installation/). On Mac OS X you can use ...@@ -58,7 +58,9 @@ installed](https://docs.docker.com/installation/). On Mac OS X you can use
[boot2docker](http://boot2docker.io/). [boot2docker](http://boot2docker.io/).
## Setup ## Setup
###Starting a cluster
### Starting a cluster
The cluster setup scripts can setup Kubernetes for multiple targets. First modify `cluster/kube-env.sh` to specify azure: The cluster setup scripts can setup Kubernetes for multiple targets. First modify `cluster/kube-env.sh` to specify azure:
KUBERNETES_PROVIDER="azure" KUBERNETES_PROVIDER="azure"
...@@ -83,6 +85,7 @@ The script above will start (by default) a single master VM along with 4 worker ...@@ -83,6 +85,7 @@ The script above will start (by default) a single master VM along with 4 worker
can tweak some of these parameters by editing `cluster/azure/config-default.sh`. can tweak some of these parameters by editing `cluster/azure/config-default.sh`.
### Adding the kubernetes command line tools to PATH ### Adding the kubernetes command line tools to PATH
The [kubectl](../../docs/user-guide/kubectl/kubectl.md) tool controls the Kubernetes cluster manager. It lets you inspect your cluster resources, create, delete, and update components, and much more. The [kubectl](../../docs/user-guide/kubectl/kubectl.md) tool controls the Kubernetes cluster manager. It lets you inspect your cluster resources, create, delete, and update components, and much more.
You will use it to look at your new cluster and bring up example apps. You will use it to look at your new cluster and bring up example apps.
...@@ -95,6 +98,7 @@ Add the appropriate binary folder to your ```PATH``` to access kubectl: ...@@ -95,6 +98,7 @@ Add the appropriate binary folder to your ```PATH``` to access kubectl:
export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH
## Getting started with your cluster ## Getting started with your cluster
See [a simple nginx example](../user-guide/simple-nginx.md) to try out your new cluster. See [a simple nginx example](../user-guide/simple-nginx.md) to try out your new cluster.
For more complete applications, please look in the [examples directory](../../examples/). For more complete applications, please look in the [examples directory](../../examples/).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Getting a Binary Release ## Getting a Binary Release
You can either build a release from sources or download a pre-built release. If you do not plan on developing Kubernetes itself, we suggest a pre-built release. You can either build a release from sources or download a pre-built release. If you do not plan on developing Kubernetes itself, we suggest a pre-built release.
......
...@@ -37,10 +37,13 @@ Getting started on [CentOS](http://centos.org) ...@@ -37,10 +37,13 @@ Getting started on [CentOS](http://centos.org)
- [Prerequisites](#prerequisites) - [Prerequisites](#prerequisites)
- [Starting a cluster](#starting-a-cluster) - [Starting a cluster](#starting-a-cluster)
## Prerequisites ## Prerequisites
You need two machines with CentOS installed on them. You need two machines with CentOS installed on them.
## Starting a cluster ## Starting a cluster
This is a getting started guide for CentOS. It is a manual configuration so you understand all the underlying packages / services / ports, etc... This is a getting started guide for CentOS. It is a manual configuration so you understand all the underlying packages / services / ports, etc...
This guide will only get ONE node working. Multiple nodes requires a functional [networking configuration](../../admin/networking.md) done outside of kubernetes. Although the additional kubernetes configuration requirements should be obvious. This guide will only get ONE node working. Multiple nodes requires a functional [networking configuration](../../admin/networking.md) done outside of kubernetes. Although the additional kubernetes configuration requirements should be obvious.
......
...@@ -52,7 +52,7 @@ This is a completely automated, a single playbook deploys Kubernetes based on th ...@@ -52,7 +52,7 @@ This is a completely automated, a single playbook deploys Kubernetes based on th
This [Ansible](http://ansibleworks.com) playbook deploys Kubernetes on a CloudStack based Cloud using CoreOS images. The playbook, creates an ssh key pair, creates a security group and associated rules and finally starts coreOS instances configured via cloud-init. This [Ansible](http://ansibleworks.com) playbook deploys Kubernetes on a CloudStack based Cloud using CoreOS images. The playbook, creates an ssh key pair, creates a security group and associated rules and finally starts coreOS instances configured via cloud-init.
###Prerequisites ### Prerequisites
$ sudo apt-get install -y python-pip $ sudo apt-get install -y python-pip
$ sudo pip install ansible $ sudo pip install ansible
...@@ -74,14 +74,14 @@ Or create a `~/.cloudstack.ini` file: ...@@ -74,14 +74,14 @@ Or create a `~/.cloudstack.ini` file:
We need to use the http POST method to pass the _large_ userdata to the coreOS instances. We need to use the http POST method to pass the _large_ userdata to the coreOS instances.
###Clone the playbook ### Clone the playbook
$ git clone --recursive https://github.com/runseb/ansible-kubernetes.git $ git clone --recursive https://github.com/runseb/ansible-kubernetes.git
$ cd ansible-kubernetes $ cd ansible-kubernetes
The [ansible-cloudstack](https://github.com/resmo/ansible-cloudstack) module is setup in this repository as a submodule, hence the `--recursive`. The [ansible-cloudstack](https://github.com/resmo/ansible-cloudstack) module is setup in this repository as a submodule, hence the `--recursive`.
###Create a Kubernetes cluster ### Create a Kubernetes cluster
You simply need to run the playbook. You simply need to run the playbook.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Getting started on [CoreOS](http://coreos.com) ## Getting started on [CoreOS](http://coreos.com)
There are multiple guides on running Kubernetes with [CoreOS](http://coreos.com): There are multiple guides on running Kubernetes with [CoreOS](http://coreos.com):
......
...@@ -49,6 +49,7 @@ Kubernetes on Azure with CoreOS and [Weave](http://weave.works) ...@@ -49,6 +49,7 @@ Kubernetes on Azure with CoreOS and [Weave](http://weave.works)
In this guide I will demonstrate how to deploy a Kubernetes cluster to Azure cloud. You will be using CoreOS with Weave, which implements simple and secure networking, in a transparent, yet robust way. The purpose of this guide is to provide an out-of-the-box implementation that can ultimately be taken into production with little change. It will demonstrate how to provision a dedicated Kubernetes master and etcd nodes, and show how to scale the cluster with ease. In this guide I will demonstrate how to deploy a Kubernetes cluster to Azure cloud. You will be using CoreOS with Weave, which implements simple and secure networking, in a transparent, yet robust way. The purpose of this guide is to provide an out-of-the-box implementation that can ultimately be taken into production with little change. It will demonstrate how to provision a dedicated Kubernetes master and etcd nodes, and show how to scale the cluster with ease.
### Prerequisites ### Prerequisites
1. You need an Azure account. 1. You need an Azure account.
## Let's go! ## Let's go!
......
...@@ -53,10 +53,12 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to ...@@ -53,10 +53,12 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to
## Prerequisites ## Prerequisites
1. Installed *CentOS 6* for PXE server 1. Installed *CentOS 6* for PXE server
2. At least two bare metal nodes to work with 2. At least two bare metal nodes to work with
## High Level Design ## High Level Design
1. Manage the tftp directory 1. Manage the tftp directory
* /tftpboot/(coreos)(centos)(RHEL) * /tftpboot/(coreos)(centos)(RHEL)
* /tftpboot/pxelinux.0/(MAC) -> linked to Linux image config file * /tftpboot/pxelinux.0/(MAC) -> linked to Linux image config file
...@@ -67,6 +69,7 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to ...@@ -67,6 +69,7 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to
6. Installing the CoreOS slaves to become Kubernetes nodes. 6. Installing the CoreOS slaves to become Kubernetes nodes.
## This Guides variables ## This Guides variables
| Node Description | MAC | IP | | Node Description | MAC | IP |
| :---------------------------- | :---------------: | :---------: | | :---------------------------- | :---------------: | :---------: |
| CoreOS/etcd/Kubernetes Master | d0:00:67:13:0d:00 | 10.20.30.40 | | CoreOS/etcd/Kubernetes Master | d0:00:67:13:0d:00 | 10.20.30.40 |
...@@ -75,6 +78,7 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to ...@@ -75,6 +78,7 @@ Deploy a CoreOS running Kubernetes environment. This particular guild is made to
## Setup PXELINUX CentOS ## Setup PXELINUX CentOS
To setup CentOS PXELINUX environment there is a complete [guide here](http://docs.fedoraproject.org/en-US/Fedora/7/html/Installation_Guide/ap-pxe-server.html). This section is the abbreviated version. To setup CentOS PXELINUX environment there is a complete [guide here](http://docs.fedoraproject.org/en-US/Fedora/7/html/Installation_Guide/ap-pxe-server.html). This section is the abbreviated version.
1. Install packages needed on CentOS 1. Install packages needed on CentOS
...@@ -121,6 +125,7 @@ To setup CentOS PXELINUX environment there is a complete [guide here](http://doc ...@@ -121,6 +125,7 @@ To setup CentOS PXELINUX environment there is a complete [guide here](http://doc
Now you should have a working PXELINUX setup to image CoreOS nodes. You can verify the services by using VirtualBox locally or with bare metal servers. Now you should have a working PXELINUX setup to image CoreOS nodes. You can verify the services by using VirtualBox locally or with bare metal servers.
## Adding CoreOS to PXE ## Adding CoreOS to PXE
This section describes how to setup the CoreOS images to live alongside a pre-existing PXELINUX environment. This section describes how to setup the CoreOS images to live alongside a pre-existing PXELINUX environment.
1. Find or create the TFTP root directory that everything will be based off of. 1. Find or create the TFTP root directory that everything will be based off of.
...@@ -168,6 +173,7 @@ This section describes how to setup the CoreOS images to live alongside a pre-ex ...@@ -168,6 +173,7 @@ This section describes how to setup the CoreOS images to live alongside a pre-ex
This configuration file will now boot from local drive but have the option to PXE image CoreOS. This configuration file will now boot from local drive but have the option to PXE image CoreOS.
## DHCP configuration ## DHCP configuration
This section covers configuring the DHCP server to hand out our new images. In this case we are assuming that there are other servers that will boot alongside other images. This section covers configuring the DHCP server to hand out our new images. In this case we are assuming that there are other servers that will boot alongside other images.
1. Add the ```filename``` to the _host_ or _subnet_ sections. 1. Add the ```filename``` to the _host_ or _subnet_ sections.
...@@ -210,6 +216,7 @@ This section covers configuring the DHCP server to hand out our new images. In t ...@@ -210,6 +216,7 @@ This section covers configuring the DHCP server to hand out our new images. In t
We will be specifying the node configuration later in the guide. We will be specifying the node configuration later in the guide.
## Kubernetes ## Kubernetes
To deploy our configuration we need to create an ```etcd``` master. To do so we want to pxe CoreOS with a specific cloud-config.yml. There are two options we have here. To deploy our configuration we need to create an ```etcd``` master. To do so we want to pxe CoreOS with a specific cloud-config.yml. There are two options we have here.
1. Is to template the cloud config file and programmatically create new static configs for different cluster setups. 1. Is to template the cloud config file and programmatically create new static configs for different cluster setups.
2. Have a service discovery protocol running in our stack to do auto discovery. 2. Have a service discovery protocol running in our stack to do auto discovery.
...@@ -243,6 +250,7 @@ This sets up our binaries we need to run Kubernetes. This would need to be enhan ...@@ -243,6 +250,7 @@ This sets up our binaries we need to run Kubernetes. This would need to be enhan
Now for the good stuff! Now for the good stuff!
## Cloud Configs ## Cloud Configs
The following config files are tailored for the OFFLINE version of a Kubernetes deployment. The following config files are tailored for the OFFLINE version of a Kubernetes deployment.
These are based on the work found here: [master.yml](cloud-configs/master.yaml), [node.yml](cloud-configs/node.yaml) These are based on the work found here: [master.yml](cloud-configs/master.yaml), [node.yml](cloud-configs/node.yaml)
...@@ -256,6 +264,7 @@ To make the setup work, you need to replace a few placeholders: ...@@ -256,6 +264,7 @@ To make the setup work, you need to replace a few placeholders:
- Add your own SSH public key(s) to the cloud config at the end - Add your own SSH public key(s) to the cloud config at the end
### master.yml ### master.yml
On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-cloud-config-master.yml```. On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-cloud-config-master.yml```.
...@@ -476,6 +485,7 @@ On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe- ...@@ -476,6 +485,7 @@ On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-
### node.yml ### node.yml
On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-cloud-config-slave.yml```. On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-cloud-config-slave.yml```.
#cloud-config #cloud-config
...@@ -610,6 +620,7 @@ On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe- ...@@ -610,6 +620,7 @@ On the PXE server make and fill in the variables ```vi /var/www/html/coreos/pxe-
## New pxelinux.cfg file ## New pxelinux.cfg file
Create a pxelinux target file for a _slave_ node: ```vi /tftpboot/pxelinux.cfg/coreos-node-slave``` Create a pxelinux target file for a _slave_ node: ```vi /tftpboot/pxelinux.cfg/coreos-node-slave```
default coreos default coreos
...@@ -637,6 +648,7 @@ And one for the _master_ node: ```vi /tftpboot/pxelinux.cfg/coreos-node-master`` ...@@ -637,6 +648,7 @@ And one for the _master_ node: ```vi /tftpboot/pxelinux.cfg/coreos-node-master``
append initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http://<pxe-host-ip>/coreos/pxe-cloud-config-master.yml console=tty0 console=ttyS0 coreos.autologin=tty1 coreos.autologin=ttyS0 append initrd=images/coreos/coreos_production_pxe_image.cpio.gz cloud-config-url=http://<pxe-host-ip>/coreos/pxe-cloud-config-master.yml console=tty0 console=ttyS0 coreos.autologin=tty1 coreos.autologin=ttyS0
## Specify the pxelinux targets ## Specify the pxelinux targets
Now that we have our new targets setup for master and slave we want to configure the specific hosts to those targets. We will do this by using the pxelinux mechanism of setting a specific MAC addresses to a specific pxelinux.cfg file. Now that we have our new targets setup for master and slave we want to configure the specific hosts to those targets. We will do this by using the pxelinux mechanism of setting a specific MAC addresses to a specific pxelinux.cfg file.
Refer to the MAC address table in the beginning of this guide. Documentation for more details can be found [here](http://www.syslinux.org/wiki/index.php/PXELINUX). Refer to the MAC address table in the beginning of this guide. Documentation for more details can be found [here](http://www.syslinux.org/wiki/index.php/PXELINUX).
...@@ -650,6 +662,7 @@ Refer to the MAC address table in the beginning of this guide. Documentation for ...@@ -650,6 +662,7 @@ Refer to the MAC address table in the beginning of this guide. Documentation for
Reboot these servers to get the images PXEd and ready for running containers! Reboot these servers to get the images PXEd and ready for running containers!
## Creating test pod ## Creating test pod
Now that the CoreOS with Kubernetes installed is up and running lets spin up some Kubernetes pods to demonstrate the system. Now that the CoreOS with Kubernetes installed is up and running lets spin up some Kubernetes pods to demonstrate the system.
See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster. See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# CoreOS Multinode Cluster # CoreOS Multinode Cluster
Use the [master.yaml](cloud-configs/master.yaml) and [node.yaml](cloud-configs/node.yaml) cloud-configs to provision a multi-node Kubernetes cluster. Use the [master.yaml](cloud-configs/master.yaml) and [node.yaml](cloud-configs/node.yaml) cloud-configs to provision a multi-node Kubernetes cluster.
......
...@@ -51,9 +51,11 @@ Please install Docker 1.6.2 or wait for Docker 1.7.1. ...@@ -51,9 +51,11 @@ Please install Docker 1.6.2 or wait for Docker 1.7.1.
- [Testing your cluster](#testing-your-cluster) - [Testing your cluster](#testing-your-cluster)
## Prerequisites ## Prerequisites
1. You need a machine with docker installed. 1. You need a machine with docker installed.
## Overview ## Overview
This guide will set up a 2-node kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work This guide will set up a 2-node kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work
and a _worker_ node which receives work from the master. You can repeat the process of adding worker nodes an arbitrary number of and a _worker_ node which receives work from the master. You can repeat the process of adding worker nodes an arbitrary number of
times to create larger clusters. times to create larger clusters.
...@@ -62,6 +64,7 @@ Here's a diagram of what the final result will look like: ...@@ -62,6 +64,7 @@ Here's a diagram of what the final result will look like:
![Kubernetes Single Node on Docker](k8s-docker.png) ![Kubernetes Single Node on Docker](k8s-docker.png)
### Bootstrap Docker ### Bootstrap Docker
This guide also uses a pattern of running two instances of the Docker daemon This guide also uses a pattern of running two instances of the Docker daemon
1) A _bootstrap_ Docker instance which is used to start system daemons like ```flanneld``` and ```etcd``` 1) A _bootstrap_ Docker instance which is used to start system daemons like ```flanneld``` and ```etcd```
2) A _main_ Docker instance which is used for the Kubernetes infrastructure and user's scheduled containers 2) A _main_ Docker instance which is used for the Kubernetes infrastructure and user's scheduled containers
...@@ -71,6 +74,7 @@ all of the Docker containers created by Kubernetes. To achieve this, it must ru ...@@ -71,6 +74,7 @@ all of the Docker containers created by Kubernetes. To achieve this, it must ru
it is still useful to use containers for deployment and management, so we create a simpler _bootstrap_ daemon to achieve this. it is still useful to use containers for deployment and management, so we create a simpler _bootstrap_ daemon to achieve this.
## Master Node ## Master Node
The first step in the process is to initialize the master node. The first step in the process is to initialize the master node.
See [here](docker-multinode/master.md) for detailed instructions. See [here](docker-multinode/master.md) for detailed instructions.
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Installing a Kubernetes Master Node via Docker ## Installing a Kubernetes Master Node via Docker
We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine is ```${MASTER_IP}``` We'll begin by setting up the master node. For the purposes of illustration, we'll assume that the IP of this machine is ```${MASTER_IP}```
There are two main phases to installing the master: There are two main phases to installing the master:
...@@ -45,6 +47,7 @@ There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 ...@@ -45,6 +47,7 @@ There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0
Please install Docker 1.6.2 or wait for Docker 1.7.1. Please install Docker 1.6.2 or wait for Docker 1.7.1.
### Setup Docker-Bootstrap ### Setup Docker-Bootstrap
We're going to use ```flannel``` to set up networking between Docker daemons. Flannel itself (and etcd on which it relies) will run inside of We're going to use ```flannel``` to set up networking between Docker daemons. Flannel itself (and etcd on which it relies) will run inside of
Docker containers themselves. To achieve this, we need a separate "bootstrap" instance of the Docker daemon. This daemon will be started with Docker containers themselves. To achieve this, we need a separate "bootstrap" instance of the Docker daemon. This daemon will be started with
```--iptables=false``` so that it can only run containers with ```--net=host```. That's sufficient to bootstrap our system. ```--iptables=false``` so that it can only run containers with ```--net=host```. That's sufficient to bootstrap our system.
...@@ -61,6 +64,7 @@ across reboots and failures. ...@@ -61,6 +64,7 @@ across reboots and failures.
### Startup etcd for flannel and the API server to use ### Startup etcd for flannel and the API server to use
Run: Run:
``` ```
...@@ -75,11 +79,13 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/googl ...@@ -75,11 +79,13 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock run --net=host gcr.io/googl
### Set up Flannel on the master node ### Set up Flannel on the master node
Flannel is a network abstraction layer build by CoreOS, we will use it to provide simplified networking between our Pods of containers. Flannel is a network abstraction layer build by CoreOS, we will use it to provide simplified networking between our Pods of containers.
Flannel re-configures the bridge that Docker uses for networking. As a result we need to stop Docker, reconfigure its networking, and then restart Docker. Flannel re-configures the bridge that Docker uses for networking. As a result we need to stop Docker, reconfigure its networking, and then restart Docker.
#### Bring down Docker #### Bring down Docker
To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker. To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker.
Turning down Docker is system dependent, it may be: Turning down Docker is system dependent, it may be:
...@@ -113,6 +119,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock exec <really-long-hash-from ...@@ -113,6 +119,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock exec <really-long-hash-from
``` ```
#### Edit the docker configuration #### Edit the docker configuration
You now need to edit the docker configuration to activate new flags. Again, this is system specific. You now need to edit the docker configuration to activate new flags. Again, this is system specific.
This may be in ```/etc/default/docker``` or ```/etc/systemd/service/docker.service``` or it may be elsewhere. This may be in ```/etc/default/docker``` or ```/etc/systemd/service/docker.service``` or it may be elsewhere.
...@@ -124,6 +131,7 @@ Regardless, you need to add the following to the docker command line: ...@@ -124,6 +131,7 @@ Regardless, you need to add the following to the docker command line:
``` ```
#### Remove the existing Docker bridge #### Remove the existing Docker bridge
Docker creates a bridge named ```docker0``` by default. You need to remove this: Docker creates a bridge named ```docker0``` by default. You need to remove this:
```sh ```sh
...@@ -134,6 +142,7 @@ sudo brctl delbr docker0 ...@@ -134,6 +142,7 @@ sudo brctl delbr docker0
You may need to install the ```bridge-utils``` package for the ```brctl``` binary. You may need to install the ```bridge-utils``` package for the ```brctl``` binary.
#### Restart Docker #### Restart Docker
Again this is system dependent, it may be: Again this is system dependent, it may be:
```sh ```sh
...@@ -147,6 +156,7 @@ systemctl start docker ...@@ -147,6 +156,7 @@ systemctl start docker
``` ```
## Starting the Kubernetes Master ## Starting the Kubernetes Master
Ok, now that your networking is set up, you can startup Kubernetes, this is the same as the single-node case, we will use the "main" instance of the Docker daemon for the Kubernetes components. Ok, now that your networking is set up, you can startup Kubernetes, this is the same as the single-node case, we will use the "main" instance of the Docker daemon for the Kubernetes components.
```sh ```sh
...@@ -160,6 +170,7 @@ sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0 ...@@ -160,6 +170,7 @@ sudo docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0
``` ```
### Test it out ### Test it out
At this point, you should have a functioning 1-node cluster. Let's test it out! At this point, you should have a functioning 1-node cluster. Let's test it out!
Download the kubectl binary Download the kubectl binary
...@@ -184,6 +195,7 @@ If all else fails, ask questions on IRC at [#google-containers](http://webchat.f ...@@ -184,6 +195,7 @@ If all else fails, ask questions on IRC at [#google-containers](http://webchat.f
### Next steps ### Next steps
Move on to [adding one or more workers](worker.md) Move on to [adding one or more workers](worker.md)
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Testing your Kubernetes cluster. ## Testing your Kubernetes cluster.
To validate that your node(s) have been added, run: To validate that your node(s) have been added, run:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Adding a Kubernetes worker node via Docker. ## Adding a Kubernetes worker node via Docker.
...@@ -44,6 +45,7 @@ For each worker node, there are three steps: ...@@ -44,6 +45,7 @@ For each worker node, there are three steps:
* [Add the worker to the cluster](#add-the-node-to-the-cluster) * [Add the worker to the cluster](#add-the-node-to-the-cluster)
### Set up Flanneld on the worker node ### Set up Flanneld on the worker node
As before, the Flannel daemon is going to provide network connectivity. As before, the Flannel daemon is going to provide network connectivity.
_Note_: _Note_:
...@@ -52,6 +54,7 @@ Please install Docker 1.6.2 or wait for Docker 1.7.1. ...@@ -52,6 +54,7 @@ Please install Docker 1.6.2 or wait for Docker 1.7.1.
#### Set up a bootstrap docker #### Set up a bootstrap docker
As previously, we need a second instance of the Docker daemon running to bootstrap the flannel networking. As previously, we need a second instance of the Docker daemon running to bootstrap the flannel networking.
Run: Run:
...@@ -65,6 +68,7 @@ If you are running this on a long running system, rather than experimenting, you ...@@ -65,6 +68,7 @@ If you are running this on a long running system, rather than experimenting, you
across reboots and failures. across reboots and failures.
#### Bring down Docker #### Bring down Docker
To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker. To re-configure Docker to use flannel, we need to take docker down, run flannel and then restart Docker.
Turning down Docker is system dependent, it may be: Turning down Docker is system dependent, it may be:
...@@ -99,6 +103,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock exec <really-long-hash-from ...@@ -99,6 +103,7 @@ sudo docker -H unix:///var/run/docker-bootstrap.sock exec <really-long-hash-from
#### Edit the docker configuration #### Edit the docker configuration
You now need to edit the docker configuration to activate new flags. Again, this is system specific. You now need to edit the docker configuration to activate new flags. Again, this is system specific.
This may be in ```/etc/default/docker``` or ```/etc/systemd/service/docker.service``` or it may be elsewhere. This may be in ```/etc/default/docker``` or ```/etc/systemd/service/docker.service``` or it may be elsewhere.
...@@ -110,6 +115,7 @@ Regardless, you need to add the following to the docker command line: ...@@ -110,6 +115,7 @@ Regardless, you need to add the following to the docker command line:
``` ```
#### Remove the existing Docker bridge #### Remove the existing Docker bridge
Docker creates a bridge named ```docker0``` by default. You need to remove this: Docker creates a bridge named ```docker0``` by default. You need to remove this:
```sh ```sh
...@@ -120,6 +126,7 @@ sudo brctl delbr docker0 ...@@ -120,6 +126,7 @@ sudo brctl delbr docker0
You may need to install the ```bridge-utils``` package for the ```brctl``` binary. You may need to install the ```bridge-utils``` package for the ```brctl``` binary.
#### Restart Docker #### Restart Docker
Again this is system dependent, it may be: Again this is system dependent, it may be:
```sh ```sh
...@@ -133,7 +140,9 @@ systemctl start docker ...@@ -133,7 +140,9 @@ systemctl start docker
``` ```
### Start Kubernetes on the worker node ### Start Kubernetes on the worker node
#### Run the kubelet #### Run the kubelet
Again this is similar to the above, but the ```--api_servers``` now points to the master we set up in the beginning. Again this is similar to the above, but the ```--api_servers``` now points to the master we set up in the beginning.
```sh ```sh
...@@ -141,6 +150,7 @@ sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr. ...@@ -141,6 +150,7 @@ sudo docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.
``` ```
#### Run the service proxy #### Run the service proxy
The service proxy provides load-balancing between groups of containers defined by Kubernetes ```Services``` The service proxy provides load-balancing between groups of containers defined by Kubernetes ```Services```
```sh ```sh
......
...@@ -53,6 +53,7 @@ Here's a diagram of what the final result will look like: ...@@ -53,6 +53,7 @@ Here's a diagram of what the final result will look like:
![Kubernetes Single Node on Docker](k8s-singlenode-docker.png) ![Kubernetes Single Node on Docker](k8s-singlenode-docker.png)
### Prerequisites ### Prerequisites
1. You need to have docker installed on one machine. 1. You need to have docker installed on one machine.
### Step One: Run etcd ### Step One: Run etcd
...@@ -70,6 +71,7 @@ docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/go ...@@ -70,6 +71,7 @@ docker run --net=host -d -v /var/run/docker.sock:/var/run/docker.sock gcr.io/go
This actually runs the kubelet, which in turn runs a [pod](../user-guide/pods.md) that contains the other master components. This actually runs the kubelet, which in turn runs a [pod](../user-guide/pods.md) that contains the other master components.
### Step Three: Run the service proxy ### Step Three: Run the service proxy
*Note, this could be combined with master above, but it requires --privileged for iptables manipulation* *Note, this could be combined with master above, but it requires --privileged for iptables manipulation*
```sh ```sh
...@@ -77,6 +79,7 @@ docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.21.2 ...@@ -77,6 +79,7 @@ docker run -d --net=host --privileged gcr.io/google_containers/hyperkube:v0.21.2
``` ```
### Test it out ### Test it out
At this point you should have a running kubernetes cluster. You can test this by downloading the kubectl At this point you should have a running kubernetes cluster. You can test this by downloading the kubectl
binary binary
([OS X](https://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/darwin/amd64/kubectl)) ([OS X](https://storage.googleapis.com/kubernetes-release/release/v0.18.2/bin/darwin/amd64/kubectl))
...@@ -134,6 +137,7 @@ curl <insert-ip-from-above-here> ...@@ -134,6 +137,7 @@ curl <insert-ip-from-above-here>
Note that you will need run this curl command on your boot2docker VM if you are running on OS X. Note that you will need run this curl command on your boot2docker VM if you are running on OS X.
### A note on turning down your cluster ### A note on turning down your cluster
Many of these containers run under the management of the ```kubelet``` binary, which attempts to keep containers running, even if they fail. So, in order to turn down Many of these containers run under the management of the ```kubelet``` binary, which attempts to keep containers running, even if they fail. So, in order to turn down
the cluster, you need to first kill the kubelet container, and then any other containers. the cluster, you need to first kill the kubelet container, and then any other containers.
......
...@@ -44,7 +44,7 @@ Configuring kubernetes on Fedora via Ansible offers a simple way to quickly crea ...@@ -44,7 +44,7 @@ Configuring kubernetes on Fedora via Ansible offers a simple way to quickly crea
- [Setting up the cluster](#setting-up-the-cluster) - [Setting up the cluster](#setting-up-the-cluster)
- [Testing and using your new cluster](#testing-and-using-your-new-cluster) - [Testing and using your new cluster](#testing-and-using-your-new-cluster)
##Prerequisites ## Prerequisites
1. Host able to run ansible and able to clone the following repo: [kubernetes-ansible](https://github.com/eparis/kubernetes-ansible) 1. Host able to run ansible and able to clone the following repo: [kubernetes-ansible](https://github.com/eparis/kubernetes-ansible)
2. A Fedora 20+ or RHEL7 host to act as cluster master 2. A Fedora 20+ or RHEL7 host to act as cluster master
......
...@@ -39,6 +39,7 @@ Getting started on [Fedora](http://fedoraproject.org) ...@@ -39,6 +39,7 @@ Getting started on [Fedora](http://fedoraproject.org)
- [Instructions](#instructions) - [Instructions](#instructions)
## Prerequisites ## Prerequisites
1. You need 2 or more machines with Fedora installed. 1. You need 2 or more machines with Fedora installed.
## Instructions ## Instructions
......
...@@ -46,6 +46,7 @@ Kubernetes multiple nodes cluster with flannel on Fedora ...@@ -46,6 +46,7 @@ Kubernetes multiple nodes cluster with flannel on Fedora
This document describes how to deploy kubernetes on multiple hosts to set up a multi-node cluster and networking with flannel. Follow fedora [getting started guide](fedora_manual_config.md) to setup 1 master (fed-master) and 2 or more nodes. Make sure that all nodes have different names (fed-node1, fed-node2 and so on) and labels (fed-node1-label, fed-node2-label, and so on) to avoid any conflict. Also make sure that the kubernetes master host is running etcd, kube-controller-manager, kube-scheduler, and kube-apiserver services, and the nodes are running docker, kube-proxy and kubelet services. Now install flannel on kubernetes nodes. flannel on each node configures an overlay network that docker uses. flannel runs on each node to setup a unique class-C container network. This document describes how to deploy kubernetes on multiple hosts to set up a multi-node cluster and networking with flannel. Follow fedora [getting started guide](fedora_manual_config.md) to setup 1 master (fed-master) and 2 or more nodes. Make sure that all nodes have different names (fed-node1, fed-node2 and so on) and labels (fed-node1-label, fed-node2-label, and so on) to avoid any conflict. Also make sure that the kubernetes master host is running etcd, kube-controller-manager, kube-scheduler, and kube-apiserver services, and the nodes are running docker, kube-proxy and kubelet services. Now install flannel on kubernetes nodes. flannel on each node configures an overlay network that docker uses. flannel runs on each node to setup a unique class-C container network.
## Prerequisites ## Prerequisites
1. You need 2 or more machines with Fedora installed. 1. You need 2 or more machines with Fedora installed.
## Master Setup ## Master Setup
...@@ -124,7 +125,7 @@ FLANNEL_OPTIONS="" ...@@ -124,7 +125,7 @@ FLANNEL_OPTIONS=""
*** ***
##**Test the cluster and flannel configuration** ## **Test the cluster and flannel configuration**
* Now check the interfaces on the nodes. Notice there is now a flannel.1 interface, and the ip addresses of docker0 and flannel.1 interfaces are in the same network. You will notice that docker0 is assigned a subnet (18.16.29.0/24 as shown below) on each kubernetes node out of the IP range configured above. A working output should look like this: * Now check the interfaces on the nodes. Notice there is now a flannel.1 interface, and the ip addresses of docker0 and flannel.1 interfaces are in the same network. You will notice that docker0 is assigned a subnet (18.16.29.0/24 as shown below) on each kubernetes node out of the IP range configured above. A working output should look like this:
......
...@@ -188,6 +188,7 @@ Then, see [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try ...@@ -188,6 +188,7 @@ Then, see [a simple nginx example](../../docs/user-guide/simple-nginx.md) to try
For more complete applications, please look in the [examples directory](../../examples/). The [guestbook example](../../examples/guestbook/) is a good "getting started" walkthrough. For more complete applications, please look in the [examples directory](../../examples/). The [guestbook example](../../examples/guestbook/) is a good "getting started" walkthrough.
### Tearing down the cluster ### Tearing down the cluster
To remove/delete/teardown the cluster, use the `kube-down.sh` script. To remove/delete/teardown the cluster, use the `kube-down.sh` script.
```bash ```bash
......
...@@ -160,6 +160,7 @@ hack/local-up-cluster.sh ...@@ -160,6 +160,7 @@ hack/local-up-cluster.sh
One or more of the kubernetes daemons might've crashed. Tail the logs of each in /tmp. One or more of the kubernetes daemons might've crashed. Tail the logs of each in /tmp.
#### The pods fail to connect to the services by host names #### The pods fail to connect to the services by host names
The local-up-cluster.sh script doesn't start a DNS service. Similar situation can be found [here](https://github.com/GoogleCloudPlatform/kubernetes/issues/6667). You can start a manually. Related documents can be found [here](../../cluster/addons/dns/#how-do-i-configure-it) The local-up-cluster.sh script doesn't start a DNS service. Similar situation can be found [here](https://github.com/GoogleCloudPlatform/kubernetes/issues/6667). You can start a manually. Related documents can be found [here](../../cluster/addons/dns/#how-do-i-configure-it)
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Cluster Level Logging with Elasticsearch and Kibana # Cluster Level Logging with Elasticsearch and Kibana
On the Google Compute Engine (GCE) platform the default cluster level logging support targets On the Google Compute Engine (GCE) platform the default cluster level logging support targets
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Cluster Level Logging to Google Cloud Logging # Cluster Level Logging to Google Cloud Logging
A Kubernetes cluster will typically be humming along running many system and application pods. How does the system administrator collect, manage and query the logs of the system pods? How does a user query the logs of their application which is composed of many pods which may be restarted or automatically generated by the Kubernetes system? These questions are addressed by the Kubernetes **cluster level logging** services. A Kubernetes cluster will typically be humming along running many system and application pods. How does the system administrator collect, manage and query the logs of the system pods? How does a user query the logs of their application which is composed of many pods which may be restarted or automatically generated by the Kubernetes system? These questions are addressed by the Kubernetes **cluster level logging** services.
......
...@@ -46,6 +46,7 @@ Getting started with Kubernetes on Mesos ...@@ -46,6 +46,7 @@ Getting started with Kubernetes on Mesos
- [Test Guestbook App](#test-guestbook-app) - [Test Guestbook App](#test-guestbook-app)
## About Kubernetes on Mesos ## About Kubernetes on Mesos
<!-- TODO: Update, clean up. --> <!-- TODO: Update, clean up. -->
Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [Hadoop][1], [Spark][2], and [Chronos][3]. Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [Hadoop][1], [Spark][2], and [Chronos][3].
...@@ -97,6 +98,7 @@ $ export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888 ...@@ -97,6 +98,7 @@ $ export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888
``` ```
### Deploy etcd ### Deploy etcd
Start etcd and verify that it is running: Start etcd and verify that it is running:
```bash ```bash
...@@ -118,6 +120,7 @@ curl -L http://${KUBERNETES_MASTER_IP}:4001/v2/keys/ ...@@ -118,6 +120,7 @@ curl -L http://${KUBERNETES_MASTER_IP}:4001/v2/keys/
If connectivity is OK, you will see an output of the available keys in etcd (if any). If connectivity is OK, you will see an output of the available keys in etcd (if any).
### Start Kubernetes-Mesos Services ### Start Kubernetes-Mesos Services
Update your PATH to more easily run the Kubernetes-Mesos binaries: Update your PATH to more easily run the Kubernetes-Mesos binaries:
```bash ```bash
...@@ -176,6 +179,7 @@ $ disown -a ...@@ -176,6 +179,7 @@ $ disown -a
``` ```
#### Validate KM Services #### Validate KM Services
Add the appropriate binary folder to your ```PATH``` to access kubectl: Add the appropriate binary folder to your ```PATH``` to access kubectl:
```bash ```bash
......
...@@ -58,23 +58,26 @@ The current cluster design is inspired by: ...@@ -58,23 +58,26 @@ The current cluster design is inspired by:
- [Angus Lees](https://github.com/anguslees/kube-openstack) - [Angus Lees](https://github.com/anguslees/kube-openstack)
## Prerequisites ## Prerequisites
1. Python2.7 1. Python2.7
2. You need to have both `nova` and `swiftly` installed. It's recommended to use a python virtualenv to install these packages into. 2. You need to have both `nova` and `swiftly` installed. It's recommended to use a python virtualenv to install these packages into.
3. Make sure you have the appropriate environment variables set to interact with the OpenStack APIs. See [Rackspace Documentation](http://docs.rackspace.com/servers/api/v2/cs-gettingstarted/content/section_gs_install_nova.html) for more details. 3. Make sure you have the appropriate environment variables set to interact with the OpenStack APIs. See [Rackspace Documentation](http://docs.rackspace.com/servers/api/v2/cs-gettingstarted/content/section_gs_install_nova.html) for more details.
##Provider: Rackspace ## Provider: Rackspace
- To build your own released version from source use `export KUBERNETES_PROVIDER=rackspace` and run the `bash hack/dev-build-and-up.sh` - To build your own released version from source use `export KUBERNETES_PROVIDER=rackspace` and run the `bash hack/dev-build-and-up.sh`
- Note: The get.k8s.io install method is not working yet for our scripts. - Note: The get.k8s.io install method is not working yet for our scripts.
* To install the latest released version of kubernetes use `export KUBERNETES_PROVIDER=rackspace; wget -q -O - https://get.k8s.io | bash` * To install the latest released version of kubernetes use `export KUBERNETES_PROVIDER=rackspace; wget -q -O - https://get.k8s.io | bash`
## Build ## Build
1. The kubernetes binaries will be built via the common build scripts in `build/`. 1. The kubernetes binaries will be built via the common build scripts in `build/`.
2. If you've set the ENV `KUBERNETES_PROVIDER=rackspace`, the scripts will upload `kubernetes-server-linux-amd64.tar.gz` to Cloud Files. 2. If you've set the ENV `KUBERNETES_PROVIDER=rackspace`, the scripts will upload `kubernetes-server-linux-amd64.tar.gz` to Cloud Files.
2. A cloud files container will be created via the `swiftly` CLI and a temp URL will be enabled on the object. 2. A cloud files container will be created via the `swiftly` CLI and a temp URL will be enabled on the object.
3. The built `kubernetes-server-linux-amd64.tar.gz` will be uploaded to this container and the URL will be passed to master/nodes when booted. 3. The built `kubernetes-server-linux-amd64.tar.gz` will be uploaded to this container and the URL will be passed to master/nodes when booted.
## Cluster ## Cluster
There is a specific `cluster/rackspace` directory with the scripts for the following steps: There is a specific `cluster/rackspace` directory with the scripts for the following steps:
1. A cloud network will be created and all instances will be attached to this network. 1. A cloud network will be created and all instances will be attached to this network.
- flanneld uses this network for next hop routing. These routes allow the containers running on each node to communicate with one another on this private network. - flanneld uses this network for next hop routing. These routes allow the containers running on each node to communicate with one another on this private network.
...@@ -83,6 +86,7 @@ There is a specific `cluster/rackspace` directory with the scripts for the follo ...@@ -83,6 +86,7 @@ There is a specific `cluster/rackspace` directory with the scripts for the follo
4. We then boot as many nodes as defined via `$NUM_MINIONS`. 4. We then boot as many nodes as defined via `$NUM_MINIONS`.
## Some notes ## Some notes
- The scripts expect `eth2` to be the cloud network that the containers will communicate across. - The scripts expect `eth2` to be the cloud network that the containers will communicate across.
- A number of the items in `config-default.sh` are overridable via environment variables. - A number of the items in `config-default.sh` are overridable via environment variables.
- For older versions please either: - For older versions please either:
...@@ -92,6 +96,7 @@ There is a specific `cluster/rackspace` directory with the scripts for the follo ...@@ -92,6 +96,7 @@ There is a specific `cluster/rackspace` directory with the scripts for the follo
* Download a [snapshot of `v0.3`](https://github.com/GoogleCloudPlatform/kubernetes/archive/v0.3.tar.gz) * Download a [snapshot of `v0.3`](https://github.com/GoogleCloudPlatform/kubernetes/archive/v0.3.tar.gz)
## Network Design ## Network Design
- eth0 - Public Interface used for servers/containers to reach the internet - eth0 - Public Interface used for servers/containers to reach the internet
- eth1 - ServiceNet - Intra-cluster communication (k8s, etcd, etc) communicate via this interface. The `cloud-config` files use the special CoreOS identifier `$private_ipv4` to configure the services. - eth1 - ServiceNet - Intra-cluster communication (k8s, etcd, etc) communicate via this interface. The `cloud-config` files use the special CoreOS identifier `$private_ipv4` to configure the services.
- eth2 - Cloud Network - Used for k8s pods to communicate with one another. The proxy service will pass traffic via this interface. - eth2 - Cloud Network - Used for k8s pods to communicate with one another. The proxy service will pass traffic via this interface.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Run Kubernetes with rkt # Run Kubernetes with rkt
This document describes how to run Kubernetes using [rkt](https://github.com/coreos/rkt) as a container runtime. This document describes how to run Kubernetes using [rkt](https://github.com/coreos/rkt) as a container runtime.
...@@ -127,6 +128,7 @@ Note: CoreOS is not supported as the master using the automated launch ...@@ -127,6 +128,7 @@ Note: CoreOS is not supported as the master using the automated launch
scripts. The master node is always Ubuntu. scripts. The master node is always Ubuntu.
### Getting started with your cluster ### Getting started with your cluster
See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster. See [a simple nginx example](../../../docs/user-guide/simple-nginx.md) to try out your new cluster.
For more complete applications, please look in the [examples directory](../../../examples/). For more complete applications, please look in the [examples directory](../../../examples/).
......
...@@ -72,6 +72,7 @@ steps that existing cluster setup scripts are making. ...@@ -72,6 +72,7 @@ steps that existing cluster setup scripts are making.
## Designing and Preparing ## Designing and Preparing
### Learning ### Learning
1. You should be familiar with using Kubernetes already. We suggest you set 1. You should be familiar with using Kubernetes already. We suggest you set
up a temporary cluster by following one of the other Getting Started Guides. up a temporary cluster by following one of the other Getting Started Guides.
This will help you become familiar with the CLI ([kubectl](../user-guide/kubectl/kubectl.md)) and concepts ([pods](../user-guide/pods.md), [services](../user-guide/services.md), etc.) first. This will help you become familiar with the CLI ([kubectl](../user-guide/kubectl/kubectl.md)) and concepts ([pods](../user-guide/pods.md), [services](../user-guide/services.md), etc.) first.
...@@ -79,6 +80,7 @@ steps that existing cluster setup scripts are making. ...@@ -79,6 +80,7 @@ steps that existing cluster setup scripts are making.
effect of completing one of the other Getting Started Guides. effect of completing one of the other Getting Started Guides.
### Cloud Provider ### Cloud Provider
Kubernetes has the concept of a Cloud Provider, which is a module which provides Kubernetes has the concept of a Cloud Provider, which is a module which provides
an interface for managing TCP Load Balancers, Nodes (Instances) and Networking Routes. an interface for managing TCP Load Balancers, Nodes (Instances) and Networking Routes.
The interface is defined in `pkg/cloudprovider/cloud.go`. It is possible to The interface is defined in `pkg/cloudprovider/cloud.go`. It is possible to
...@@ -87,6 +89,7 @@ bare-metal), and not all parts of the interface need to be implemented, dependin ...@@ -87,6 +89,7 @@ bare-metal), and not all parts of the interface need to be implemented, dependin
on how flags are set on various components. on how flags are set on various components.
### Nodes ### Nodes
- You can use virtual or physical machines. - You can use virtual or physical machines.
- While you can build a cluster with 1 machine, in order to run all the examples and tests you - While you can build a cluster with 1 machine, in order to run all the examples and tests you
need at least 4 nodes. need at least 4 nodes.
...@@ -100,6 +103,7 @@ on how flags are set on various components. ...@@ -100,6 +103,7 @@ on how flags are set on various components.
have identical configurations. have identical configurations.
### Network ### Network
Kubernetes has a distinctive [networking model](../admin/networking.md). Kubernetes has a distinctive [networking model](../admin/networking.md).
Kubernetes allocates an IP address to each pod. When creating a cluster, you Kubernetes allocates an IP address to each pod. When creating a cluster, you
...@@ -167,6 +171,7 @@ region of the world, etc. ...@@ -167,6 +171,7 @@ region of the world, etc.
need to distinguish which resources each created. Call this `CLUSTERNAME`. need to distinguish which resources each created. Call this `CLUSTERNAME`.
### Software Binaries ### Software Binaries
You will need binaries for: You will need binaries for:
- etcd - etcd
- A container runner, one of: - A container runner, one of:
...@@ -180,6 +185,7 @@ You will need binaries for: ...@@ -180,6 +185,7 @@ You will need binaries for:
- kube-scheduler - kube-scheduler
#### Downloading and Extracting Kubernetes Binaries #### Downloading and Extracting Kubernetes Binaries
A Kubernetes binary release includes all the Kubernetes binaries as well as the supported release of etcd. A Kubernetes binary release includes all the Kubernetes binaries as well as the supported release of etcd.
You can use a Kubernetes binary release (recommended) or build your Kubernetes binaries following the instructions in the You can use a Kubernetes binary release (recommended) or build your Kubernetes binaries following the instructions in the
[Developer Documentation](../devel/README.md). Only using a binary release is covered in this guide. [Developer Documentation](../devel/README.md). Only using a binary release is covered in this guide.
...@@ -190,6 +196,7 @@ Then, within the second set of unzipped files, locate `./kubernetes/server/bin`, ...@@ -190,6 +196,7 @@ Then, within the second set of unzipped files, locate `./kubernetes/server/bin`,
all the necessary binaries. all the necessary binaries.
#### Selecting Images #### Selecting Images
You will run docker, kubelet, and kube-proxy outside of a container, the same way you would run any system daemon, so You will run docker, kubelet, and kube-proxy outside of a container, the same way you would run any system daemon, so
you just need the bare binaries. For etcd, kube-apiserver, kube-controller-manager, and kube-scheduler, you just need the bare binaries. For etcd, kube-apiserver, kube-controller-manager, and kube-scheduler,
we recommend that you run these as containers, so you need an image to be built. we recommend that you run these as containers, so you need an image to be built.
...@@ -238,6 +245,7 @@ There are two main options for security: ...@@ -238,6 +245,7 @@ There are two main options for security:
If following the HTTPS approach, you will need to prepare certs and credentials. If following the HTTPS approach, you will need to prepare certs and credentials.
#### Preparing Certs #### Preparing Certs
You need to prepare several certs: You need to prepare several certs:
- The master needs a cert to act as an HTTPS server. - The master needs a cert to act as an HTTPS server.
- The kubelets optionally need certs to identify themselves as clients of the master, and when - The kubelets optionally need certs to identify themselves as clients of the master, and when
...@@ -262,6 +270,7 @@ You will end up with the following files (we will use these variables later on) ...@@ -262,6 +270,7 @@ You will end up with the following files (we will use these variables later on)
- optional - optional
#### Preparing Credentials #### Preparing Credentials
The admin user (and any users) need: The admin user (and any users) need:
- a token or a password to identify them. - a token or a password to identify them.
- tokens are just long alphanumeric strings, e.g. 32 chars. See - tokens are just long alphanumeric strings, e.g. 32 chars. See
...@@ -339,6 +348,7 @@ Started Guide. After getting a cluster running, you can then copy the init.d s ...@@ -339,6 +348,7 @@ Started Guide. After getting a cluster running, you can then copy the init.d s
cluster, and then modify them for use on your custom cluster. cluster, and then modify them for use on your custom cluster.
### Docker ### Docker
The minimum required Docker version will vary as the kubelet version changes. The newest stable release is a good choice. Kubelet will log a warning and refuse to start pods if the version is too old, so pick a version and try it. The minimum required Docker version will vary as the kubelet version changes. The newest stable release is a good choice. Kubelet will log a warning and refuse to start pods if the version is too old, so pick a version and try it.
If you previously had Docker installed on a node without setting Kubernetes-specific If you previously had Docker installed on a node without setting Kubernetes-specific
...@@ -422,6 +432,7 @@ Arguments to consider: ...@@ -422,6 +432,7 @@ Arguments to consider:
- `--api-servers=http://$MASTER_IP` - `--api-servers=http://$MASTER_IP`
### Networking ### Networking
Each node needs to be allocated its own CIDR range for pod networking. Each node needs to be allocated its own CIDR range for pod networking.
Call this `NODE_X_POD_CIDR`. Call this `NODE_X_POD_CIDR`.
...@@ -462,6 +473,7 @@ any masquerading at all. Others, such as GCE, will not allow pod IPs to send ...@@ -462,6 +473,7 @@ any masquerading at all. Others, such as GCE, will not allow pod IPs to send
traffic to the internet, but have no problem with them inside your GCE Project. traffic to the internet, but have no problem with them inside your GCE Project.
### Other ### Other
- Enable auto-upgrades for your OS package manager, if desired. - Enable auto-upgrades for your OS package manager, if desired.
- Configure log rotation for all node components (e.g. using [logrotate](http://linux.die.net/man/8/logrotate)). - Configure log rotation for all node components (e.g. using [logrotate](http://linux.die.net/man/8/logrotate)).
- Setup liveness-monitoring (e.g. using [monit](http://linux.die.net/man/1/monit)). - Setup liveness-monitoring (e.g. using [monit](http://linux.die.net/man/1/monit)).
...@@ -470,6 +482,7 @@ traffic to the internet, but have no problem with them inside your GCE Project. ...@@ -470,6 +482,7 @@ traffic to the internet, but have no problem with them inside your GCE Project.
volumes. volumes.
### Using Configuration Management ### Using Configuration Management
The previous steps all involved "conventional" system administration techniques for setting up The previous steps all involved "conventional" system administration techniques for setting up
machines. You may want to use a Configuration Management system to automate the node configuration machines. You may want to use a Configuration Management system to automate the node configuration
process. There are examples of [Saltstack](../admin/salt.md), Ansible, Juju, and CoreOS Cloud Config in the process. There are examples of [Saltstack](../admin/salt.md), Ansible, Juju, and CoreOS Cloud Config in the
...@@ -485,6 +498,7 @@ all configured and managed *by Kubernetes*: ...@@ -485,6 +498,7 @@ all configured and managed *by Kubernetes*:
- they are kept running by Kubernetes rather than by init. - they are kept running by Kubernetes rather than by init.
### etcd ### etcd
You will need to run one or more instances of etcd. You will need to run one or more instances of etcd.
- Recommended approach: run one etcd instance, with its log written to a directory backed - Recommended approach: run one etcd instance, with its log written to a directory backed
by durable storage (RAID, GCE PD) by durable storage (RAID, GCE PD)
...@@ -613,6 +627,7 @@ node disk. ...@@ -613,6 +627,7 @@ node disk.
Optionally, you may want to mount `/var/log` as well and redirect output there. Optionally, you may want to mount `/var/log` as well and redirect output there.
#### Starting Apiserver #### Starting Apiserver
Place the completed pod template into the kubelet config dir Place the completed pod template into the kubelet config dir
(whatever `--config=` argument of kubelet is set to, typically (whatever `--config=` argument of kubelet is set to, typically
`/etc/kubernetes/manifests`). `/etc/kubernetes/manifests`).
...@@ -688,6 +703,7 @@ Optionally, you may want to mount `/var/log` as well and redirect output there. ...@@ -688,6 +703,7 @@ Optionally, you may want to mount `/var/log` as well and redirect output there.
Start as described for apiserver. Start as described for apiserver.
### Controller Manager ### Controller Manager
To run the controller manager: To run the controller manager:
- select the correct flags for your cluster - select the correct flags for your cluster
- write a pod spec for the controller manager using the provided template - write a pod spec for the controller manager using the provided template
...@@ -803,6 +819,7 @@ The nodes must be able to connect to each other using their private IP. Verify t ...@@ -803,6 +819,7 @@ The nodes must be able to connect to each other using their private IP. Verify t
pinging or SSH-ing from one node to another. pinging or SSH-ing from one node to another.
### Getting Help ### Getting Help
If you run into trouble, please see the section on [troubleshooting](gce.md#troubleshooting), post to the If you run into trouble, please see the section on [troubleshooting](gce.md#troubleshooting), post to the
[google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on IRC at [#google-containers](http://webchat.freenode.net/?channels=google-containers) on freenode. [google-containers group](https://groups.google.com/forum/#!forum/google-containers), or come ask questions on IRC at [#google-containers](http://webchat.freenode.net/?channels=google-containers) on freenode.
......
...@@ -48,6 +48,7 @@ This document describes how to deploy kubernetes on ubuntu nodes, including 1 ku ...@@ -48,6 +48,7 @@ This document describes how to deploy kubernetes on ubuntu nodes, including 1 ku
[Cloud team from Zhejiang University](https://github.com/ZJU-SEL) will maintain this work. [Cloud team from Zhejiang University](https://github.com/ZJU-SEL) will maintain this work.
## Prerequisites ## Prerequisites
*1 The nodes have installed docker version 1.2+ and bridge-utils to manipulate linux bridge* *1 The nodes have installed docker version 1.2+ and bridge-utils to manipulate linux bridge*
*2 All machines can communicate with each other, no need to connect Internet (should use private docker registry in this case)* *2 All machines can communicate with each other, no need to connect Internet (should use private docker registry in this case)*
...@@ -60,6 +61,7 @@ This document describes how to deploy kubernetes on ubuntu nodes, including 1 ku ...@@ -60,6 +61,7 @@ This document describes how to deploy kubernetes on ubuntu nodes, including 1 ku
### Starting a Cluster ### Starting a Cluster
#### Make *kubernetes* , *etcd* and *flanneld* binaries #### Make *kubernetes* , *etcd* and *flanneld* binaries
First clone the kubernetes github repo, `$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git` First clone the kubernetes github repo, `$ git clone https://github.com/GoogleCloudPlatform/kubernetes.git`
...@@ -74,6 +76,7 @@ Please make sure that there are `kube-apiserver`, `kube-controller-manager`, `ku ...@@ -74,6 +76,7 @@ Please make sure that there are `kube-apiserver`, `kube-controller-manager`, `ku
> We used flannel here because we want to use overlay network, but please remember it is not the only choice, and it is also not a k8s' necessary dependence. Actually you can just build up k8s cluster natively, or use flannel, Open vSwitch or any other SDN tool you like, we just choose flannel here as a example. > We used flannel here because we want to use overlay network, but please remember it is not the only choice, and it is also not a k8s' necessary dependence. Actually you can just build up k8s cluster natively, or use flannel, Open vSwitch or any other SDN tool you like, we just choose flannel here as a example.
#### Configure and start the kubernetes cluster #### Configure and start the kubernetes cluster
An example cluster is listed as below: An example cluster is listed as below:
| IP Address|Role | | IP Address|Role |
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Getting started with Vagrant ## Getting started with Vagrant
Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X). Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/develop on your local machine (Linux, Mac OS X).
...@@ -53,6 +54,7 @@ Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/deve ...@@ -53,6 +54,7 @@ Running kubernetes with Vagrant (and VirtualBox) is an easy way to run/test/deve
- [I want vagrant to sync folders via nfs!](#i-want-vagrant-to-sync-folders-via-nfs) - [I want vagrant to sync folders via nfs!](#i-want-vagrant-to-sync-folders-via-nfs)
### Prerequisites ### Prerequisites
1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html 1. Install latest version >= 1.6.2 of vagrant from http://www.vagrantup.com/downloads.html
2. Install one of: 2. Install one of:
1. Version 4.3.28 of Virtual Box from https://www.virtualbox.org/wiki/Download_Old_Builds_4_3 1. Version 4.3.28 of Virtual Box from https://www.virtualbox.org/wiki/Download_Old_Builds_4_3
...@@ -366,6 +368,7 @@ export KUBERNETES_MINION_MEMORY=2048 ...@@ -366,6 +368,7 @@ export KUBERNETES_MINION_MEMORY=2048
``` ```
#### I ran vagrant suspend and nothing works! #### I ran vagrant suspend and nothing works!
```vagrant suspend``` seems to mess up the network. This is not supported at this time. ```vagrant suspend``` seems to mess up the network. This is not supported at this time.
#### I want vagrant to sync folders via nfs! #### I want vagrant to sync folders via nfs!
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Abstract ## Abstract
Auto-scaling is a data-driven feature that allows users to increase or decrease capacity as needed by controlling the Auto-scaling is a data-driven feature that allows users to increase or decrease capacity as needed by controlling the
number of pods deployed within the system automatically. number of pods deployed within the system automatically.
...@@ -230,6 +232,7 @@ Since an auto-scaler is a durable object it is best represented as a resource. ...@@ -230,6 +232,7 @@ Since an auto-scaler is a durable object it is best represented as a resource.
``` ```
#### Boundary Definitions #### Boundary Definitions
The `AutoScaleThreshold` definitions provide the boundaries for the auto-scaler. By defining comparisons that form a range The `AutoScaleThreshold` definitions provide the boundaries for the auto-scaler. By defining comparisons that form a range
along with positive and negative increments you may define bi-directional scaling. For example the upper bound may be along with positive and negative increments you may define bi-directional scaling. For example the upper bound may be
specified as "when requests per second rise above 50 for 30 seconds scale the application up by 1" and a lower bound may specified as "when requests per second rise above 50 for 30 seconds scale the application up by 1" and a lower bound may
...@@ -251,6 +254,7 @@ Of note: If the statistics gathering mechanisms can be initialized with a regist ...@@ -251,6 +254,7 @@ Of note: If the statistics gathering mechanisms can be initialized with a regist
potentially piggyback on this registry. potentially piggyback on this registry.
### Multi-target Scaling Policy ### Multi-target Scaling Policy
If multiple scalable targets satisfy the `TargetSelector` criteria the auto-scaler should be configurable as to which If multiple scalable targets satisfy the `TargetSelector` criteria the auto-scaler should be configurable as to which
target(s) are scaled. To begin with, if multiple targets are found the auto-scaler will scale the largest target up target(s) are scaled. To begin with, if multiple targets are found the auto-scaler will scale the largest target up
or down as appropriate. In the future this may be more configurable. or down as appropriate. In the future this may be more configurable.
......
...@@ -30,12 +30,15 @@ Documentation for other releases can be found at ...@@ -30,12 +30,15 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
#Kubernetes Cluster Federation
##(a.k.a. "Ubernetes") # Kubernetes Cluster Federation
## (a.k.a. "Ubernetes")
## Requirements Analysis and Product Proposal ## Requirements Analysis and Product Proposal
## _by Quinton Hoole ([quinton@google.com](mailto:quinton@google.com))_ ## _by Quinton Hoole ([quinton@google.com](mailto:quinton@google.com))_
_Initial revision: 2015-03-05_ _Initial revision: 2015-03-05_
_Last updated: 2015-03-09_ _Last updated: 2015-03-09_
This doc: [tinyurl.com/ubernetesv2](http://tinyurl.com/ubernetesv2) This doc: [tinyurl.com/ubernetesv2](http://tinyurl.com/ubernetesv2)
...@@ -417,7 +420,7 @@ TBD: All very hand-wavey still, but some initial thoughts to get the conversatio ...@@ -417,7 +420,7 @@ TBD: All very hand-wavey still, but some initial thoughts to get the conversatio
![image](federation-high-level-arch.png) ![image](federation-high-level-arch.png)
## Ubernetes API ## Ubernetes API
This looks a lot like the existing Kubernetes API but is explicitly multi-cluster. This looks a lot like the existing Kubernetes API but is explicitly multi-cluster.
......
...@@ -30,10 +30,13 @@ Documentation for other releases can be found at ...@@ -30,10 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# High Availability of Scheduling and Controller Components in Kubernetes # High Availability of Scheduling and Controller Components in Kubernetes
This document serves as a proposal for high availability of the scheduler and controller components in kubernetes. This proposal is intended to provide a simple High Availability api for kubernetes components with the potential to extend to services running on kubernetes. Those services would be subject to their own constraints. This document serves as a proposal for high availability of the scheduler and controller components in kubernetes. This proposal is intended to provide a simple High Availability api for kubernetes components with the potential to extend to services running on kubernetes. Those services would be subject to their own constraints.
## Design Options ## Design Options
For complete reference see [this](https://www.ibm.com/developerworks/community/blogs/RohitShetty/entry/high_availability_cold_warm_hot?lang=en) For complete reference see [this](https://www.ibm.com/developerworks/community/blogs/RohitShetty/entry/high_availability_cold_warm_hot?lang=en)
1. Hot Standby: In this scenario, data and state are shared between the two components such that an immediate failure in one component causes the standby daemon to take over exactly where the failed component had left off. This would be an ideal solution for kubernetes, however it poses a series of challenges in the case of controllers where component-state is cached locally and not persisted in a transactional way to a storage facility. This would also introduce additional load on the apiserver, which is not desirable. As a result, we are **NOT** planning on this approach at this time. 1. Hot Standby: In this scenario, data and state are shared between the two components such that an immediate failure in one component causes the standby daemon to take over exactly where the failed component had left off. This would be an ideal solution for kubernetes, however it poses a series of challenges in the case of controllers where component-state is cached locally and not persisted in a transactional way to a storage facility. This would also introduce additional load on the apiserver, which is not desirable. As a result, we are **NOT** planning on this approach at this time.
...@@ -43,6 +46,7 @@ For complete reference see [this](https://www.ibm.com/developerworks/community/b ...@@ -43,6 +46,7 @@ For complete reference see [this](https://www.ibm.com/developerworks/community/b
3. Active-Active (Load Balanced): Clients can simply load-balance across any number of servers that are currently running. Their general availability can be continuously updated, or published, such that load balancing only occurs across active participants. This aspect of HA is outside of the scope of *this* proposal because there is already a partial implementation in the apiserver. 3. Active-Active (Load Balanced): Clients can simply load-balance across any number of servers that are currently running. Their general availability can be continuously updated, or published, such that load balancing only occurs across active participants. This aspect of HA is outside of the scope of *this* proposal because there is already a partial implementation in the apiserver.
## Design Discussion Notes on Leader Election ## Design Discussion Notes on Leader Election
Implementation References: Implementation References:
* [zookeeper](http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection) * [zookeeper](http://zookeeper.apache.org/doc/trunk/recipes.html#sc_leaderElection)
* [etcd](https://groups.google.com/forum/#!topic/etcd-dev/EbAa4fjypb4) * [etcd](https://groups.google.com/forum/#!topic/etcd-dev/EbAa4fjypb4)
...@@ -55,11 +59,13 @@ The first component to request leadership will become the master. All other com ...@@ -55,11 +59,13 @@ The first component to request leadership will become the master. All other com
The component that becomes master should create a thread to manage the lease. This thread should be created with a channel that the main process can use to release the master lease. The master should release the lease in cases of an unrecoverable error and clean shutdown. Otherwise, this process will renew the lease and sleep, waiting for the next renewal time or notification to release the lease. If there is a failure to renew the lease, this process should force the entire component to exit. Daemon exit is meant to prevent potential split-brain conditions. Daemon restart is implied in this scenario, by either the init system (systemd), or possible watchdog processes. (See Design Discussion Notes) The component that becomes master should create a thread to manage the lease. This thread should be created with a channel that the main process can use to release the master lease. The master should release the lease in cases of an unrecoverable error and clean shutdown. Otherwise, this process will renew the lease and sleep, waiting for the next renewal time or notification to release the lease. If there is a failure to renew the lease, this process should force the entire component to exit. Daemon exit is meant to prevent potential split-brain conditions. Daemon restart is implied in this scenario, by either the init system (systemd), or possible watchdog processes. (See Design Discussion Notes)
## Options added to components with HA functionality ## Options added to components with HA functionality
Some command line options would be added to components that can do HA: Some command line options would be added to components that can do HA:
* Lease Duration - How long a component can be master * Lease Duration - How long a component can be master
## Design Discussion Notes ## Design Discussion Notes
Some components may run numerous threads in order to perform tasks in parallel. Upon losing master status, such components should exit instantly instead of attempting to gracefully shut down such threads. This is to ensure that, in the case there's some propagation delay in informing the threads they should stop, the lame-duck threads won't interfere with the new master. The component should exit with an exit code indicating that the component is not the master. Since all components will be run by systemd or some other monitoring system, this will just result in a restart. Some components may run numerous threads in order to perform tasks in parallel. Upon losing master status, such components should exit instantly instead of attempting to gracefully shut down such threads. This is to ensure that, in the case there's some propagation delay in informing the threads they should stop, the lame-duck threads won't interfere with the new master. The component should exit with an exit code indicating that the component is not the master. Since all components will be run by systemd or some other monitoring system, this will just result in a restart.
There is a short window after a new master acquires the lease, during which data from the old master might be committed. This is because there is currently no way to condition a write on its source being the master. Having the daemons exit shortens this window but does not eliminate it. A proper solution for this problem will be addressed at a later date. The proposed solution is: There is a short window after a new master acquires the lease, during which data from the old master might be committed. This is because there is currently no way to condition a write on its source being the master. Having the daemons exit shortens this window but does not eliminate it. A proper solution for this problem will be addressed at a later date. The proposed solution is:
...@@ -75,6 +81,7 @@ There is a short window after a new master acquires the lease, during which data ...@@ -75,6 +81,7 @@ There is a short window after a new master acquires the lease, during which data
5. When the API server makes the corresponding write to etcd, it includes it in a transaction that does a compare-and-swap on the "current master" entry (old value == new value == host:port and sequence number from the replica that sent the mutating operation). This basically guarantees that if we elect the new master, all transactions coming from the old master will fail. You can think of this as the master attaching a "precondition" of its belief about who is the latest master. 5. When the API server makes the corresponding write to etcd, it includes it in a transaction that does a compare-and-swap on the "current master" entry (old value == new value == host:port and sequence number from the replica that sent the mutating operation). This basically guarantees that if we elect the new master, all transactions coming from the old master will fail. You can think of this as the master attaching a "precondition" of its belief about who is the latest master.
## Open Questions ## Open Questions
* Is there a desire to keep track of all nodes for a specific component type? * Is there a desire to keep track of all nodes for a specific component type?
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes v1 # Kubernetes v1
Updated May 28, 2015 Updated May 28, 2015
...@@ -51,9 +52,12 @@ clustered database or key-value store. We will target such workloads for our ...@@ -51,9 +52,12 @@ clustered database or key-value store. We will target such workloads for our
1.0 release. 1.0 release.
## v1 APIs ## v1 APIs
For existing and future workloads, we want to provide a consistent, stable set of APIs, over which developers can build and extend Kubernetes. This includes input validation, a consistent API structure, clean semantics, and improved diagnosability of the system. For existing and future workloads, we want to provide a consistent, stable set of APIs, over which developers can build and extend Kubernetes. This includes input validation, a consistent API structure, clean semantics, and improved diagnosability of the system.
||||||| merged common ancestors ||||||| merged common ancestors
## APIs and core features ## APIs and core features
1. Consistent v1 API 1. Consistent v1 API
- Status: DONE. [v1beta3](http://kubernetesio.blogspot.com/2015/04/introducing-kubernetes-v1beta3.html) was developed as the release candidate for the v1 API. - Status: DONE. [v1beta3](http://kubernetesio.blogspot.com/2015/04/introducing-kubernetes-v1beta3.html) was developed as the release candidate for the v1 API.
2. Multi-port services for apps which need more than one port on the same portal IP ([#1802](https://github.com/GoogleCloudPlatform/kubernetes/issues/1802)) 2. Multi-port services for apps which need more than one port on the same portal IP ([#1802](https://github.com/GoogleCloudPlatform/kubernetes/issues/1802))
...@@ -108,12 +112,15 @@ For existing and future workloads, we want to provide a consistent, stable set o ...@@ -108,12 +112,15 @@ For existing and future workloads, we want to provide a consistent, stable set o
In addition, we will provide versioning and deprecation policies for the APIs. In addition, we will provide versioning and deprecation policies for the APIs.
## Cluster Environment ## Cluster Environment
Currently, a cluster is a set of nodes (VMs, machines), managed by a master, running a version of Kubernetes. This master is the cluster-level control-plane. For the purpose of running production workloads, members of the cluster must be serviceable and upgradeable. Currently, a cluster is a set of nodes (VMs, machines), managed by a master, running a version of Kubernetes. This master is the cluster-level control-plane. For the purpose of running production workloads, members of the cluster must be serviceable and upgradeable.
## Micro-services and Resources ## Micro-services and Resources
For applications / micro-services that run on Kubernetes, we want deployments to be easy but powerful. An Operations user should be able to launch a micro-service, letting the scheduler find the right placement. That micro-service should be able to require “pet storage” resources, fulfilled by external storage and with help from the cluster. We also want to improve the tools, experience for how users can roll-out applications through patterns like canary deployments. For applications / micro-services that run on Kubernetes, we want deployments to be easy but powerful. An Operations user should be able to launch a micro-service, letting the scheduler find the right placement. That micro-service should be able to require “pet storage” resources, fulfilled by external storage and with help from the cluster. We also want to improve the tools, experience for how users can roll-out applications through patterns like canary deployments.
## Performance and Reliability ## Performance and Reliability
The system should be performant, especially from the perspective of micro-service running on top of the cluster and for Operations users. As part of being production grade, the system should have a measured availability and be resilient to failures, including fatal failures due to hardware. The system should be performant, especially from the perspective of micro-service running on top of the cluster and for Operations users. As part of being production grade, the system should have a measured availability and be resilient to failures, including fatal failures due to hardware.
In terms of performance, the objectives include: In terms of performance, the objectives include:
......
...@@ -30,15 +30,19 @@ Documentation for other releases can be found at ...@@ -30,15 +30,19 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Troubleshooting # Troubleshooting
Sometimes things go wrong. This guide is aimed at making them right. It has two sections: Sometimes things go wrong. This guide is aimed at making them right. It has two sections:
* [Troubleshooting your application](user-guide/application-troubleshooting.md) - Useful for users who are deploying code into Kubernetes and wondering why it is not working. * [Troubleshooting your application](user-guide/application-troubleshooting.md) - Useful for users who are deploying code into Kubernetes and wondering why it is not working.
* [Troubleshooting your cluster](admin/cluster-troubleshooting.md) - Useful for cluster administrators and people whose Kubernetes cluster is unhappy. * [Troubleshooting your cluster](admin/cluster-troubleshooting.md) - Useful for cluster administrators and people whose Kubernetes cluster is unhappy.
# Getting help # Getting help
If your problem isn't answered by any of guides above, there are variety of ways for you to get help from the Kubernetes team. If your problem isn't answered by any of guides above, there are variety of ways for you to get help from the Kubernetes team.
## Questions ## Questions
We have a number of FAQ pages We have a number of FAQ pages
* [User FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/User-FAQ) * [User FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/User-FAQ)
* [Debugging FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/Debugging-FAQ) * [Debugging FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/Debugging-FAQ)
...@@ -49,6 +53,7 @@ You may also find the StackOverflow topics relevant ...@@ -49,6 +53,7 @@ You may also find the StackOverflow topics relevant
* [Google Container Engine - GKE](http://stackoverflow.com/questions/tagged/google-container-engine) * [Google Container Engine - GKE](http://stackoverflow.com/questions/tagged/google-container-engine)
## Bugs and Feature requests ## Bugs and Feature requests
If you have what looks like a bug, or you would like to make a feature request, please use the [Github issue tracking system](https://github.com/GoogleCloudPlatform/kubernetes/issues). If you have what looks like a bug, or you would like to make a feature request, please use the [Github issue tracking system](https://github.com/GoogleCloudPlatform/kubernetes/issues).
Before you file an issue, please search existing issues to see if your issue is already covered. Before you file an issue, please search existing issues to see if your issue is already covered.
...@@ -56,9 +61,11 @@ Before you file an issue, please search existing issues to see if your issue is ...@@ -56,9 +61,11 @@ Before you file an issue, please search existing issues to see if your issue is
# Help! My question isn't covered! I need help now! # Help! My question isn't covered! I need help now!
## IRC ## IRC
The Kubernetes team hangs out on IRC at [```#google-containers```](https://botbot.me/freenode/google-containers/) on freenode. Feel free to come and ask any and all questions there. The Kubernetes team hangs out on IRC at [```#google-containers```](https://botbot.me/freenode/google-containers/) on freenode. Feel free to come and ask any and all questions there.
## Mailing List ## Mailing List
The Kubernetes mailing list is google-containers@googlegroups.com The Kubernetes mailing list is google-containers@googlegroups.com
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications # Kubernetes User Guide: Managing Applications
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# User Guide to Accessing the Cluster # User Guide to Accessing the Cluster
**Table of Contents** **Table of Contents**
...@@ -54,7 +55,9 @@ Documentation for other releases can be found at ...@@ -54,7 +55,9 @@ Documentation for other releases can be found at
<!-- END MUNGE: GENERATED_TOC --> <!-- END MUNGE: GENERATED_TOC -->
## Accessing the cluster API ## Accessing the cluster API
### Accessing for the first time with kubectl ### Accessing for the first time with kubectl
When accessing the Kubernetes API for the first time, we suggest using the When accessing the Kubernetes API for the first time, we suggest using the
kubernetes CLI, `kubectl`. kubernetes CLI, `kubectl`.
...@@ -73,6 +76,7 @@ Many of the [examples](../../examples/) provide an introduction to using ...@@ -73,6 +76,7 @@ Many of the [examples](../../examples/) provide an introduction to using
kubectl and complete documentation is found in the [kubectl manual](kubectl/kubectl.md). kubectl and complete documentation is found in the [kubectl manual](kubectl/kubectl.md).
### Directly accessing the REST API ### Directly accessing the REST API
Kubectl handles locating and authenticating to the apiserver. Kubectl handles locating and authenticating to the apiserver.
If you want to directly access the REST API with an http client like If you want to directly access the REST API with an http client like
curl or wget, or a browser, there are several ways to locate and authenticate: curl or wget, or a browser, there are several ways to locate and authenticate:
...@@ -111,6 +115,7 @@ $ curl http://localhost:8080/api/ ...@@ -111,6 +115,7 @@ $ curl http://localhost:8080/api/
``` ```
#### Without kubectl proxy #### Without kubectl proxy
It is also possible to avoid using kubectl proxy by passing an authentication token It is also possible to avoid using kubectl proxy by passing an authentication token
directly to the apiserver, like this: directly to the apiserver, like this:
...@@ -175,6 +180,7 @@ In each case, the credentials of the pod are used to communicate securely with t ...@@ -175,6 +180,7 @@ In each case, the credentials of the pod are used to communicate securely with t
## Accessing services running on the cluster ## Accessing services running on the cluster
The previous section was about connecting the Kubernetes API server. This section is about The previous section was about connecting the Kubernetes API server. This section is about
connecting to other services running on Kubernetes cluster. In kubernetes, the connecting to other services running on Kubernetes cluster. In kubernetes, the
[nodes](../admin/node.md), [pods](pods.md) and [services](services.md) all have [nodes](../admin/node.md), [pods](pods.md) and [services](services.md) all have
...@@ -183,6 +189,7 @@ routable, so they will not be reachable from a machine outside the cluster, ...@@ -183,6 +189,7 @@ routable, so they will not be reachable from a machine outside the cluster,
such as your desktop machine. such as your desktop machine.
### Ways to connect ### Ways to connect
You have several options for connecting to nodes, pods and services from outside the cluster: You have several options for connecting to nodes, pods and services from outside the cluster:
- Access services through public IPs. - Access services through public IPs.
- Use a service with type `NodePort` or `LoadBalancer` to make the service reachable outside - Use a service with type `NodePort` or `LoadBalancer` to make the service reachable outside
...@@ -232,12 +239,14 @@ at `https://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch ...@@ -232,12 +239,14 @@ at `https://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch
(See [above](#accessing-the-cluster-api) for how to pass credentials or use kubectl proxy.) (See [above](#accessing-the-cluster-api) for how to pass credentials or use kubectl proxy.)
#### Manually constructing apiserver proxy URLs #### Manually constructing apiserver proxy URLs
As mentioned above, you use the `kubectl cluster-info` command to retrieve the service's proxy URL. To create proxy URLs that include service endpoints, suffixes, and parameters, you simply append to the service's proxy URL: As mentioned above, you use the `kubectl cluster-info` command to retrieve the service's proxy URL. To create proxy URLs that include service endpoints, suffixes, and parameters, you simply append to the service's proxy URL:
`http://`*`kubernetes_master_address`*`/`*`service_path`*`/`*`service_name`*`/`*`service_endpoint-suffix-parameter`* `http://`*`kubernetes_master_address`*`/`*`service_path`*`/`*`service_name`*`/`*`service_endpoint-suffix-parameter`*
<!--- TODO: update this part of doc because it doesn't seem to be valid. What <!--- TODO: update this part of doc because it doesn't seem to be valid. What
about namespaces? 'proxy' verb? --> about namespaces? 'proxy' verb? -->
##### Examples ##### Examples
* To access the Elasticsearch service endpoint `_search?q=user:kimchy`, you would use: `http://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch-logging/_search?q=user:kimchy` * To access the Elasticsearch service endpoint `_search?q=user:kimchy`, you would use: `http://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch-logging/_search?q=user:kimchy`
* To access the Elasticsearch cluster health information `_cluster/health?pretty=true`, you would use: `https://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch-logging/_cluster/health?pretty=true` * To access the Elasticsearch cluster health information `_cluster/health?pretty=true`, you would use: `https://104.197.5.247/api/v1/proxy/namespaces/default/services/elasticsearch-logging/_cluster/health?pretty=true`
...@@ -257,6 +266,7 @@ about namespaces? 'proxy' verb? --> ...@@ -257,6 +266,7 @@ about namespaces? 'proxy' verb? -->
``` ```
#### Using web browsers to access services running on the cluster #### Using web browsers to access services running on the cluster
You may be able to put an apiserver proxy url into the address bar of a browser. However: You may be able to put an apiserver proxy url into the address bar of a browser. However:
- Web browsers cannot usually pass tokens, so you may need to use basic (password) auth. Apiserver can be configured to accept basic auth, - Web browsers cannot usually pass tokens, so you may need to use basic (password) auth. Apiserver can be configured to accept basic auth,
but your cluster may not be configured to accept basic auth. but your cluster may not be configured to accept basic auth.
...@@ -264,9 +274,11 @@ You may be able to put an apiserver proxy url into the address bar of a browser. ...@@ -264,9 +274,11 @@ You may be able to put an apiserver proxy url into the address bar of a browser.
way that is unaware of the proxy path prefix. way that is unaware of the proxy path prefix.
## Requesting redirects ## Requesting redirects
The redirect capabilities have been deprecated and removed. Please use a proxy (see below) instead. The redirect capabilities have been deprecated and removed. Please use a proxy (see below) instead.
## So Many Proxies ## So Many Proxies
There are several different proxies you may encounter when using kubernetes: There are several different proxies you may encounter when using kubernetes:
1. The [kubectl proxy](#directly-accessing-the-rest-api): 1. The [kubectl proxy](#directly-accessing-the-rest-api):
- runs on a user's desktop or in a pod - runs on a user's desktop or in a pod
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Annotations # Annotations
We have [labels](labels.md) for identifying metadata. We have [labels](labels.md) for identifying metadata.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Application Troubleshooting # Application Troubleshooting
This guide is to help users debug applications that are deployed into Kubernetes and not behaving correctly. This guide is to help users debug applications that are deployed into Kubernetes and not behaving correctly.
...@@ -54,9 +55,11 @@ This is *not* a guide for people who want to debug their cluster. For that you ...@@ -54,9 +55,11 @@ This is *not* a guide for people who want to debug their cluster. For that you
<!-- END MUNGE: GENERATED_TOC --> <!-- END MUNGE: GENERATED_TOC -->
## FAQ ## FAQ
Users are highly encouraged to check out our [FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/User-FAQ) Users are highly encouraged to check out our [FAQ](https://github.com/GoogleCloudPlatform/kubernetes/wiki/User-FAQ)
## Diagnosing the problem ## Diagnosing the problem
The first step in troubleshooting is triage. What is the problem? Is it your Pods, your Replication Controller or The first step in troubleshooting is triage. What is the problem? Is it your Pods, your Replication Controller or
your Service? your Service?
* [Debugging Pods](#debugging-pods) * [Debugging Pods](#debugging-pods)
...@@ -64,6 +67,7 @@ your Service? ...@@ -64,6 +67,7 @@ your Service?
* [Debugging Services](#debugging-services) * [Debugging Services](#debugging-services)
### Debugging Pods ### Debugging Pods
The first step in debugging a Pod is taking a look at it. Check the current state of the Pod and recent events with the following command: The first step in debugging a Pod is taking a look at it. Check the current state of the Pod and recent events with the following command:
```sh ```sh
...@@ -75,6 +79,7 @@ Look at the state of the containers in the pod. Are they all ```Running```? Ha ...@@ -75,6 +79,7 @@ Look at the state of the containers in the pod. Are they all ```Running```? Ha
Continue debugging depending on the state of the pods. Continue debugging depending on the state of the pods.
#### My pod stays pending #### My pod stays pending
If a Pod is stuck in ```Pending``` it means that it can not be scheduled onto a node. Generally this is because If a Pod is stuck in ```Pending``` it means that it can not be scheduled onto a node. Generally this is because
there are insufficient resources of one type or another that prevent scheduling. Look at the output of the there are insufficient resources of one type or another that prevent scheduling. Look at the output of the
```kubectl describe ...``` command above. There should be messages from the scheduler about why it can not schedule ```kubectl describe ...``` command above. There should be messages from the scheduler about why it can not schedule
...@@ -89,6 +94,7 @@ scheduled. In most cases, ```hostPort``` is unnecessary, try using a Service ob ...@@ -89,6 +94,7 @@ scheduled. In most cases, ```hostPort``` is unnecessary, try using a Service ob
#### My pod stays waiting #### My pod stays waiting
If a Pod is stuck in the ```Waiting``` state, then it has been scheduled to a worker node, but it can't run on that machine. If a Pod is stuck in the ```Waiting``` state, then it has been scheduled to a worker node, but it can't run on that machine.
Again, the information from ```kubectl describe ...``` should be informative. The most common cause of ```Waiting``` pods is a failure to pull the image. There are three things to check: Again, the information from ```kubectl describe ...``` should be informative. The most common cause of ```Waiting``` pods is a failure to pull the image. There are three things to check:
* Make sure that you have the name of the image correct * Make sure that you have the name of the image correct
...@@ -130,6 +136,7 @@ but this should generally not be necessary given tools in the Kubernetes API. Th ...@@ -130,6 +136,7 @@ but this should generally not be necessary given tools in the Kubernetes API. Th
feature request on GitHub describing your use case and why these tools are insufficient. feature request on GitHub describing your use case and why these tools are insufficient.
### Debugging Replication Controllers ### Debugging Replication Controllers
Replication controllers are fairly straightforward. They can either create Pods or they can't. If they can't Replication controllers are fairly straightforward. They can either create Pods or they can't. If they can't
create pods, then please refer to the [instructions above](#debugging-pods) to debug your pods. create pods, then please refer to the [instructions above](#debugging-pods) to debug your pods.
...@@ -137,6 +144,7 @@ You can also use ```kubectl describe rc ${CONTROLLER_NAME}``` to introspect even ...@@ -137,6 +144,7 @@ You can also use ```kubectl describe rc ${CONTROLLER_NAME}``` to introspect even
controller. controller.
### Debugging Services ### Debugging Services
Services provide load balancing across a set of pods. There are several common problems that can make Services Services provide load balancing across a set of pods. There are several common problems that can make Services
not work properly. The following instructions should help debug Service problems. not work properly. The following instructions should help debug Service problems.
...@@ -153,6 +161,7 @@ For example, if your Service is for an nginx container with 3 replicas, you woul ...@@ -153,6 +161,7 @@ For example, if your Service is for an nginx container with 3 replicas, you woul
IP addresses in the Service's endpoints. IP addresses in the Service's endpoints.
#### My service is missing endpoints #### My service is missing endpoints
If you are missing endpoints, try listing pods using the labels that Service uses. Imagine that you have If you are missing endpoints, try listing pods using the labels that Service uses. Imagine that you have
a Service where the labels are: a Service where the labels are:
...@@ -179,6 +188,7 @@ selected don't have that port listed, then they won't be added to the endpoints ...@@ -179,6 +188,7 @@ selected don't have that port listed, then they won't be added to the endpoints
Verify that the pod's ```containerPort``` matches up with the Service's ```containerPort``` Verify that the pod's ```containerPort``` matches up with the Service's ```containerPort```
#### Network traffic is not forwarded #### Network traffic is not forwarded
If you can connect to the service, but the connection is immediately dropped, and there are endpoints If you can connect to the service, but the connection is immediately dropped, and there are endpoints
in the endpoints list, it's likely that the proxy can't contact your pods. in the endpoints list, it's likely that the proxy can't contact your pods.
...@@ -189,6 +199,7 @@ check: ...@@ -189,6 +199,7 @@ check:
* Is your application serving on the port that you configured? Kubernetes doesn't do port remapping, so if your application serves on 8080, the ```containerPort``` field needs to be 8080. * Is your application serving on the port that you configured? Kubernetes doesn't do port remapping, so if your application serves on 8080, the ```containerPort``` field needs to be 8080.
#### More information #### More information
If none of the above solves your problem, follow the instructions in [Debugging Service document](debugging-services.md) to make sure that your `Service` is running, has `Endpoints`, and your `Pods` are actually serving; you have DNS working, iptables rules installed, and kube-proxy does not seem to be misbehaving. If none of the above solves your problem, follow the instructions in [Debugging Service document](debugging-services.md) to make sure that your `Service` is running, has `Endpoints`, and your `Pods` are actually serving; you have DNS working, iptables rules installed, and kube-proxy does not seem to be misbehaving.
You may also visit [troubleshooting document](../troubleshooting.md) for more information. You may also visit [troubleshooting document](../troubleshooting.md) for more information.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Compute Resources # Compute Resources
** Table of Contents** ** Table of Contents**
...@@ -149,6 +150,7 @@ then pod resource usage can be retrieved from the monitoring system. ...@@ -149,6 +150,7 @@ then pod resource usage can be retrieved from the monitoring system.
## Troubleshooting ## Troubleshooting
### My pods are pending with event message failedScheduling ### My pods are pending with event message failedScheduling
If the scheduler cannot find any node where a pod can fit, then the pod will remain unscheduled If the scheduler cannot find any node where a pod can fit, then the pod will remain unscheduled
until a place can be found. An event will be produced each time the scheduler fails to find a until a place can be found. An event will be produced each time the scheduler fails to find a
place for the pod, like this: place for the pod, like this:
...@@ -176,6 +178,7 @@ to limit the total amount of resources that can be consumed. If used in conjunc ...@@ -176,6 +178,7 @@ to limit the total amount of resources that can be consumed. If used in conjunc
with namespaces, it can prevent one team from hogging all the resources. with namespaces, it can prevent one team from hogging all the resources.
### My container is terminated ### My container is terminated
Your container may be terminated because it's resource-starved. To check if a container is being killed because it is hitting a resource limit, call `kubectl describe pod` Your container may be terminated because it's resource-starved. To check if a container is being killed because it is hitting a resource limit, call `kubectl describe pod`
on the pod you are interested in: on the pod you are interested in:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Tips and tricks when working with config # Tips and tricks when working with config
This document is meant to highlight and consolidate in one place configuration best practices that are introduced throughout the user-guide and getting-started documentation and examples. This is a living document so if you think of something that is not on this list but might be useful to others, please don't hesitate to file an issue or submit a PR. This document is meant to highlight and consolidate in one place configuration best practices that are introduced throughout the user-guide and getting-started documentation and examples. This is a living document so if you think of something that is not on this list but might be useful to others, please don't hesitate to file an issue or submit a PR.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Configuring and launching containers # Kubernetes User Guide: Managing Applications: Configuring and launching containers
**Table of Contents** **Table of Contents**
...@@ -177,6 +178,7 @@ hello world ...@@ -177,6 +178,7 @@ hello world
``` ```
## Deleting pods ## Deleting pods
When you’re done looking at the output, you should delete the pod: When you’re done looking at the output, you should delete the pod:
```bash ```bash
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Connecting applications # Kubernetes User Guide: Managing Applications: Connecting applications
**Table of Contents** **Table of Contents**
...@@ -161,6 +162,7 @@ You should now be able to curl the nginx Service on `10.0.116.146:80` from any n ...@@ -161,6 +162,7 @@ You should now be able to curl the nginx Service on `10.0.116.146:80` from any n
Kubernetes supports 2 primary modes of finding a Service - environment variables and DNS. The former works out of the box while the latter requires the [kube-dns cluster addon](../../cluster/addons/dns/README.md). Kubernetes supports 2 primary modes of finding a Service - environment variables and DNS. The former works out of the box while the latter requires the [kube-dns cluster addon](../../cluster/addons/dns/README.md).
### Environment Variables ### Environment Variables
When a Pod is run on a Node, the kubelet adds a set of environment variables for each active Service. This introduces an ordering problem. To see why, inspect the environment of your running nginx pods: When a Pod is run on a Node, the kubelet adds a set of environment variables for each active Service. This introduces an ordering problem. To see why, inspect the environment of your running nginx pods:
```shell ```shell
...@@ -186,6 +188,7 @@ NGINXSVC_SERVICE_PORT=80 ...@@ -186,6 +188,7 @@ NGINXSVC_SERVICE_PORT=80
``` ```
### DNS ### DNS
Kubernetes offers a DNS cluster addon Service that uses skydns to automatically assign dns names to other Services. You can check if it’s running on your cluster: Kubernetes offers a DNS cluster addon Service that uses skydns to automatically assign dns names to other Services. You can check if it’s running on your cluster:
```shell ```shell
......
...@@ -30,7 +30,8 @@ Documentation for other releases can be found at ...@@ -30,7 +30,8 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
#Connecting to applications: kubectl port-forward
# Connecting to applications: kubectl port-forward
kubectl port-forward forwards connections to a local port to a port on a pod. Its man page is available [here](kubectl/kubectl_port-forward.md). Compared to [kubectl proxy](accessing-the-cluster.md#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. kubectl port-forward forwards connections to a local port to a port on a pod. Its man page is available [here](kubectl/kubectl_port-forward.md). Compared to [kubectl proxy](accessing-the-cluster.md#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.
...@@ -51,6 +52,7 @@ redis-master 2/2 Running 0 41s ...@@ -51,6 +52,7 @@ redis-master 2/2 Running 0 41s
## Connecting to the Redis master[a] ## Connecting to the Redis master[a]
The Redis master is listening on port 6397, to verify this, The Redis master is listening on port 6397, to verify this,
``` ```
......
...@@ -30,11 +30,14 @@ Documentation for other releases can be found at ...@@ -30,11 +30,14 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
#Connecting to applications: kubectl proxy and apiserver proxy
# Connecting to applications: kubectl proxy and apiserver proxy
You have seen the [basics](accessing-the-cluster.md) about `kubectl proxy` and `apiserver proxy`. This guide shows how to use them together to access a service([kube-ui](ui.md)) running on the Kubernetes cluster from your workstation. You have seen the [basics](accessing-the-cluster.md) about `kubectl proxy` and `apiserver proxy`. This guide shows how to use them together to access a service([kube-ui](ui.md)) running on the Kubernetes cluster from your workstation.
##Getting the apiserver proxy URL of kube-ui ## Getting the apiserver proxy URL of kube-ui
kube-ui is deployed as a cluster add-on. To find its apiserver proxy URL, kube-ui is deployed as a cluster add-on. To find its apiserver proxy URL,
``` ```
...@@ -45,7 +48,8 @@ KubeUI is running at https://173.255.119.104/api/v1/proxy/namespaces/kube-system ...@@ -45,7 +48,8 @@ KubeUI is running at https://173.255.119.104/api/v1/proxy/namespaces/kube-system
if this command does not find the URL, try the steps [here](ui.md#accessing-the-ui). if this command does not find the URL, try the steps [here](ui.md#accessing-the-ui).
##Connecting to the kube-ui service from your local workstation ## 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. 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.
``` ```
......
...@@ -50,6 +50,7 @@ Documentation for other releases can be found at ...@@ -50,6 +50,7 @@ Documentation for other releases can be found at
## Overview ## Overview
This document describes the environment for Kubelet managed containers on a Kubernetes node (kNode).  In contrast to the Kubernetes cluster API, which provides an API for creating and managing containers, the Kubernetes container environment provides the container access to information about what else is going on in the cluster.  This document describes the environment for Kubelet managed containers on a Kubernetes node (kNode).  In contrast to the Kubernetes cluster API, which provides an API for creating and managing containers, the Kubernetes container environment provides the container access to information about what else is going on in the cluster. 
This cluster information makes it possible to build applications that are *cluster aware*.   This cluster information makes it possible to build applications that are *cluster aware*.  
...@@ -61,14 +62,17 @@ Another important part of the container environment is the file system that is a ...@@ -61,14 +62,17 @@ Another important part of the container environment is the file system that is a
The following sections describe both the cluster information provided to containers, as well as the hooks and life-cycle that allows containers to interact with the management system. The following sections describe both the cluster information provided to containers, as well as the hooks and life-cycle that allows containers to interact with the management system.
## Cluster Information ## Cluster Information
There are two types of information that are available within the container environment.  There is information about the container itself, and there is information about other objects in the system. There are two types of information that are available within the container environment.  There is information about the container itself, and there is information about other objects in the system.
### Container Information ### Container Information
Currently, the only information about the container that is available to the container is the Pod name for the pod in which the container is running.  This ID is set as the hostname of the container, and is accessible through all calls to access the hostname within the container (e.g. the hostname command, or the [gethostname][1] function call in libc).  Additionally, user-defined environment variables from the pod definition, are also available to the container, as are any environment variables specified statically in the Docker image. Currently, the only information about the container that is available to the container is the Pod name for the pod in which the container is running.  This ID is set as the hostname of the container, and is accessible through all calls to access the hostname within the container (e.g. the hostname command, or the [gethostname][1] function call in libc).  Additionally, user-defined environment variables from the pod definition, are also available to the container, as are any environment variables specified statically in the Docker image.
In the future, we anticipate expanding this information with richer information about the container.  Examples include available memory, number of restarts, and in general any state that you could get from the call to GET /pods on the API server. In the future, we anticipate expanding this information with richer information about the container.  Examples include available memory, number of restarts, and in general any state that you could get from the call to GET /pods on the API server.
### Cluster Information ### Cluster Information
Currently the list of all services that are running at the time when the container was created via the Kubernetes Cluster API are available to the container as environment variables.  The set of environment variables matches the syntax of Docker links. Currently the list of all services that are running at the time when the container was created via the Kubernetes Cluster API are available to the container as environment variables.  The set of environment variables matches the syntax of Docker links.
For a service named **foo** that maps to a container port named **bar**, the following variables are defined: For a service named **foo** that maps to a container port named **bar**, the following variables are defined:
...@@ -81,11 +85,13 @@ FOO_SERVICE_PORT=<the port the service is running on> ...@@ -81,11 +85,13 @@ FOO_SERVICE_PORT=<the port the service is running on>
Services have dedicated IP address, and are also surfaced to the container via DNS (If [DNS addon](../../cluster/addons/dns/) is enabled).  Of course DNS is still not an enumerable protocol, so we will continue to provide environment variables so that containers can do discovery. Services have dedicated IP address, and are also surfaced to the container via DNS (If [DNS addon](../../cluster/addons/dns/) is enabled).  Of course DNS is still not an enumerable protocol, so we will continue to provide environment variables so that containers can do discovery.
## Container Hooks ## Container Hooks
*NB*: Container hooks are under active development, we anticipate adding additional hooks as the Kubernetes container management system evolves.* *NB*: Container hooks are under active development, we anticipate adding additional hooks as the Kubernetes container management system evolves.*
Container hooks provide information to the container about events in its management lifecycle.  For example, immediately after a container is started, it receives a *PostStart* hook.  These hooks are broadcast *into* the container with information about the life-cycle of the container.  They are different from the events provided by Docker and other systems which are *output* from the container.  Output events provide a log of what has already happened.  Input hooks provide real-time notification about things that are happening, but no historical log.   Container hooks provide information to the container about events in its management lifecycle.  For example, immediately after a container is started, it receives a *PostStart* hook.  These hooks are broadcast *into* the container with information about the life-cycle of the container.  They are different from the events provided by Docker and other systems which are *output* from the container.  Output events provide a log of what has already happened.  Input hooks provide real-time notification about things that are happening, but no historical log.  
### Hook Details ### Hook Details
There are currently two container hooks that are surfaced to containers, and two proposed hooks: There are currently two container hooks that are surfaced to containers, and two proposed hooks:
*PreStart - ****Proposed*** *PreStart - ****Proposed***
...@@ -114,11 +120,13 @@ Eventually, user specified reasons may be [added to the API](https://github.com/ ...@@ -114,11 +120,13 @@ Eventually, user specified reasons may be [added to the API](https://github.com/
### Hook Handler Execution ### Hook Handler Execution
When a management hook occurs, the management system calls into any registered hook handlers in the container for that hook.  These hook handler calls are synchronous in the context of the pod containing the container. Note:this means that hook handler execution blocks any further management of the pod.  If your hook handler blocks, no other management (including [health checks](production-pods.md#liveness-and-readiness-probes-aka-health-checks)) will occur until the hook handler completes.  Blocking hook handlers do *not* affect management of other Pods.  Typically we expect that users will make their hook handlers as lightweight as possible, but there are cases where long running commands make sense (e.g. saving state prior to container stop) When a management hook occurs, the management system calls into any registered hook handlers in the container for that hook.  These hook handler calls are synchronous in the context of the pod containing the container. Note:this means that hook handler execution blocks any further management of the pod.  If your hook handler blocks, no other management (including [health checks](production-pods.md#liveness-and-readiness-probes-aka-health-checks)) will occur until the hook handler completes.  Blocking hook handlers do *not* affect management of other Pods.  Typically we expect that users will make their hook handlers as lightweight as possible, but there are cases where long running commands make sense (e.g. saving state prior to container stop)
For hooks which have parameters, these parameters are passed to the event handler as a set of key/value pairs.  The details of this parameter passing is handler implementation dependent (see below). For hooks which have parameters, these parameters are passed to the event handler as a set of key/value pairs.  The details of this parameter passing is handler implementation dependent (see below).
### Hook delivery guarantees ### Hook delivery guarantees
Hook delivery is "at least one", which means that a hook may be called multiple times for any given event (e.g. "start" or "stop") and it is up to the hook implementer to be able to handle this Hook delivery is "at least one", which means that a hook may be called multiple times for any given event (e.g. "start" or "stop") and it is up to the hook implementer to be able to handle this
correctly. correctly.
...@@ -127,6 +135,7 @@ We expect double delivery to be rare, but in some cases if the ```kubelet``` res ...@@ -127,6 +135,7 @@ We expect double delivery to be rare, but in some cases if the ```kubelet``` res
Likewise, we only make a single delivery attempt. If (for example) an http hook receiver is down, and unable to take traffic, we do not make any attempts to resend. Likewise, we only make a single delivery attempt. If (for example) an http hook receiver is down, and unable to take traffic, we do not make any attempts to resend.
### Hook Handler Implementations ### Hook Handler Implementations
Hook handlers are the way that hooks are surfaced to containers.  Containers can select the type of hook handler they would like to implement.  Kubernetes currently supports two different hook handler types: Hook handlers are the way that hooks are surfaced to containers.  Containers can select the type of hook handler they would like to implement.  Kubernetes currently supports two different hook handler types:
* Exec - Executes a specific command (e.g. pre-stop.sh) inside the cgroup and namespaces of the container.  Resources consumed by the command are counted against the container.  Commands which print "ok" to standard out (stdout) are treated as healthy, any other output is treated as container failures (and will cause kubelet to forcibly restart the container).  Parameters are passed to the command as traditional linux command line flags (e.g. pre-stop.sh --reason=HEALTH) * Exec - Executes a specific command (e.g. pre-stop.sh) inside the cgroup and namespaces of the container.  Resources consumed by the command are counted against the container.  Commands which print "ok" to standard out (stdout) are treated as healthy, any other output is treated as container failures (and will cause kubelet to forcibly restart the container).  Parameters are passed to the command as traditional linux command line flags (e.g. pre-stop.sh --reason=HEALTH)
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Containers with Kubernetes # Containers with Kubernetes
## Containers and commands ## Containers and commands
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# My Service is not working - how to debug # My Service is not working - how to debug
An issue that comes up rather frequently for new installations of Kubernetes is An issue that comes up rather frequently for new installations of Kubernetes is
...@@ -550,6 +551,7 @@ Contact us on ...@@ -550,6 +551,7 @@ Contact us on
[GitHub](https://github.com/GoogleCloudPlatform/kubernetes). [GitHub](https://github.com/GoogleCloudPlatform/kubernetes).
## More information ## More information
Visit [troubleshooting document](../troubleshooting.md) for more information. Visit [troubleshooting document](../troubleshooting.md) for more information.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Deploying continuously running applications # Kubernetes User Guide: Managing Applications: Deploying continuously running applications
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# kubectl for docker users # kubectl for docker users
In this doc, we introduce the kubernetes command line to for interacting with the api to docker-cli users. The tool, kubectl, is designed to be familiar to docker-cli users but there are a few necessary differences. Each section of this doc highlights a docker subcommand explains the kubectl equivalent. In this doc, we introduce the kubernetes command line to for interacting with the api to docker-cli users. The tool, kubectl, is designed to be familiar to docker-cli users but there are a few necessary differences. Each section of this doc highlights a docker subcommand explains the kubectl equivalent.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Downward API # Downward API
It is sometimes useful for a container to have information about itself, but we It is sometimes useful for a container to have information about itself, but we
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Downward API example # Downward API example
Following this example, you will create a pod with a containers that consumes the pod's name and Following this example, you will create a pod with a containers that consumes the pod's name and
......
...@@ -33,7 +33,8 @@ Documentation for other releases can be found at ...@@ -33,7 +33,8 @@ Documentation for other releases can be found at
#Getting into containers: kubectl exec #Getting into containers: kubectl exec
Developers can use `kubectl exec` to run commands in a container. This guide demonstrates two use cases. 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 ## Using kubectl exec to check the environment variables of a container
Kubernetes exposes [services](services.md#environment-variables) through environment variables. It is convenient to check these environment variables using `kubectl exec`. Kubernetes exposes [services](services.md#environment-variables) through environment variables. It is convenient to check these environment variables using `kubectl exec`.
...@@ -66,6 +67,7 @@ We can use these environment variables in applications to find the service. ...@@ -66,6 +67,7 @@ We can use these environment variables in applications to find the service.
## Using kubectl exec to check the mounted volumes ## Using kubectl exec to check the mounted volumes
It is convenient to use `kubectl exec` to check if the volumes are mounted as expected. 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, We first create a Pod with a volume mounted at /data/redis,
...@@ -89,6 +91,7 @@ redis ...@@ -89,6 +91,7 @@ redis
``` ```
## Using kubectl exec to open a bash terminal in a pod ## 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 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
``` ```
......
...@@ -30,15 +30,19 @@ Documentation for other releases can be found at ...@@ -30,15 +30,19 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Identifiers # Identifiers
All objects in the Kubernetes REST API are unambiguously identified by a Name and a UID. All objects in the Kubernetes REST API are unambiguously identified by a Name and a UID.
For non-unique user-provided attributes, Kubernetes provides [labels](labels.md) and [annotations](annotations.md). For non-unique user-provided attributes, Kubernetes provides [labels](labels.md) and [annotations](annotations.md).
## Names ## Names
Names are generally client-provided. Only one object of a given kind can have a given name at a time (i.e., they are spatially unique). But if you delete an object, you can make a new object with the same name. Names are the used to refer to an object in a resource URL, such as `/api/v1/pods/some-name`. By convention, the names of Kubernetes resources should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, `-`, and `.`, but certain resources have more specific restrictions. See the [identifiers design doc](../design/identifiers.md) for the precise syntax rules for names. Names are generally client-provided. Only one object of a given kind can have a given name at a time (i.e., they are spatially unique). But if you delete an object, you can make a new object with the same name. Names are the used to refer to an object in a resource URL, such as `/api/v1/pods/some-name`. By convention, the names of Kubernetes resources should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, `-`, and `.`, but certain resources have more specific restrictions. See the [identifiers design doc](../design/identifiers.md) for the precise syntax rules for names.
## UIDs ## UIDs
UID are generated by Kubernetes. Every object created over the whole lifetime of a Kubernetes cluster has a distinct UID (i.e., they are spatially and temporally unique). UID are generated by Kubernetes. Every object created over the whole lifetime of a Kubernetes cluster has a distinct UID (i.e., they are spatially and temporally unique).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Images # Images
Each container in a pod has its own image. Currently, the only type of image supported is a [Docker Image](https://docs.docker.com/userguide/dockerimages/). Each container in a pod has its own image. Currently, the only type of image supported is a [Docker Image](https://docs.docker.com/userguide/dockerimages/).
...@@ -251,6 +252,7 @@ You can use this in conjunction with a per-node `.dockerfile`. The credentials ...@@ -251,6 +252,7 @@ You can use this in conjunction with a per-node `.dockerfile`. The credentials
will be merged. This approach will work on Google Container Engine (GKE). will be merged. This approach will work on Google Container Engine (GKE).
### Use Cases ### Use Cases
There are a number of solutions for configuring private registries. Here are some There are a number of solutions for configuring private registries. Here are some
common use cases and suggested solutions. common use cases and suggested solutions.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Application Introspection and Debugging # Kubernetes User Guide: Managing Applications: Application Introspection and Debugging
Once your application is running, you’ll inevitably need to debug problems with it. Once your application is running, you’ll inevitably need to debug problems with it.
......
...@@ -30,12 +30,15 @@ Documentation for other releases can be found at ...@@ -30,12 +30,15 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# kubeconfig files # kubeconfig files
In order to easily switch between multiple clusters, a kubeconfig file was defined. This file contains a series of authentication mechanisms and cluster connection information associated with nicknames. It also introduces the concept of a tuple of authentication information (user) and cluster connection information called a context that is also associated with a nickname. In order to easily switch between multiple clusters, a kubeconfig file was defined. This file contains a series of authentication mechanisms and cluster connection information associated with nicknames. It also introduces the concept of a tuple of authentication information (user) and cluster connection information called a context that is also associated with a nickname.
Multiple kubeconfig files are allowed. At runtime they are loaded and merged together along with override options specified from the command line (see rules below). Multiple kubeconfig files are allowed. At runtime they are loaded and merged together along with override options specified from the command line (see rules below).
## Related discussion ## Related discussion
https://github.com/GoogleCloudPlatform/kubernetes/issues/1755 https://github.com/GoogleCloudPlatform/kubernetes/issues/1755
## Example kubeconfig file ## Example kubeconfig file
...@@ -81,6 +84,7 @@ users: ...@@ -81,6 +84,7 @@ users:
``` ```
## Loading and merging rules ## Loading and merging rules
The rules for loading and merging the kubeconfig files are straightforward, but there are a lot of them. The final config is built in this order: The rules for loading and merging the kubeconfig files are straightforward, but there are a lot of them. The final config is built in this order:
1. Get the kubeconfig from disk. This is done with the following hierarchy and merge rules: 1. Get the kubeconfig from disk. This is done with the following hierarchy and merge rules:
...@@ -115,6 +119,7 @@ The rules for loading and merging the kubeconfig files are straightforward, but ...@@ -115,6 +119,7 @@ The rules for loading and merging the kubeconfig files are straightforward, but
1. For any information still missing, use default values and potentially prompt for authentication information 1. For any information still missing, use default values and potentially prompt for authentication information
## Manipulation of kubeconfig via `kubectl config <subcommand>` ## Manipulation of kubeconfig via `kubectl config <subcommand>`
In order to more easily manipulate kubeconfig files, there are a series of subcommands to `kubectl config` to help. In order to more easily manipulate kubeconfig files, there are a series of subcommands to `kubectl config` to help.
See [kubectl/kubectl_config.md](kubectl/kubectl_config.md) for help. See [kubectl/kubectl_config.md](kubectl/kubectl_config.md) for help.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl ## kubectl
kubectl controls the Kubernetes cluster manager kubectl controls the Kubernetes cluster manager
...@@ -76,6 +77,7 @@ kubectl ...@@ -76,6 +77,7 @@ kubectl
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl api-versions](kubectl_api-versions.md) - Print available API versions. * [kubectl api-versions](kubectl_api-versions.md) - Print available API versions.
* [kubectl cluster-info](kubectl_cluster-info.md) - Display cluster info * [kubectl cluster-info](kubectl_cluster-info.md) - Display cluster info
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl api-versions ## kubectl api-versions
Print available API versions. Print available API versions.
...@@ -79,6 +80,7 @@ kubectl api-versions ...@@ -79,6 +80,7 @@ kubectl api-versions
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959722426 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959722426 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl cluster-info ## kubectl cluster-info
Display cluster info Display cluster info
...@@ -79,6 +80,7 @@ kubectl cluster-info ...@@ -79,6 +80,7 @@ kubectl cluster-info
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959601452 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959601452 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config ## kubectl config
config modifies kubeconfig files config modifies kubeconfig files
...@@ -85,6 +86,7 @@ kubectl config SUBCOMMAND ...@@ -85,6 +86,7 @@ kubectl config SUBCOMMAND
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
* [kubectl config set](kubectl_config_set.md) - Sets an individual value in a kubeconfig file * [kubectl config set](kubectl_config_set.md) - Sets an individual value in a kubeconfig file
* [kubectl config set-cluster](kubectl_config_set-cluster.md) - Sets a cluster entry in kubeconfig * [kubectl config set-cluster](kubectl_config_set-cluster.md) - Sets a cluster entry in kubeconfig
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config set-cluster ## kubectl config set-cluster
Sets a cluster entry in kubeconfig Sets a cluster entry in kubeconfig
...@@ -94,6 +95,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true ...@@ -94,6 +95,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.95861887 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.95861887 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config set-context ## kubectl config set-context
Sets a context entry in kubeconfig Sets a context entry in kubeconfig
...@@ -87,6 +88,7 @@ $ kubectl config set-context gce --user=cluster-admin ...@@ -87,6 +88,7 @@ $ kubectl config set-context gce --user=cluster-admin
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958911281 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958911281 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config set-credentials ## kubectl config set-credentials
Sets a user entry in kubeconfig Sets a user entry in kubeconfig
...@@ -107,6 +108,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi ...@@ -107,6 +108,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958785654 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958785654 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config set ## kubectl config set
Sets an individual value in a kubeconfig file Sets an individual value in a kubeconfig file
...@@ -81,6 +82,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE ...@@ -81,6 +82,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959031072 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959031072 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config unset ## kubectl config unset
Unsets an individual value in a kubeconfig file Unsets an individual value in a kubeconfig file
...@@ -80,6 +81,7 @@ kubectl config unset PROPERTY_NAME ...@@ -80,6 +81,7 @@ kubectl config unset PROPERTY_NAME
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959148086 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959148086 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config use-context ## kubectl config use-context
Sets the current-context in a kubeconfig file Sets the current-context in a kubeconfig file
...@@ -79,6 +80,7 @@ kubectl config use-context CONTEXT_NAME ...@@ -79,6 +80,7 @@ kubectl config use-context CONTEXT_NAME
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959263442 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959263442 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl config view ## kubectl config view
displays Merged kubeconfig settings or a specified kubeconfig file. displays Merged kubeconfig settings or a specified kubeconfig file.
...@@ -99,6 +100,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2 ...@@ -99,6 +100,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958490153 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958490153 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl create ## kubectl create
Create a resource by filename or stdin Create a resource by filename or stdin
...@@ -92,6 +93,7 @@ $ cat pod.json | kubectl create -f - ...@@ -92,6 +93,7 @@ $ cat pod.json | kubectl create -f -
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132575015 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132575015 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl delete ## kubectl delete
Delete a resource by filename, stdin, resource and name, or by resources and label selector. Delete a resource by filename, stdin, resource and name, or by resources and label selector.
...@@ -114,6 +115,7 @@ $ kubectl delete pods --all ...@@ -114,6 +115,7 @@ $ kubectl delete pods --all
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-16 05:13:00.190175769 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-16 05:13:00.190175769 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl describe ## kubectl describe
Show details of a specific resource or group of resources Show details of a specific resource or group of resources
...@@ -110,6 +111,7 @@ $ kubectl describe pods frontend ...@@ -110,6 +111,7 @@ $ kubectl describe pods frontend
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 08:21:33.374469932 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 08:21:33.374469932 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl exec ## kubectl exec
Execute a command in a container. Execute a command in a container.
...@@ -97,6 +98,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il ...@@ -97,6 +98,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956874128 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956874128 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl expose ## kubectl expose
Take a replicated application and expose it as Kubernetes Service Take a replicated application and expose it as Kubernetes Service
...@@ -113,6 +114,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream ...@@ -113,6 +114,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-17 01:17:57.020108348 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-17 01:17:57.020108348 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl get ## kubectl get
Display one or many resources Display one or many resources
...@@ -121,6 +122,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 ...@@ -121,6 +122,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.955450097 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.955450097 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl label ## kubectl label
Update the labels on a resource Update the labels on a resource
...@@ -111,6 +112,7 @@ $ kubectl label pods foo bar- ...@@ -111,6 +112,7 @@ $ kubectl label pods foo bar-
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958329854 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.958329854 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl logs ## kubectl logs
Print the logs for a container in a pod. Print the logs for a container in a pod.
...@@ -96,6 +97,7 @@ $ kubectl logs -f 123456-7890 ruby-container ...@@ -96,6 +97,7 @@ $ kubectl logs -f 123456-7890 ruby-container
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956443079 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956443079 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl namespace ## kubectl namespace
SUPERCEDED: Set and view the current Kubernetes namespace SUPERCEDED: Set and view the current Kubernetes namespace
...@@ -82,6 +83,7 @@ kubectl namespace [namespace] ...@@ -82,6 +83,7 @@ kubectl namespace [namespace]
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956297427 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956297427 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl patch ## kubectl patch
Update field(s) of a resource by stdin. Update field(s) of a resource by stdin.
...@@ -90,6 +91,7 @@ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}' ...@@ -90,6 +91,7 @@ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956026887 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956026887 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl port-forward ## kubectl port-forward
Forward one or more local ports to a pod. Forward one or more local ports to a pod.
...@@ -97,6 +98,7 @@ $ kubectl port-forward -p mypod 0:5000 ...@@ -97,6 +98,7 @@ $ kubectl port-forward -p mypod 0:5000
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957000233 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957000233 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl proxy ## kubectl proxy
Run a proxy to the Kubernetes API server Run a proxy to the Kubernetes API server
...@@ -114,6 +115,7 @@ $ kubectl proxy --api-prefix=/k8s-api ...@@ -114,6 +115,7 @@ $ kubectl proxy --api-prefix=/k8s-api
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957150329 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957150329 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl replace ## kubectl replace
Replace a resource by filename or stdin. Replace a resource by filename or stdin.
...@@ -99,6 +100,7 @@ kubectl replace --force -f ./pod.json ...@@ -99,6 +100,7 @@ kubectl replace --force -f ./pod.json
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132838722 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132838722 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl rolling-update ## kubectl rolling-update
Perform a rolling update of the given ReplicationController. Perform a rolling update of the given ReplicationController.
...@@ -113,6 +114,7 @@ $ kubectl rolling-update frontend --image=image:v2 ...@@ -113,6 +114,7 @@ $ kubectl rolling-update frontend --image=image:v2
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956605022 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956605022 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl run ## kubectl run
Run a particular image on the cluster. Run a particular image on the cluster.
...@@ -108,6 +109,7 @@ $ kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { . ...@@ -108,6 +109,7 @@ $ kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { .
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957298888 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957298888 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl scale ## kubectl scale
Set a new size for a Replication Controller. Set a new size for a Replication Controller.
...@@ -97,6 +98,7 @@ $ kubectl scale --current-replicas=2 --replicas=3 replicationcontrollers foo ...@@ -97,6 +98,7 @@ $ kubectl scale --current-replicas=2 --replicas=3 replicationcontrollers foo
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956739933 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956739933 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl stop ## kubectl stop
Gracefully shut down a resource by name or filename. Gracefully shut down a resource by name or filename.
...@@ -104,6 +105,7 @@ $ kubectl stop -f path/to/resources ...@@ -104,6 +105,7 @@ $ kubectl stop -f path/to/resources
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957441942 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.957441942 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## kubectl version ## kubectl version
Print the client and server version information. Print the client and server version information.
...@@ -80,6 +81,7 @@ kubectl version ...@@ -80,6 +81,7 @@ kubectl version
``` ```
### SEE ALSO ### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959846454 +0000 UTC ###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.959846454 +0000 UTC
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Labels # Labels
_Labels_ are key/value pairs that are attached to objects, such as pods. _Labels_ are key/value pairs that are attached to objects, such as pods.
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Overview ## Overview
This example shows two types of pod [health checks](../production-pods.md#liveness-and-readiness-probes-aka-health-checks): HTTP checks and container execution checks. This example shows two types of pod [health checks](../production-pods.md#liveness-and-readiness-probes-aka-health-checks): HTTP checks and container execution checks.
The [exec-liveness.yaml](exec-liveness.yaml) demonstrates the container execution check. The [exec-liveness.yaml](exec-liveness.yaml) demonstrates the container execution check.
...@@ -72,6 +74,7 @@ The Kubelet sends a HTTP request to the specified path and port to perform the h ...@@ -72,6 +74,7 @@ The Kubelet sends a HTTP request to the specified path and port to perform the h
This [guide](../walkthrough/k8s201.md#health-checking) has more information on health checks. This [guide](../walkthrough/k8s201.md#health-checking) has more information on health checks.
## Get your hands dirty ## Get your hands dirty
To show the health check is actually working, first create the pods: To show the health check is actually working, first create the pods:
``` ```
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Elasticsearch/Kibana Logging Demonstration # Elasticsearch/Kibana Logging Demonstration
This directory contains two [pod](../../../docs/user-guide/pods.md) specifications which can be used as synthetic This directory contains two [pod](../../../docs/user-guide/pods.md) specifications which can be used as synthetic
logging sources. The pod specification in [synthetic_0_25lps.yaml](synthetic_0_25lps.yaml) logging sources. The pod specification in [synthetic_0_25lps.yaml](synthetic_0_25lps.yaml)
describes a pod that just emits a log message once every 4 seconds. The pod specification in describes a pod that just emits a log message once every 4 seconds. The pod specification in
......
...@@ -30,12 +30,15 @@ Documentation for other releases can be found at ...@@ -30,12 +30,15 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Logging # Logging
## Logging by Kubernetes Components ## 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](../devel/logging.md). 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](../devel/logging.md).
## Examining the logs of running containers ## Examining the logs of running containers
The logs of a running container may be fetched using the command `kubectl logs`. For example, given The logs of a running container may be fetched using the command `kubectl logs`. For example, given
this pod specification [counter-pod.yaml](../../examples/blog-logging/counter-pod.yaml), which has a container which writes out some text to standard this pod specification [counter-pod.yaml](../../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](logging-demo/).) output every second. (You can find different pod specifications [here](logging-demo/).)
...@@ -95,15 +98,18 @@ $ kubectl logs kube-dns-v3-7r1l9 etcd ...@@ -95,15 +98,18 @@ $ kubectl logs kube-dns-v3-7r1l9 etcd
``` ```
## Cluster level logging to Google Cloud Logging ## Cluster level logging to Google Cloud Logging
The getting started guide [Cluster Level Logging to Google Cloud Logging](../getting-started-guides/logging.md) The getting started guide [Cluster Level Logging to Google Cloud Logging](../getting-started-guides/logging.md)
explains how container logs are ingested into [Google Cloud Logging](https://cloud.google.com/logging/docs/) explains how container logs are ingested into [Google Cloud Logging](https://cloud.google.com/logging/docs/)
and shows how to query the ingested logs. and shows how to query the ingested logs.
## Cluster level logging with Elasticsearch and Kibana ## Cluster level logging with Elasticsearch and Kibana
The getting started guide [Cluster Level Logging with Elasticsearch and Kibana](../getting-started-guides/logging-elasticsearch.md) The getting started guide [Cluster Level Logging with Elasticsearch and Kibana](../getting-started-guides/logging-elasticsearch.md)
describes how to ingest cluster level logs into Elasticsearch and view them using Kibana. describes how to ingest cluster level logs into Elasticsearch and view them using Kibana.
## Ingesting Application Log Files ## Ingesting Application Log Files
Cluster level logging only collects the standard output and standard error output of the applications Cluster level logging only collects the standard output and standard error output of the applications
running in containers. The guide [Collecting log files within containers with Fluentd](../../contrib/logging/fluentd-sidecar-gcp/README.md) explains how the log files of applications can also be ingested into Google Cloud logging. running in containers. The guide [Collecting log files within containers with Fluentd](../../contrib/logging/fluentd-sidecar-gcp/README.md) explains how the log files of applications can also be ingested into Google Cloud logging.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Managing deployments # Kubernetes User Guide: Managing Applications: Managing deployments
You’ve deployed your application and exposed it via a service. Now what? Kubernetes provides a number of tools to help you manage your application deployment, including scaling and updating. Among the features we’ll discuss in more depth are [configuration files](configuring-containers.md#configuration-in-kubernetes) and [labels](deploying-applications.md#labels). You’ve deployed your application and exposed it via a service. Now what? Kubernetes provides a number of tools to help you manage your application deployment, including scaling and updating. Among the features we’ll discuss in more depth are [configuration files](configuring-containers.md#configuration-in-kubernetes) and [labels](deploying-applications.md#labels).
...@@ -436,6 +437,7 @@ $ rm $TMP ...@@ -436,6 +437,7 @@ $ rm $TMP
``` ```
The system ensures that you don’t clobber changes made by other users or components by confirming that the `resourceVersion` doesn’t differ from the version you edited. If you want to update regardless of other changes, remove the `resourceVersion` field when you edit the resource. However, if you do this, don’t use your original configuration file as the source since additional fields most likely were set in the live state. The system ensures that you don’t clobber changes made by other users or components by confirming that the `resourceVersion` doesn’t differ from the version you edited. If you want to update regardless of other changes, remove the `resourceVersion` field when you edit the resource. However, if you do this, don’t use your original configuration file as the source since additional fields most likely were set in the live state.
## Disruptive updates ## Disruptive updates
In some cases, you may need to update resource fields that cannot be updated once initialized, or you may just want to make a recursive change immediately, such as to fix broken pods created by a replication controller. To change such fields, use `replace --force`, which deletes and re-creates the resource. In this case, you can simply modify your original configuration file: In some cases, you may need to update resource fields that cannot be updated once initialized, or you may just want to make a recursive change immediately, such as to fix broken pods created by a replication controller. To change such fields, use `replace --force`, which deletes and re-creates the resource. In this case, you can simply modify your original configuration file:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Resource Usage Monitoring in Kubernetes # Resource Usage Monitoring in Kubernetes
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](pods.md), [services](services.md), 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/GoogleCloudPlatform/heapster), a project meant to provide a base monitoring platform on Kubernetes. 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](pods.md), [services](services.md), 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/GoogleCloudPlatform/heapster), a project meant to provide a base monitoring platform on Kubernetes.
...@@ -55,6 +56,7 @@ On most Kubernetes clusters, cAdvisor exposes a simple UI for on-machine contain ...@@ -55,6 +56,7 @@ On most Kubernetes clusters, cAdvisor exposes a simple UI for on-machine contain
The Kubelet acts as a bridge between the Kubernetes master and the nodes. It manages the pods and containers running on a machine. Kubelet translates each pod into its constituent containers and fetches individual container usage statistics from cAdvisor. It then exposes the aggregated pod resource usage statistics via a REST API. The Kubelet acts as a bridge between the Kubernetes master and the nodes. It manages the pods and containers running on a machine. Kubelet translates each pod into its constituent containers and fetches individual container usage statistics from cAdvisor. It then exposes the aggregated pod resource usage statistics via a REST API.
## Storage Backends ## Storage Backends
### InfluxDB and Grafana ### InfluxDB and Grafana
A Grafana setup with InfluxDB is a very popular combination for monitoring in the open source world. InfluxDB exposes an easy to use API to write and fetch time series data. Heapster is setup to use this storage backend by default on most kubernetes clusters. A detailed setup guide can be found [here](https://github.com/GoogleCloudPlatform/heapster/blob/master/docs/influxdb.md). InfluxDB and Grafana run in Pods. The pod exposes itself as a Kubernetes service which is how Heapster discovers it. A Grafana setup with InfluxDB is a very popular combination for monitoring in the open source world. InfluxDB exposes an easy to use API to write and fetch time series data. Heapster is setup to use this storage backend by default on most kubernetes clusters. A detailed setup guide can be found [here](https://github.com/GoogleCloudPlatform/heapster/blob/master/docs/influxdb.md). InfluxDB and Grafana run in Pods. The pod exposes itself as a Kubernetes service which is how Heapster discovers it.
...@@ -82,6 +84,7 @@ Here is a snapshot of the a Google Cloud Monitoring dashboard showing cluster-wi ...@@ -82,6 +84,7 @@ Here is a snapshot of the a Google Cloud Monitoring dashboard showing cluster-wi
![Google Cloud Monitoring dashboard](gcm.png) ![Google Cloud Monitoring dashboard](gcm.png)
## Try it out! ## Try it out!
Now that you’ve learned a bit about Heapster, feel free to try it out on your own clusters! The [Heapster repository](https://github.com/GoogleCloudPlatform/heapster) is available on GitHub. It contains detailed instructions to setup Heapster and its storage backends. Heapster runs by default on most Kubernetes clusters, so you may already have it! Feedback is always welcome. Please let us know if you run into any issues. Heapster and Kubernetes developers hang out in the [#google-containers](http://webchat.freenode.net/?channels=google-containers) IRC channel on freenode.net. You can also reach us on the [google-containers Google Groups mailing list](https://groups.google.com/forum/#!forum/google-containers). Now that you’ve learned a bit about Heapster, feel free to try it out on your own clusters! The [Heapster repository](https://github.com/GoogleCloudPlatform/heapster) is available on GitHub. It contains detailed instructions to setup Heapster and its storage backends. Heapster runs by default on most Kubernetes clusters, so you may already have it! Feedback is always welcome. Please let us know if you run into any issues. Heapster and Kubernetes developers hang out in the [#google-containers](http://webchat.freenode.net/?channels=google-containers) IRC channel on freenode.net. You can also reach us on the [google-containers Google Groups mailing list](https://groups.google.com/forum/#!forum/google-containers).
*** ***
......
...@@ -74,6 +74,7 @@ The Namespace provides a unique scope for: ...@@ -74,6 +74,7 @@ The Namespace provides a unique scope for:
Look [here](namespaces/) for an in depth example of namespaces. Look [here](namespaces/) for an in depth example of namespaces.
### Viewing namespaces ### Viewing namespaces
You can list the current namespaces in a cluster using: You can list the current namespaces in a cluster using:
```sh ```sh
...@@ -187,6 +188,7 @@ kubectl delete namespaces <insert-some-namespace-name> ...@@ -187,6 +188,7 @@ kubectl delete namespaces <insert-some-namespace-name>
This delete is asynchronous, so for a time you will see the namespace in the ```Terminating``` state. This delete is asynchronous, so for a time you will see the namespace in the ```Terminating``` state.
## Namespaces and DNS ## Namespaces and DNS
When you create a [Service](services.md), it creates a corresponding [DNS entry](../admin/dns.md)1. When you create a [Service](services.md), it creates a corresponding [DNS entry](../admin/dns.md)1.
This entry is of the form ```<service-name>.<namespace-name>.cluster.local```, which means This entry is of the form ```<service-name>.<namespace-name>.cluster.local```, which means
that if a container just uses ```<service-name>``` it will resolve to the service which that if a container just uses ```<service-name>``` it will resolve to the service which
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Kubernetes Namespaces ## Kubernetes Namespaces
Kubernetes _[namespaces](../namespaces.md)_ help different projects, teams, or customers to share a Kubernetes cluster. Kubernetes _[namespaces](../namespaces.md)_ help different projects, teams, or customers to share a Kubernetes cluster.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Node selection example ## Node selection example
This example shows how to assign a [pod](../pods.md) to a specific [node](../../admin/node.md) or to one of a set of nodes using node labels and the nodeSelector field in a pod specification. Generally this is unnecessary, as the scheduler will take care of things for you, but you may want to do so in certain circumstances like to ensure that your pod ends up on a machine with an SSD attached to it. This example shows how to assign a [pod](../pods.md) to a specific [node](../../admin/node.md) or to one of a set of nodes using node labels and the nodeSelector field in a pod specification. Generally this is unnecessary, as the scheduler will take care of things for you, but you may want to do so in certain circumstances like to ensure that your pod ends up on a machine with an SSD attached to it.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Overview # Kubernetes Overview
Kubernetes is an open-source system for managing containerized applications across multiple hosts in a cluster. It provides mechanisms for application deployment, scheduling, updating, maintenance, and scaling. A key feature of Kubernetes is that it actively manages the containers to ensure that the state of the cluster continually matches the user's intentions. Kubernetes is an open-source system for managing containerized applications across multiple hosts in a cluster. It provides mechanisms for application deployment, scheduling, updating, maintenance, and scaling. A key feature of Kubernetes is that it actively manages the containers to ensure that the state of the cluster continually matches the user's intentions.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Persistent Volumes and Claims # Persistent Volumes and Claims
This document describes the current state of `PersistentVolumes` in Kubernetes. Familiarity with [volumes](volumes.md) is suggested. This document describes the current state of `PersistentVolumes` in Kubernetes. Familiarity with [volumes](volumes.md) is suggested.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# How To Use Persistent Volumes # How To Use Persistent Volumes
The purpose of this guide is to help you become familiar with [Kubernetes Persistent Volumes](../persistent-volumes.md). By the end of the guide, we'll have The purpose of this guide is to help you become familiar with [Kubernetes Persistent Volumes](../persistent-volumes.md). By the end of the guide, we'll have
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# The life of a pod # The life of a pod
Updated: 4/14/2015 Updated: 4/14/2015
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Pods # Pods
In Kubernetes, rather than individual application containers, _pods_ are the smallest deployable units that can be created, scheduled, and managed. In Kubernetes, rather than individual application containers, _pods_ are the smallest deployable units that can be created, scheduled, and managed.
......
...@@ -30,10 +30,13 @@ Documentation for other releases can be found at ...@@ -30,10 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Prerequisites # Kubernetes User Guide: Managing Applications: Prerequisites
To deploy and manage applications on Kubernetes, you’ll use the Kubernetes command-line tool, [kubectl](kubectl/kubectl.md). It lets you inspect your cluster resources, create, delete, and update components, and much more. You will use it to look at your new cluster and bring up example apps. To deploy and manage applications on Kubernetes, you’ll use the Kubernetes command-line tool, [kubectl](kubectl/kubectl.md). It lets you inspect your cluster resources, create, delete, and update components, and much more. You will use it to look at your new cluster and bring up example apps.
##Install kubectl ## Install kubectl
You can find it in the [release](https://github.com/GoogleCloudPlatform/kubernetes/releases) tar bundle, under platforms/<os>/<arch>; You can find it in the [release](https://github.com/GoogleCloudPlatform/kubernetes/releases) tar bundle, under platforms/<os>/<arch>;
or if you build from source, kubectl should be either under _output/local/bin/<os>/<arch> or _output/dockerized/bin/<os>/<arch>. or if you build from source, kubectl should be either under _output/local/bin/<os>/<arch> or _output/dockerized/bin/<os>/<arch>.
...@@ -47,7 +50,8 @@ export PATH=<path/to/kubernetes-directory>/platforms/darwin/amd64:$PATH ...@@ -47,7 +50,8 @@ export PATH=<path/to/kubernetes-directory>/platforms/darwin/amd64:$PATH
export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH
``` ```
##Configure kubectl ## Configure kubectl
In order for kubectl to find and access the Kubernetes cluster, it needs a [kubeconfig file](kubeconfig-file.md), which is created automatically when creating a cluster using kube-up.sh (see the [getting started guides](../../docs/getting-started-guides/) for more about creating clusters). If you need access to a cluster you didn’t create, see the [Sharing Cluster Access document](sharing-clusters.md). In order for kubectl to find and access the Kubernetes cluster, it needs a [kubeconfig file](kubeconfig-file.md), which is created automatically when creating a cluster using kube-up.sh (see the [getting started guides](../../docs/getting-started-guides/) for more about creating clusters). If you need access to a cluster you didn’t create, see the [Sharing Cluster Access document](sharing-clusters.md).
#### Installing Kubectl #### Installing Kubectl
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Working with pods and containers in production # Kubernetes User Guide: Managing Applications: Working with pods and containers in production
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Guide: Managing Applications: Quick start # Kubernetes User Guide: Managing Applications: Quick start
**Table of Contents** **Table of Contents**
...@@ -67,7 +68,9 @@ my-nginx-q7jo3 1/1 Running 0 29m ...@@ -67,7 +68,9 @@ my-nginx-q7jo3 1/1 Running 0 29m
``` ```
Kubernetes will ensure that your application keeps running, by automatically restarting containers that fail, spreading containers across nodes, and recreating containers on new nodes when nodes fail. Kubernetes will ensure that your application keeps running, by automatically restarting containers that fail, spreading containers across nodes, and recreating containers on new nodes when nodes fail.
## Exposing your application to the Internet ## Exposing your application to the Internet
Through integration with some cloud providers (for example Google Compute Engine and AWS EC2), Kubernetes enables you to request that it provision a public IP address for your application. To do this run: Through integration with some cloud providers (for example Google Compute Engine and AWS EC2), Kubernetes enables you to request that it provision a public IP address for your application. To do this run:
```bash ```bash
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Replication Controller # Replication Controller
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Secrets # Secrets
Objects of type `secret` are intended to hold sensitive information, such as Objects of type `secret` are intended to hold sensitive information, such as
...@@ -157,7 +158,9 @@ whichever is convenient. ...@@ -157,7 +158,9 @@ whichever is convenient.
See another example of creating a secret and a pod that consumes that secret in a volume [here](secrets/). See another example of creating a secret and a pod that consumes that secret in a volume [here](secrets/).
### Manually specifying an imagePullSecret ### Manually specifying an imagePullSecret
Use of imagePullSecrets is desribed in the [images documentation](images.md#specifying-imagepullsecrets-on-a-pod) Use of imagePullSecrets is desribed in the [images documentation](images.md#specifying-imagepullsecrets-on-a-pod)
### Automatic use of Manually Created Secrets ### Automatic use of Manually Created Secrets
*This feature is planned but not implemented. See [issue *This feature is planned but not implemented. See [issue
...@@ -169,7 +172,9 @@ Then, pods which use that service account will have ...@@ -169,7 +172,9 @@ Then, pods which use that service account will have
The secrets will be mounted at **TBD**. The secrets will be mounted at **TBD**.
## Details ## Details
### Restrictions ### Restrictions
Secret volume sources are validated to ensure that the specified object Secret volume sources are validated to ensure that the specified object
reference actually points to an object of type `Secret`. Therefore, a secret reference actually points to an object of type `Secret`. Therefore, a secret
needs to be created before any pods that depend on it. needs to be created before any pods that depend on it.
...@@ -461,6 +466,7 @@ one called, say, `prod-user` with the `prod-db-secret`, and one called, say, ...@@ -461,6 +466,7 @@ one called, say, `prod-user` with the `prod-db-secret`, and one called, say,
``` ```
### Use-case: Secret visible to one container in a pod ### Use-case: Secret visible to one container in a pod
<a name="use-case-two-containers"></a> <a name="use-case-two-containers"></a>
Consider a program that needs to handle HTTP requests, do some complex business Consider a program that needs to handle HTTP requests, do some complex business
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Secrets example # Secrets example
Following this example, you will create a [secret](../secrets.md) and a [pod](../pods.md) that consumes that secret in a [volume](../volumes.md). See [Secrets design document](../../design/secrets.md) for more information. Following this example, you will create a [secret](../secrets.md) and a [pod](../pods.md) that consumes that secret in a [volume](../volumes.md). See [Secrets design document](../../design/secrets.md) for more information.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Security Contexts # Security Contexts
A security context defines the operating system security settings (uid, gid, capabilities, SELinux role, etc..) applied to a container. See [security context design](../design/security_context.md) for more details. A security context defines the operating system security settings (uid, gid, capabilities, SELinux role, etc..) applied to a container. See [security context design](../design/security_context.md) for more details.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Service Accounts # Service Accounts
A service account provides an identity for processes that run in a Pod. A service account provides an identity for processes that run in a Pod.
...@@ -121,6 +122,7 @@ $ kubectl delete serviceaccount/build-robot ...@@ -121,6 +122,7 @@ $ kubectl delete serviceaccount/build-robot
<!-- TODO: describe how to create a pod with no Service Account. --> <!-- TODO: describe how to create a pod with no Service Account. -->
## Adding Secrets to a service account. ## Adding Secrets to a service account.
TODO: Test and explain how to use additional non-K8s secrets with an existing service account. TODO: Test and explain how to use additional non-K8s secrets with an existing service account.
TODO explain: TODO explain:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Services and Firewalls # Services and Firewalls
Many cloud providers (e.g. Google Compute Engine) define firewalls that help keep prevent inadvertent Many cloud providers (e.g. Google Compute Engine) define firewalls that help keep prevent inadvertent
...@@ -39,6 +40,7 @@ well as any provider specific details that may be necessary. ...@@ -39,6 +40,7 @@ well as any provider specific details that may be necessary.
### Google Compute Engine ### Google Compute Engine
When using a Service with `spec.type: LoadBalancer`, the firewall will be When using a Service with `spec.type: LoadBalancer`, the firewall will be
opened automatically. When using `spec.type: NodePort`, however, the firewall opened automatically. When using `spec.type: NodePort`, however, the firewall
is *not* opened by default. is *not* opened by default.
...@@ -77,6 +79,7 @@ the wilds of the internet. ...@@ -77,6 +79,7 @@ the wilds of the internet.
This will be fixed in an upcoming release of Kubernetes. This will be fixed in an upcoming release of Kubernetes.
### Other cloud providers ### Other cloud providers
Coming soon. Coming soon.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Services in Kubernetes # Services in Kubernetes
**Table of Contents** **Table of Contents**
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Sharing Cluster Access # Sharing Cluster Access
Client access to a running kubernetes cluster can be shared by copying Client access to a running kubernetes cluster can be shared by copying
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Running your first containers in Kubernetes ## Running your first containers in Kubernetes
Ok, you've run one of the [getting started guides](../../docs/getting-started-guides/) and you have Ok, you've run one of the [getting started guides](../../docs/getting-started-guides/) and you have
...@@ -65,6 +66,7 @@ kubectl stop rc my-nginx ...@@ -65,6 +66,7 @@ kubectl stop rc my-nginx
``` ```
### Exposing your pods to the internet. ### Exposing your pods to the internet.
On some platforms (for example Google Compute Engine) the kubectl command can integrate with your cloud provider to add a [public IP address](services.md#external-services) for the pods, On some platforms (for example Google Compute Engine) the kubectl command can integrate with your cloud provider to add a [public IP address](services.md#external-services) for the pods,
to do this run: to do this run:
...@@ -81,6 +83,7 @@ kubectl get services ...@@ -81,6 +83,7 @@ kubectl get services
In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80. In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80.
### Next: Configuration files ### Next: Configuration files
Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](simple-yaml.md) Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](simple-yaml.md)
is given in a different document. is given in a different document.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Getting started with config files. ## Getting started with config files.
In addition to the imperative style commands described [elsewhere](simple-nginx.md), Kubernetes In addition to the imperative style commands described [elsewhere](simple-nginx.md), Kubernetes
...@@ -74,6 +75,7 @@ kubectl delete pods nginx ...@@ -74,6 +75,7 @@ kubectl delete pods nginx
``` ```
### Running a replicated set of containers from a configuration file ### Running a replicated set of containers from a configuration file
To run replicated containers, you need a [Replication Controller](replication-controller.md). To run replicated containers, you need a [Replication Controller](replication-controller.md).
A replication controller is responsible for ensuring that a specific number of pods exist in the A replication controller is responsible for ensuring that a specific number of pods exist in the
cluster. cluster.
......
...@@ -30,10 +30,13 @@ Documentation for other releases can be found at ...@@ -30,10 +30,13 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes User Interface # Kubernetes User Interface
Kubernetes has a web-based user interface that displays the current cluster state graphically. Kubernetes has a web-based user interface that displays the current cluster state graphically.
## Accessing the UI ## Accessing the UI
By default, the Kubernetes UI is deployed as a cluster addon. To access it, visit `https://<kubernetes-master>/ui`, which redirects to `https://<kubernetes-master>/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/`. By default, the Kubernetes UI is deployed as a cluster addon. To access it, visit `https://<kubernetes-master>/ui`, which redirects to `https://<kubernetes-master>/api/v1/proxy/namespaces/kube-system/services/kube-ui/#/dashboard/`.
If you find that you're not able to access the UI, it may be because the kube-ui service has not been started on your cluster. In that case, you can start it manually with: If you find that you're not able to access the UI, it may be because the kube-ui service has not been started on your cluster. In that case, you can start it manually with:
...@@ -46,16 +49,20 @@ kubectl create -f cluster/addons/kube-ui/kube-ui-svc.yaml --namespace=kube-syste ...@@ -46,16 +49,20 @@ kubectl create -f cluster/addons/kube-ui/kube-ui-svc.yaml --namespace=kube-syste
Normally, this should be taken care of automatically by the [`kube-addons.sh`](../../cluster/saltbase/salt/kube-addons/kube-addons.sh) script that runs on the master. Normally, this should be taken care of automatically by the [`kube-addons.sh`](../../cluster/saltbase/salt/kube-addons/kube-addons.sh) script that runs on the master.
## Using the UI ## Using the UI
The Kubernetes UI can be used to introspect your current cluster, such as checking how resources are used, or looking at error messages. You cannot, however, use the UI to modify your cluster. The Kubernetes UI can be used to introspect your current cluster, such as checking how resources are used, or looking at error messages. You cannot, however, use the UI to modify your cluster.
### Node Resource Usage ### Node Resource Usage
After accessing Kubernetes UI, you'll see a homepage dynamically listing out all nodes in your current cluster, with related information including internal IP addresses, CPU usage, memory usage, and file systems usage. After accessing Kubernetes UI, you'll see a homepage dynamically listing out all nodes in your current cluster, with related information including internal IP addresses, CPU usage, memory usage, and file systems usage.
![kubernetes UI home page](k8s-ui-overview.png) ![kubernetes UI home page](k8s-ui-overview.png)
### Dashboard Views ### Dashboard Views
Click on the "Views" button in the top-right of the page to see other views available, which include: Explore, Pods, Nodes, Replication Controllers, Services, and Events. Click on the "Views" button in the top-right of the page to see other views available, which include: Explore, Pods, Nodes, Replication Controllers, Services, and Events.
#### Explore View #### Explore View
The "Explore" view allows your to see the pods, replication controllers, and services in current cluster easily. The "Explore" view allows your to see the pods, replication controllers, and services in current cluster easily.
![kubernetes UI Explore View](k8s-ui-explore.png) ![kubernetes UI Explore View](k8s-ui-explore.png)
The "Group by" dropdown list allows you to group these resources by a number of factors, such as type, name, host, etc. The "Group by" dropdown list allows you to group these resources by a number of factors, such as type, name, host, etc.
...@@ -66,10 +73,12 @@ To see more details of each resource instance, simply click on it. ...@@ -66,10 +73,12 @@ To see more details of each resource instance, simply click on it.
![kubernetes UI - Pod](k8s-ui-explore-poddetail.png) ![kubernetes UI - Pod](k8s-ui-explore-poddetail.png)
### Other Views ### Other Views
Other views (Pods, Nodes, Replication Controllers, Services, and Events) simply list information about each type of resource. You can also click on any instance for more details. Other views (Pods, Nodes, Replication Controllers, Services, and Events) simply list information about each type of resource. You can also click on any instance for more details.
![kubernetes UI - Nodes](k8s-ui-nodes.png) ![kubernetes UI - Nodes](k8s-ui-nodes.png)
## More Information ## More Information
For more information, see the [Kubernetes UI development document](../../www/README.md) in the www directory. For more information, see the [Kubernetes UI development document](../../www/README.md) in the www directory.
......
...@@ -46,7 +46,9 @@ See the License for the specific language governing permissions and ...@@ -46,7 +46,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
# Rolling update example # Rolling update example
This example demonstrates the usage of Kubernetes to perform a [rolling update](../kubectl/kubectl_rolling-update.md) on a running group of [pods](../../../docs/user-guide/pods.md). See [here](../managing-deployments.md#updating-your-application-without-a-service-outage) to understand why you need a rolling update. Also check [rolling update design document](../../design/simple-rolling-update.md) for more information. This example demonstrates the usage of Kubernetes to perform a [rolling update](../kubectl/kubectl_rolling-update.md) on a running group of [pods](../../../docs/user-guide/pods.md). See [here](../managing-deployments.md#updating-your-application-without-a-service-outage) to understand why you need a rolling update. Also check [rolling update design document](../../design/simple-rolling-update.md) for more information.
### Step Zero: Prerequisites ### Step Zero: Prerequisites
...@@ -74,6 +76,7 @@ I0218 15:18:31.623279 67480 proxy.go:36] Starting to serve on localhost:8001 ...@@ -74,6 +76,7 @@ I0218 15:18:31.623279 67480 proxy.go:36] Starting to serve on localhost:8001
Now visit the the [demo website](http://localhost:8001/static). You won't see anything much quite yet. Now visit the the [demo website](http://localhost:8001/static). You won't see anything much quite yet.
### Step Two: Run the replication controller ### Step Two: Run the replication controller
Now we will turn up two replicas of an [image](../images.md). They all serve on internal port 80. Now we will turn up two replicas of an [image](../images.md). They all serve on internal port 80.
```bash ```bash
...@@ -93,6 +96,7 @@ $ kubectl scale rc update-demo-nautilus --replicas=4 ...@@ -93,6 +96,7 @@ $ kubectl scale rc update-demo-nautilus --replicas=4
If you go back to the [demo website](http://localhost:8001/static/index.html) you should eventually see four boxes, one for each pod. If you go back to the [demo website](http://localhost:8001/static/index.html) you should eventually see four boxes, one for each pod.
### Step Four: Update the docker image ### Step Four: Update the docker image
We will now update the docker image to serve a different image by doing a rolling update to a new Docker image. We will now update the docker image to serve a different image by doing a rolling update to a new Docker image.
```bash ```bash
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Volumes # Volumes
On-disk files in a container are ephemeral, which presents some problems for On-disk files in a container are ephemeral, which presents some problems for
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes 101 - Kubectl CLI and Pods # Kubernetes 101 - Kubectl CLI and Pods
For Kubernetes 101, we will cover kubectl, pods, volumes, and multiple containers For Kubernetes 101, we will cover kubectl, pods, volumes, and multiple containers
...@@ -59,6 +60,7 @@ For more info about kubectl, including its usage, commands, and parameters, see ...@@ -59,6 +60,7 @@ For more info about kubectl, including its usage, commands, and parameters, see
If you haven't installed and configured kubectl, finish the [prerequisites](../prereqs.md) before continuing. If you haven't installed and configured kubectl, finish the [prerequisites](../prereqs.md) before continuing.
## Pods ## Pods
In Kubernetes, a group of one or more containers is called a _pod_. Containers in a pod are deployed together, and are started, stopped, and replicated as a group. In Kubernetes, a group of one or more containers is called a _pod_. Containers in a pod are deployed together, and are started, stopped, and replicated as a group.
See [pods](../../../docs/user-guide/pods.md) for more details. See [pods](../../../docs/user-guide/pods.md) for more details.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes 201 - Labels, Replication Controllers, Services and Health Checking # Kubernetes 201 - Labels, Replication Controllers, Services and Health Checking
If you went through [Kubernetes 101](README.md), you learned about kubectl, pods, volumes, and multiple containers. If you went through [Kubernetes 101](README.md), you learned about kubectl, pods, volumes, and multiple containers.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Working with Resources # Working with Resources
*This document is aimed at users who have worked through some of the examples, *This document is aimed at users who have worked through some of the examples,
...@@ -40,6 +41,7 @@ refer to the [api conventions](../devel/api-conventions.md) and ...@@ -40,6 +41,7 @@ refer to the [api conventions](../devel/api-conventions.md) and
the [api document](../api.md).* the [api document](../api.md).*
## Resources are Automatically Modified ## Resources are Automatically Modified
When you create a resource such as pod, and then retrieve the created When you create a resource such as pod, and then retrieve the created
resource, a number of the fields of the resource are added. resource, a number of the fields of the resource are added.
You can see this at work in the following example: You can see this at work in the following example:
...@@ -78,6 +80,7 @@ The system adds fields in several ways: ...@@ -78,6 +80,7 @@ The system adds fields in several ways:
The API will generally not modify fields that you have set; it just sets ones which were unspecified. The API will generally not modify fields that you have set; it just sets ones which were unspecified.
## <a name="finding_schema_docs"></a>Finding Documentation on Resource Fields ## <a name="finding_schema_docs"></a>Finding Documentation on Resource Fields
You can browse auto-generated API documentation at the [project website](http://kubernetes.io/third_party/swagger-ui/) or directly from your cluster, like this: You can browse auto-generated API documentation at the [project website](http://kubernetes.io/third_party/swagger-ui/) or directly from your cluster, like this:
- Run `kubectl proxy --api-prefix=/` - Run `kubectl proxy --api-prefix=/`
- Go to `http://localhost:8001/swagger-ui` in your browser. - Go to `http://localhost:8001/swagger-ui` in your browser.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubernetes Examples: releases.k8s.io/HEAD # Kubernetes Examples: releases.k8s.io/HEAD
This directory contains a number of different examples of how to run This directory contains a number of different examples of how to run
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Diagrams for Cloud Logging Blog Article # Diagrams for Cloud Logging Blog Article
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Cloud Native Deployments of Cassandra using Kubernetes ## Cloud Native Deployments of Cassandra using Kubernetes
The following document describes the development of a _cloud native_ [Cassandra](http://cassandra.apache.org/) deployment on Kubernetes. When we say _cloud native_ we mean an application which understands that it is running within a cluster manager, and uses this cluster management infrastructure to help implement the application. In particular, in this instance, a custom Cassandra ```SeedProvider``` is used to enable Cassandra to dynamically discover new Cassandra nodes as they join the cluster. The following document describes the development of a _cloud native_ [Cassandra](http://cassandra.apache.org/) deployment on Kubernetes. When we say _cloud native_ we mean an application which understands that it is running within a cluster manager, and uses this cluster management infrastructure to help implement the application. In particular, in this instance, a custom Cassandra ```SeedProvider``` is used to enable Cassandra to dynamically discover new Cassandra nodes as they join the cluster.
...@@ -37,14 +38,17 @@ The following document describes the development of a _cloud native_ [Cassandra] ...@@ -37,14 +38,17 @@ The following document describes the development of a _cloud native_ [Cassandra]
This document also attempts to describe the core components of Kubernetes: _Pods_, _Services_, and _Replication Controllers_. This document also attempts to describe the core components of Kubernetes: _Pods_, _Services_, and _Replication Controllers_.
### Prerequisites ### Prerequisites
This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the ```kubectl``` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform. This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the ```kubectl``` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform.
This example also has a few code and configuration files needed. To avoid typing these out, you can ```git clone``` the Kubernetes repository to you local computer. This example also has a few code and configuration files needed. To avoid typing these out, you can ```git clone``` the Kubernetes repository to you local computer.
### A note for the impatient ### A note for the impatient
This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end. This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end.
### Simple Single Pod Cassandra Node ### Simple Single Pod Cassandra Node
In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes. In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes.
In this simple case, we define a single container running Cassandra for our pod: In this simple case, we define a single container running Cassandra for our pod:
...@@ -93,6 +97,7 @@ You may also note that we are setting some Cassandra parameters (```MAX_HEAP_SIZ ...@@ -93,6 +97,7 @@ You may also note that we are setting some Cassandra parameters (```MAX_HEAP_SIZ
In theory could create a single Cassandra pod right now but since `KubernetesSeedProvider` needs to learn what nodes are in the Cassandra deployment we need to create a service first. In theory could create a single Cassandra pod right now but since `KubernetesSeedProvider` needs to learn what nodes are in the Cassandra deployment we need to create a service first.
### Cassandra Service ### Cassandra Service
In Kubernetes a _[Service](../../docs/user-guide/services.md)_ describes a set of Pods that perform the same task. For example, the set of Pods in a Cassandra cluster can be a Kubernetes Service, or even just the single Pod we created above. An important use for a Service is to create a load balancer which distributes traffic across members of the set of Pods. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods (or the single Pod we've already created) available via the Kubernetes API. This is the way that we use initially use Services with Cassandra. In Kubernetes a _[Service](../../docs/user-guide/services.md)_ describes a set of Pods that perform the same task. For example, the set of Pods in a Cassandra cluster can be a Kubernetes Service, or even just the single Pod we created above. An important use for a Service is to create a load balancer which distributes traffic across members of the set of Pods. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods (or the single Pod we've already created) available via the Kubernetes API. This is the way that we use initially use Services with Cassandra.
Here is the service description: Here is the service description:
...@@ -163,6 +168,7 @@ subsets: ...@@ -163,6 +168,7 @@ subsets:
``` ```
### Adding replicated nodes ### Adding replicated nodes
Of course, a single node cluster isn't particularly interesting. The real power of Kubernetes and Cassandra lies in easily building a replicated, scalable Cassandra cluster. Of course, a single node cluster isn't particularly interesting. The real power of Kubernetes and Cassandra lies in easily building a replicated, scalable Cassandra cluster.
In Kubernetes a _[Replication Controller](../../docs/user-guide/replication-controller.md)_ is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state. In Kubernetes a _[Replication Controller](../../docs/user-guide/replication-controller.md)_ is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state.
...@@ -277,6 +283,7 @@ UN 10.244.3.3 51.28 KB 256 51.0% dafe3154-1d67-42e1-ac1d-78e ...@@ -277,6 +283,7 @@ UN 10.244.3.3 51.28 KB 256 51.0% dafe3154-1d67-42e1-ac1d-78e
``` ```
### tl; dr; ### tl; dr;
For those of you who are impatient, here is the summary of the commands we ran in this tutorial. For those of you who are impatient, here is the summary of the commands we ran in this tutorial.
```sh ```sh
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Example: Distributed task queues with Celery, RabbitMQ and Flower # Example: Distributed task queues with Celery, RabbitMQ and Flower
## Introduction ## Introduction
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Kubernetes DNS example ## Kubernetes DNS example
This is a toy example demonstrating how to use kubernetes DNS. This is a toy example demonstrating how to use kubernetes DNS.
...@@ -174,6 +175,7 @@ If you prefer not using namespace, then all your services can be addressed using ...@@ -174,6 +175,7 @@ If you prefer not using namespace, then all your services can be addressed using
### tl; dr; ### tl; dr;
For those of you who are impatient, here is the summary of the commands we ran in this tutorial. Remember to set first `$CLUSTER_NAME` and `$USER_NAME` to the values found in `~/.kube/config`. For those of you who are impatient, here is the summary of the commands we ran in this tutorial. Remember to set first `$CLUSTER_NAME` and `$USER_NAME` to the values found in `~/.kube/config`.
```sh ```sh
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Elasticsearch for Kubernetes # Elasticsearch for Kubernetes
This directory contains the source for a Docker image that creates an instance This directory contains the source for a Docker image that creates an instance
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
### explorer ### explorer
Explorer is a little container for examining the runtime environment kubernetes produces for your pods. Explorer is a little container for examining the runtime environment kubernetes produces for your pods.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Glusterfs ## Glusterfs
[Glusterfs](http://www.gluster.org) is an open source scale-out filesystem. These examples provide information about how to allow containers use Glusterfs volumes. [Glusterfs](http://www.gluster.org) is an open source scale-out filesystem. These examples provide information about how to allow containers use Glusterfs volumes.
...@@ -41,6 +42,7 @@ The example assumes that you have already set up a Glusterfs server cluster and ...@@ -41,6 +42,7 @@ The example assumes that you have already set up a Glusterfs server cluster and
Set up Glusterfs server cluster; install Glusterfs client package on the Kubernetes nodes. ([Guide](https://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-debian-wheezy-automatic-file-replication-mirror-across-two-storage-servers)) Set up Glusterfs server cluster; install Glusterfs client package on the Kubernetes nodes. ([Guide](https://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-debian-wheezy-automatic-file-replication-mirror-across-two-storage-servers))
### Create endpoints ### Create endpoints
Here is a snippet of [glusterfs-endpoints.json](glusterfs-endpoints.json), Here is a snippet of [glusterfs-endpoints.json](glusterfs-endpoints.json),
``` ```
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Guestbook Example ## Guestbook Example
This example shows how to build a simple multi-tier web application using Kubernetes and Docker. The application consists of a web front-end, Redis master for storage, and replicated set of Redis slaves, all for which we will create Kubernetes replication controllers, pods, and services. This example shows how to build a simple multi-tier web application using Kubernetes and Docker. The application consists of a web front-end, Redis master for storage, and replicated set of Redis slaves, all for which we will create Kubernetes replication controllers, pods, and services.
...@@ -37,6 +38,7 @@ This example shows how to build a simple multi-tier web application using Kubern ...@@ -37,6 +38,7 @@ This example shows how to build a simple multi-tier web application using Kubern
If you are running a cluster in Google Container Engine (GKE), instead see the [Guestbook Example for Google Container Engine](https://cloud.google.com/container-engine/docs/tutorials/guestbook). If you are running a cluster in Google Container Engine (GKE), instead see the [Guestbook Example for Google Container Engine](https://cloud.google.com/container-engine/docs/tutorials/guestbook).
##### Table of Contents ##### Table of Contents
* [Step Zero: Prerequisites](#step-zero) * [Step Zero: Prerequisites](#step-zero)
* [Step One: Create the Redis master pod](#step-one) * [Step One: Create the Redis master pod](#step-one)
* [Step Two: Create the Redis master service](#step-two) * [Step Two: Create the Redis master service](#step-two)
...@@ -99,6 +101,7 @@ Use the `examples/guestbook-go/redis-master-controller.json` file to create a [r ...@@ -99,6 +101,7 @@ Use the `examples/guestbook-go/redis-master-controller.json` file to create a [r
Note: The initial `docker pull` can take a few minutes, depending on network conditions. Note: The initial `docker pull` can take a few minutes, depending on network conditions.
### Step Two: Create the Redis master service <a id="step-two"></a> ### Step Two: Create the Redis master service <a id="step-two"></a>
A Kubernetes '[service](../../docs/user-guide/services.md)' is a named load balancer that proxies traffic to one or more containers. The services in a Kubernetes cluster are discoverable inside other containers via environment variables or DNS. A Kubernetes '[service](../../docs/user-guide/services.md)' is a named load balancer that proxies traffic to one or more containers. The services in a Kubernetes cluster are discoverable inside other containers via environment variables or DNS.
Services find the containers to load balance based on pod labels. The pod that you created in Step One has the label `app=redis` and `role=master`. The selector field of the service determines which pods will receive the traffic sent to the service. Services find the containers to load balance based on pod labels. The pod that you created in Step One has the label `app=redis` and `role=master`. The selector field of the service determines which pods will receive the traffic sent to the service.
...@@ -123,6 +126,7 @@ Services find the containers to load balance based on pod labels. The pod that y ...@@ -123,6 +126,7 @@ Services find the containers to load balance based on pod labels. The pod that y
### Step Three: Create the Redis slave pods <a id="step-three"></a> ### Step Three: Create the Redis slave pods <a id="step-three"></a>
The Redis master we created earlier is a single pod (REPLICAS = 1), while the Redis read slaves we are creating here are 'replicated' pods. In Kubernetes, a replication controller is responsible for managing the multiple instances of a replicated pod. The Redis master we created earlier is a single pod (REPLICAS = 1), while the Redis read slaves we are creating here are 'replicated' pods. In Kubernetes, a replication controller is responsible for managing the multiple instances of a replicated pod.
1. Use the file [redis-slave-controller.json](redis-slave-controller.json) to create the replication controller by running the `kubectl create -f` *`filename`* command: 1. Use the file [redis-slave-controller.json](redis-slave-controller.json) to create the replication controller by running the `kubectl create -f` *`filename`* command:
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Building and releasing Guestbook Image ## Building and releasing Guestbook Image
This process employs building two docker images, one compiles the source and the other hosts the compiled binaries. This process employs building two docker images, one compiles the source and the other hosts the compiled binaries.
......
...@@ -346,6 +346,7 @@ redis-slave name=redis-slave name=redis-sla ...@@ -346,6 +346,7 @@ redis-slave name=redis-slave name=redis-sla
``` ```
### Step Five: Create the frontend replicated pods ### Step Five: Create the frontend replicated pods
<a href="#step-five-create-the-frontend-replicated-pods"></a> <a href="#step-five-create-the-frontend-replicated-pods"></a>
A frontend pod is a simple PHP server that is configured to talk to either the slave or master services, depending on whether the client request is a read or a write. It exposes a simple AJAX interface, and serves an Angular-based UX. A frontend pod is a simple PHP server that is configured to talk to either the slave or master services, depending on whether the client request is a read or a write. It exposes a simple AJAX interface, and serves an Angular-based UX.
...@@ -504,6 +505,7 @@ redis-slave name=redis-slave name=redis-sla ...@@ -504,6 +505,7 @@ redis-slave name=redis-slave name=redis-sla
#### Accessing the guestbook site externally #### Accessing the guestbook site externally
<a href="#accessing-the-guestbook-site-externally"></a> <a href="#accessing-the-guestbook-site-externally"></a>
You'll want to set up your guestbook service so that it can be accessed from outside of the internal Kubernetes network. Above, we introduced one way to do that, using the `type: LoadBalancer` spec. You'll want to set up your guestbook service so that it can be accessed from outside of the internal Kubernetes network. Above, we introduced one way to do that, using the `type: LoadBalancer` spec.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Cloud Native Deployments of Hazelcast using Kubernetes ## Cloud Native Deployments of Hazelcast using Kubernetes
The following document describes the development of a _cloud native_ [Hazelcast](http://hazelcast.org/) deployment on Kubernetes. When we say _cloud native_ we mean an application which understands that it is running within a cluster manager, and uses this cluster management infrastructure to help implement the application. In particular, in this instance, a custom Hazelcast ```bootstrapper``` is used to enable Hazelcast to dynamically discover Hazelcast nodes that have already joined the cluster. The following document describes the development of a _cloud native_ [Hazelcast](http://hazelcast.org/) deployment on Kubernetes. When we say _cloud native_ we mean an application which understands that it is running within a cluster manager, and uses this cluster management infrastructure to help implement the application. In particular, in this instance, a custom Hazelcast ```bootstrapper``` is used to enable Hazelcast to dynamically discover Hazelcast nodes that have already joined the cluster.
...@@ -39,9 +40,11 @@ Any topology changes are communicated and handled by Hazelcast nodes themselves. ...@@ -39,9 +40,11 @@ Any topology changes are communicated and handled by Hazelcast nodes themselves.
This document also attempts to describe the core components of Kubernetes: _Pods_, _Services_, and _Replication Controllers_. This document also attempts to describe the core components of Kubernetes: _Pods_, _Services_, and _Replication Controllers_.
### Prerequisites ### Prerequisites
This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the `kubectl` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform. This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the `kubectl` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform.
### A note for the impatient ### A note for the impatient
This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end. This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end.
### Sources ### Sources
...@@ -52,12 +55,14 @@ Source is freely available at: ...@@ -52,12 +55,14 @@ Source is freely available at:
* Docker Trusted Build - https://quay.io/repository/pires/hazelcast-kubernetes * Docker Trusted Build - https://quay.io/repository/pires/hazelcast-kubernetes
### Simple Single Pod Hazelcast Node ### Simple Single Pod Hazelcast Node
In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes. In Kubernetes, the atomic unit of an application is a [_Pod_](../../docs/user-guide/pods.md). A Pod is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes.
In this case, we shall not run a single Hazelcast pod, because the discovery mechanism now relies on a service definition. In this case, we shall not run a single Hazelcast pod, because the discovery mechanism now relies on a service definition.
### Adding a Hazelcast Service ### Adding a Hazelcast Service
In Kubernetes a _[Service](../../docs/user-guide/services.md)_ describes a set of Pods that perform the same task. For example, the set of nodes in a Hazelcast cluster. An important use for a Service is to create a load balancer which distributes traffic across members of the set. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods available via the Kubernetes API. This is actually how our discovery mechanism works, by relying on the service to discover other Hazelcast pods. In Kubernetes a _[Service](../../docs/user-guide/services.md)_ describes a set of Pods that perform the same task. For example, the set of nodes in a Hazelcast cluster. An important use for a Service is to create a load balancer which distributes traffic across members of the set. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods available via the Kubernetes API. This is actually how our discovery mechanism works, by relying on the service to discover other Hazelcast pods.
Here is the service description: Here is the service description:
...@@ -85,6 +90,7 @@ $ kubectl create -f examples/hazelcast/hazelcast-service.yaml ...@@ -85,6 +90,7 @@ $ kubectl create -f examples/hazelcast/hazelcast-service.yaml
``` ```
### Adding replicated nodes ### Adding replicated nodes
The real power of Kubernetes and Hazelcast lies in easily building a replicated, resizable Hazelcast cluster. The real power of Kubernetes and Hazelcast lies in easily building a replicated, resizable Hazelcast cluster.
In Kubernetes a _[Replication Controller](../../docs/user-guide/replication-controller.md)_ is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state. In Kubernetes a _[Replication Controller](../../docs/user-guide/replication-controller.md)_ is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state.
...@@ -243,6 +249,7 @@ $ kubectl scale rc hazelcast --replicas=4 ...@@ -243,6 +249,7 @@ $ kubectl scale rc hazelcast --replicas=4
Examine the status again by checking the logs and you should see the 4 members connected. Examine the status again by checking the logs and you should see the 4 members connected.
### tl; dr; ### tl; dr;
For those of you who are impatient, here is the summary of the commands we ran in this tutorial. For those of you who are impatient, here is the summary of the commands we ran in this tutorial.
```sh ```sh
......
...@@ -30,12 +30,14 @@ Documentation for other releases can be found at ...@@ -30,12 +30,14 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Nginx https service # Nginx https service
This example creates a basic nginx https service useful in verifying proof of concept, keys, secrets, and end-to-end https service creation in kubernetes. This example creates a basic nginx https service useful in verifying proof of concept, keys, secrets, and end-to-end https service creation in kubernetes.
It uses an [nginx server block](http://wiki.nginx.org/ServerBlockExample) to serve the index page over both http and https. It uses an [nginx server block](http://wiki.nginx.org/ServerBlockExample) to serve the index page over both http and https.
### Generate certificates ### Generate certificates
First generate a self signed rsa key and certificate that the server can use for TLS. First generate a self signed rsa key and certificate that the server can use for TLS.
```shell ```shell
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Step 1. Setting up iSCSI target and iSCSI initiator ## Step 1. Setting up iSCSI target and iSCSI initiator
**Setup A.** On Fedora 21 nodes **Setup A.** On Fedora 21 nodes
If you use Fedora 21 on Kubernetes node, then first install iSCSI initiator on the node: If you use Fedora 21 on Kubernetes node, then first install iSCSI initiator on the node:
...@@ -46,7 +48,8 @@ I mostly followed these [instructions](http://www.server-world.info/en/note?os=F ...@@ -46,7 +48,8 @@ I mostly followed these [instructions](http://www.server-world.info/en/note?os=F
GCE does not provide preconfigured Fedora 21 image, so I set up the iSCSI target on a preconfigured Ubuntu 12.04 image, mostly following these [instructions](http://www.server-world.info/en/note?os=Ubuntu_12.04&p=iscsi). My Kubernetes cluster on GCE was running Debian 7 images, so I followed these [instructions](http://www.server-world.info/en/note?os=Debian_7.0&p=iscsi&f=2) to set up the iSCSI initiator. GCE does not provide preconfigured Fedora 21 image, so I set up the iSCSI target on a preconfigured Ubuntu 12.04 image, mostly following these [instructions](http://www.server-world.info/en/note?os=Ubuntu_12.04&p=iscsi). My Kubernetes cluster on GCE was running Debian 7 images, so I followed these [instructions](http://www.server-world.info/en/note?os=Debian_7.0&p=iscsi&f=2) to set up the iSCSI initiator.
##Step 2. Creating the pod with iSCSI persistent storage ## Step 2. Creating the pod with iSCSI persistent storage
Once you have installed iSCSI initiator and new Kubernetes, you can create a pod based on my example *iscsi.json*. In the pod JSON, you need to provide *targetPortal* (the iSCSI target's **IP** address and *port* if not the default port 3260), target's *iqn*, *lun*, and the type of the filesystem that has been created on the lun, and *readOnly* boolean. Once you have installed iSCSI initiator and new Kubernetes, you can create a pod based on my example *iscsi.json*. In the pod JSON, you need to provide *targetPortal* (the iSCSI target's **IP** address and *port* if not the default port 3260), target's *iqn*, *lun*, and the type of the filesystem that has been created on the lun, and *readOnly* boolean.
**Note:** If you have followed the instructions in the links above you **Note:** If you have followed the instructions in the links above you
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Welcome to k8PetStore ## Welcome to k8PetStore
This is a follow up to the [Guestbook Example](../guestbook/README.md)'s [Go implementation](../guestbook-go/). This is a follow up to the [Guestbook Example](../guestbook/README.md)'s [Go implementation](../guestbook-go/).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# How to generate the bps-data-generator container # # How to generate the bps-data-generator container #
This container is maintained as part of the apache bigtop project. This container is maintained as part of the apache bigtop project.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Persistent Installation of MySQL and WordPress on Kubernetes # Persistent Installation of MySQL and WordPress on Kubernetes
This example describes how to run a persistent installation of [Wordpress](https://wordpress.org/) using the [volumes](../../docs/user-guide/volumes.md) feature of Kubernetes, and [Google Compute Engine](https://cloud.google.com/compute/docs/disks) [persistent disks](../../docs/user-guide/volumes.md#gcepersistentdisk). This example describes how to run a persistent installation of [Wordpress](https://wordpress.org/) using the [volumes](../../docs/user-guide/volumes.md) feature of Kubernetes, and [Google Compute Engine](https://cloud.google.com/compute/docs/disks) [persistent disks](../../docs/user-guide/volumes.md#gcepersistentdisk).
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Example of NFS volume # Example of NFS volume
See [nfs-web-pod.yaml](nfs-web-pod.yaml) for a quick example, how to use NFS volume See [nfs-web-pod.yaml](nfs-web-pod.yaml) for a quick example, how to use NFS volume
...@@ -40,7 +41,8 @@ in a pod. ...@@ -40,7 +41,8 @@ in a pod.
The example below shows how to export a NFS share from a pod and import it The example below shows how to export a NFS share from a pod and import it
into another one. into another one.
###Prerequisites ### Prerequisites
The nfs server pod creates a privileged container, so if you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you have to enable the ability to create privileged containers by API. The nfs server pod creates a privileged container, so if you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you have to enable the ability to create privileged containers by API.
```shell ```shell
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# NFS-exporter container # NFS-exporter container
Inspired by https://github.com/cpuguy83/docker-nfs-server. Rewritten for Inspired by https://github.com/cpuguy83/docker-nfs-server. Rewritten for
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# NFS-exporter container with a file # NFS-exporter container with a file
This container exports /mnt/data with index.html in it via NFSv4. Based on This container exports /mnt/data with index.html in it via NFSv4. Based on
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## OpenShift Origin example ## OpenShift Origin example
This example shows how to run OpenShift Origin as a pod on an existing Kubernetes cluster. This example shows how to run OpenShift Origin as a pod on an existing Kubernetes cluster.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Phabricator example ## Phabricator example
This example shows how to build a simple multi-tier web application using Kubernetes and Docker. This example shows how to build a simple multi-tier web application using Kubernetes and Docker.
......
...@@ -30,7 +30,9 @@ Documentation for other releases can be found at ...@@ -30,7 +30,9 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# How to Use it? # How to Use it?
Install Ceph on the Kubernetes host. For example, on Fedora 21 Install Ceph on the Kubernetes host. For example, on Fedora 21
# yum -y install ceph # yum -y install ceph
......
...@@ -30,17 +30,21 @@ Documentation for other releases can be found at ...@@ -30,17 +30,21 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Reliable, Scalable Redis on Kubernetes ## Reliable, Scalable Redis on Kubernetes
The following document describes the deployment of a reliable, multi-node Redis on Kubernetes. It deploys a master with replicated slaves, as well as replicated redis sentinels which are use for health checking and failover. The following document describes the deployment of a reliable, multi-node Redis on Kubernetes. It deploys a master with replicated slaves, as well as replicated redis sentinels which are use for health checking and failover.
### Prerequisites ### Prerequisites
This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the ```kubectl``` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform. This example assumes that you have a Kubernetes cluster installed and running, and that you have installed the ```kubectl``` command line tool somewhere in your path. Please see the [getting started](../../docs/getting-started-guides/) for installation instructions for your platform.
### A note for the impatient ### A note for the impatient
This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end. This is a somewhat long tutorial. If you want to jump straight to the "do it now" commands, please see the [tl; dr](#tl-dr) at the end.
### Turning up an initial master/sentinel pod. ### Turning up an initial master/sentinel pod.
A [_Pod_](../../docs/user-guide/pods.md) is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes. A [_Pod_](../../docs/user-guide/pods.md) is one or more containers that _must_ be scheduled onto the same host. All containers in a pod share a network namespace, and may optionally share mounted volumes.
We will used the shared network namespace to bootstrap our Redis cluster. In particular, the very first sentinel needs to know how to find the master (subsequent sentinels just ask the first sentinel). Because all containers in a Pod share a network namespace, the sentinel can simply look at ```$(hostname -i):6379```. We will used the shared network namespace to bootstrap our Redis cluster. In particular, the very first sentinel needs to know how to find the master (subsequent sentinels just ask the first sentinel). Because all containers in a Pod share a network namespace, the sentinel can simply look at ```$(hostname -i):6379```.
...@@ -55,6 +59,7 @@ kubectl create -f examples/redis/redis-master.yaml ...@@ -55,6 +59,7 @@ kubectl create -f examples/redis/redis-master.yaml
``` ```
### Turning up a sentinel service ### Turning up a sentinel service
In Kubernetes a [_Service_](../../docs/user-guide/services.md) describes a set of Pods that perform the same task. For example, the set of nodes in a Cassandra cluster, or even the single node we created above. An important use for a Service is to create a load balancer which distributes traffic across members of the set. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods (or the single Pod we've already created) available via the Kubernetes API. In Kubernetes a [_Service_](../../docs/user-guide/services.md) describes a set of Pods that perform the same task. For example, the set of nodes in a Cassandra cluster, or even the single node we created above. An important use for a Service is to create a load balancer which distributes traffic across members of the set. But a _Service_ can also be used as a standing query which makes a dynamically changing set of Pods (or the single Pod we've already created) available via the Kubernetes API.
In Redis, we will use a Kubernetes Service to provide a discoverable endpoints for the Redis sentinels in the cluster. From the sentinels Redis clients can find the master, and then the slaves and other relevant info for the cluster. This enables new members to join the cluster when failures occur. In Redis, we will use a Kubernetes Service to provide a discoverable endpoints for the Redis sentinels in the cluster. From the sentinels Redis clients can find the master, and then the slaves and other relevant info for the cluster. This enables new members to join the cluster when failures occur.
...@@ -68,6 +73,7 @@ kubectl create -f examples/redis/redis-sentinel-service.yaml ...@@ -68,6 +73,7 @@ kubectl create -f examples/redis/redis-sentinel-service.yaml
``` ```
### Turning up replicated redis servers ### Turning up replicated redis servers
So far, what we have done is pretty manual, and not very fault-tolerant. If the ```redis-master``` pod that we previously created is destroyed for some reason (e.g. a machine dying) our Redis service goes away with it. So far, what we have done is pretty manual, and not very fault-tolerant. If the ```redis-master``` pod that we previously created is destroyed for some reason (e.g. a machine dying) our Redis service goes away with it.
In Kubernetes a [_Replication Controller_](../../docs/user-guide/replication-controller.md) is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state. In Kubernetes a [_Replication Controller_](../../docs/user-guide/replication-controller.md) is responsible for replicating sets of identical pods. Like a _Service_ it has a selector query which identifies the members of it's set. Unlike a _Service_ it also has a desired number of replicas, and it will create or delete _Pods_ to ensure that the number of _Pods_ matches up with it's desired state.
...@@ -91,6 +97,7 @@ kubectl create -f examples/redis/redis-sentinel-controller.yaml ...@@ -91,6 +97,7 @@ kubectl create -f examples/redis/redis-sentinel-controller.yaml
``` ```
### Scale our replicated pods ### Scale our replicated pods
Initially creating those pods didn't actually do anything, since we only asked for one sentinel and one redis server, and they already existed, nothing changed. Now we will add more replicas: Initially creating those pods didn't actually do anything, since we only asked for one sentinel and one redis server, and they already existed, nothing changed. Now we will add more replicas:
```sh ```sh
...@@ -106,6 +113,7 @@ This will create two additional replicas of the redis server and two additional ...@@ -106,6 +113,7 @@ This will create two additional replicas of the redis server and two additional
Unlike our original redis-master pod, these pods exist independently, and they use the ```redis-sentinel-service``` that we defined above to discover and join the cluster. Unlike our original redis-master pod, these pods exist independently, and they use the ```redis-sentinel-service``` that we defined above to discover and join the cluster.
### Delete our manual pod ### Delete our manual pod
The final step in the cluster turn up is to delete the original redis-master pod that we created manually. While it was useful for bootstrapping discovery in the cluster, we really don't want the lifespan of our sentinel to be tied to the lifespan of one of our redis servers, and now that we have a successful, replicated redis sentinel service up and running, the binding is unnecessary. The final step in the cluster turn up is to delete the original redis-master pod that we created manually. While it was useful for bootstrapping discovery in the cluster, we really don't want the lifespan of our sentinel to be tied to the lifespan of one of our redis servers, and now that we have a successful, replicated redis sentinel service up and running, the binding is unnecessary.
Delete the master as follows: Delete the master as follows:
...@@ -121,9 +129,11 @@ Now let's take a close look at what happens after this pod is deleted. There ar ...@@ -121,9 +129,11 @@ Now let's take a close look at what happens after this pod is deleted. There ar
3. The redis sentinels themselves, realize that the master has disappeared from the cluster, and begin the election procedure for selecting a new master. They perform this election and selection, and chose one of the existing redis server replicas to be the new master. 3. The redis sentinels themselves, realize that the master has disappeared from the cluster, and begin the election procedure for selecting a new master. They perform this election and selection, and chose one of the existing redis server replicas to be the new master.
### Conclusion ### Conclusion
At this point we now have a reliable, scalable Redis installation. By scaling the replication controller for redis servers, we can increase or decrease the number of read-slaves in our cluster. Likewise, if failures occur, the redis-sentinels will perform master election and select a new master. At this point we now have a reliable, scalable Redis installation. By scaling the replication controller for redis servers, we can increase or decrease the number of read-slaves in our cluster. Likewise, if failures occur, the redis-sentinels will perform master election and select a new master.
### tl; dr ### tl; dr
For those of you who are impatient, here is the summary of commands we ran in this tutorial: For those of you who are impatient, here is the summary of commands we ran in this tutorial:
``` ```
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
## Running your first containers in Kubernetes ## Running your first containers in Kubernetes
Ok, you've run one of the [getting started guides](../docs/getting-started-guides/) and you have Ok, you've run one of the [getting started guides](../docs/getting-started-guides/) and you have
...@@ -65,6 +66,7 @@ kubectl stop rc my-nginx ...@@ -65,6 +66,7 @@ kubectl stop rc my-nginx
``` ```
### Exposing your pods to the internet. ### Exposing your pods to the internet.
On some platforms (for example Google Compute Engine) the kubectl command can integrate with your cloud provider to add a [public IP address](../docs/user-guide/services.md#external-services) for the pods, On some platforms (for example Google Compute Engine) the kubectl command can integrate with your cloud provider to add a [public IP address](../docs/user-guide/services.md#external-services) for the pods,
to do this run: to do this run:
...@@ -81,6 +83,7 @@ kubectl get services ...@@ -81,6 +83,7 @@ kubectl get services
In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80. In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80.
### Next: Configuration files ### Next: Configuration files
Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](../docs/user-guide/simple-yaml.md) Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](../docs/user-guide/simple-yaml.md)
is given in a different document. is given in a different document.
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Spark example # Spark example
Following this example, you will create a functional [Apache Following this example, you will create a functional [Apache
......
...@@ -30,6 +30,7 @@ Documentation for other releases can be found at ...@@ -30,6 +30,7 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE --> <!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING --> <!-- END MUNGE: UNVERSIONED_WARNING -->
# Storm example # Storm example
Following this example, you will create a functional [Apache Following this example, you will create a functional [Apache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment