Instructions for setting up a Kubernetes cluster.

Documentation for Kubernetes v1.7 is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest version.

Edit This Page

Installing kubeadm

This page shows how to use install kubeadm.

Before you begin

Check required ports

Master node(s)

Port Range Purpose
6443* Kubernetes API server
2379-2380 etcd server client API
10250 Kubelet API
10251 kube-scheduler
10252 kube-controller-manager
10255 Read-only Kubelet API (Heapster)

Worker node(s)

Port Range Purpose
10250 Kubelet API
10255 Read-only Kubelet API (Heapster)
30000-32767 Default port range for NodePort Services. Typically, these ports would need to be exposed to external load-balancers, or other external consumers of the application itself.

Any port numbers marked with * are overridable, so you will need to ensure any custom ports you provide are also open.

Although etcd ports are included in master nodes, you can also host your own etcd cluster externally on custom ports.

The pod network plugin you use (see below) may also require certain ports to be open. Since this differs with each pod network plugin, please see the documentation for the plugins about what port(s) those need.

Installing Docker

On each of your machines, install Docker. Version 1.12 is recommended, but v1.10 and v1.11 are known to work as well. Versions 1.13 and 17.03+ have not yet been tested and verified by the Kubernetes node team. For installation instructions, see Install Docker.

Installing kubectl

On each of your machines, install kubectl. You only need kubectl on the master and/or your workstation, but it can be useful to have on the other nodes as well.

Installing kubelet and kubeadm

You will install these packages on all of your machines:

Note: If you already have kubeadm installed, you should do a apt-get update && apt-get upgrade or yum update to get the latest version of kubeadm. See the kubeadm release notes if you want to read about the different kubeadm releases.

For each machine:

The kubelet is now restarting every few seconds, as it waits in a crashloop for kubeadm to tell it what to do.

Note: Disabling SELinux by running setenforce 0 is required to allow containers to access the host filesystem, which is required by pod networks for example. You have to do this until SELinux support is improved in the kubelet.

What’s next


Create an Issue Edit this Page