2017-01-10 13:54:54 +00:00
---
2017-06-22 21:56:19 +00:00
title: Installing Kubernetes On-premise/Cloud Providers with Kubespray
2017-01-10 13:54:54 +00:00
---
## Overview
This quickstart helps to install a Kubernetes cluster hosted
on GCE, Azure, OpenStack, AWS or Baremetal with
2017-06-22 21:56:19 +00:00
[`Kubespray` ](https://github.com/kubernetes-incubator/kubespray ) tool.
2017-01-10 13:54:54 +00:00
2017-06-22 21:56:19 +00:00
Kubespray is a composition of [Ansible ](http://docs.ansible.com/ ) playbooks,
[inventory ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/ansible.md )
2017-01-10 13:54:54 +00:00
generation CLI tools and domain knowledge for generic OS/Kubernetes
clusters configuration management tasks. It provides:
2017-06-22 21:56:19 +00:00
* [High available cluster ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/ha-mode.md )
* [Composable ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/vars.md )
2017-01-10 13:54:54 +00:00
(Choice of the network plugin, for instance)
* Support most popular Linux
2017-06-22 21:56:19 +00:00
[distributions ](https://github.com/kubernetes-incubator/kubespray#supported-linux-distributions )
2017-01-10 13:54:54 +00:00
* Continuous integration tests
To choose a tool which fits your use case the best, you may want to read this
2017-06-22 21:56:19 +00:00
[comparison ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/comparisons.md )
2017-01-10 13:54:54 +00:00
to [kubeadm ](../kubeadm ) and [kops ](../kops ).
## Creating a cluster
2017-06-22 21:56:19 +00:00
### (1/4) Ensure the underlay [requirements](https://github.com/kubernetes-incubator/kubespray#requirements) are met
2017-01-10 13:54:54 +00:00
#### Checklist
* You must have cloud instances or baremetal nodes running for your future Kubernetes cluster.
A way to achieve that is to use the
2017-06-27 14:44:35 +00:00
[kubespray-cli tool ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/getting-started.md ).
2017-01-10 13:54:54 +00:00
* Or provision baremetal hosts with a tool-of-your-choice or launch cloud instances,
2017-06-22 21:56:19 +00:00
then create an inventory file for Ansible with this [tool ](https://github.com/kubernetes-incubator/kubespray/blob/master/contrib/inventory_builder/inventory.py ).
2017-01-10 13:54:54 +00:00
### (2/4) Compose the deployment
#### Checklist
* Customize your deployment by usual Ansible meanings, which is
2017-06-22 21:56:19 +00:00
[generating inventory ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/getting-started.md#building-your-own-inventory )
and overriding default data [variables ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/vars.md ).
Or just stick with default values (Kubespray will choose Calico networking plugin for you
2017-01-10 13:54:54 +00:00
then). This includes steps like deciding on the:
2017-06-22 21:56:19 +00:00
* DNS [configuration options ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/dns-stack.md )
* [Networking plugin ](https://github.com/kubernetes-incubator/kubespray#network-plugins ) to use
* [Versions ](https://github.com/kubernetes-incubator/kubespray#versions-of-supported-components )
2017-01-10 13:54:54 +00:00
of components.
2017-06-22 21:56:19 +00:00
* Additional node groups like [bastion hosts ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/ansible.md#bastion-host ) or
[Calico BGP route reflectors ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/calico.md#optional--bgp-peering-with-border-routers ).
2017-01-10 13:54:54 +00:00
* Plan custom deployment steps, if any, or use the default composition layer in the
2017-06-22 21:56:19 +00:00
[cluster definition file ](https://github.com/kubernetes-incubator/kubespray/blob/master/cluster.yml ).
Taking the best from Ansible world, Kubespray allows users to execute arbitrary steps via the
2017-01-10 13:54:54 +00:00
``ansible-playbook`` with given inventory, playbooks, data overrides and tags, limits, batches
of nodes to deploy and so on.
* For large deployments (100+ nodes), you may want to
2017-06-22 21:56:19 +00:00
[tweak things ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/large-deployments.md )
2017-01-10 13:54:54 +00:00
for best results.
### (3/4) Run the deployment
#### Checklist
* Apply deployment with
2017-06-27 14:44:35 +00:00
[kubespray-cli tool ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/getting-started.md )
2017-01-10 13:54:54 +00:00
or ``ansible-playbook``
2017-06-22 21:56:19 +00:00
[manual commands ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/getting-started.md#starting-custom-deployment ).
2017-01-10 13:54:54 +00:00
2017-06-22 21:56:19 +00:00
### (4/4) (Optional) verify inter-pods connectivity and DNS resolve with [Netchecker](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/netcheck.md)
2017-01-10 13:54:54 +00:00
#### Checklist
2017-03-23 21:43:52 +00:00
* Ensure the netchecker-agent's pods can resolve DNS requests and ping each over within the default namespace.
2017-01-10 13:54:54 +00:00
Those pods mimic similar behavior of the rest of the workloads and serve as cluster health indicators.
## Explore contributed add-ons
2017-06-22 21:56:19 +00:00
See the [list of contributed playbooks ](https://github.com/kubernetes-incubator/kubespray/tree/master/contrib )
2017-01-10 13:54:54 +00:00
to explore other deployment options.
## What's next
2017-06-22 21:56:19 +00:00
Kubespray has quite a few [marks on the radar ](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/roadmap.md ).
2017-01-10 13:54:54 +00:00
## Cleanup
To delete your scratch cluster, you can apply the
2017-06-22 21:56:19 +00:00
[reset role ](https://github.com/kubernetes-incubator/kubespray/blob/master/roles/reset/tasks/main.yml )
2017-01-10 13:54:54 +00:00
with the manual ``ansible-playbook`` command.
Note, that it is highly unrecommended to delete production clusters with the reset playbook!
## Feedback
2017-06-27 14:44:35 +00:00
* Slack Channel: [#kubespray ](https://kubernetes.slack.com/messages/kubespray/ )
2017-06-22 21:56:19 +00:00
* [GitHub Issues ](https://github.com/kubernetes-incubator/kubespray/issues )