Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kubeadm install doc for v1.8 #5676

Merged
merged 1 commit into from
Sep 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 94 additions & 55 deletions docs/setup/independent/install-kubeadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ This page shows how to use install kubeadm.

{% capture prerequisites %}

* One or more machines running Ubuntu 16.04+, CentOS 7 or HypriotOS v1.0.1+
* One or more machines running Ubuntu 16.04+, Debian 9, CentOS 7, RHEL 7, Fedora 25/26 (best-effort) or HypriotOS v1.0.1+
* 1GB or more of RAM per machine (any less will leave little room for your apps)
* Full network connectivity between all machines in the cluster (public or private network is fine)
* Unique MAC address and product_uuid for every node
* Certain ports are open on your machines. See the section below for more details
* Swap disabled. You must disable swap in order for the kubelet to work properly.

{% endcapture %}

Expand Down Expand Up @@ -55,73 +56,111 @@ 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](https://docs.docker.com/engine/installation/).
Version v1.12 is recommended, but v1.11, v1.13 and 17.03 are known to work as well.
Versions 17.06+ _might work_, but have not yet been tested and verified by the Kubernetes node team.

## Installing kubectl
You can use the following commands to install Docker on your system:

On each of your machines,
[install kubectl](/docs/tasks/tools/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.
{% capture docker_ubuntu %}

## Installing kubelet and kubeadm
Install Docker from Ubuntu's repositories:

```bash
apt-get update
apt-get install -y docker.io
```

or install Docker CE 17.03 from Docker's repositories for Ubuntu or Debian:

```bash
apt-get update && apt-get install -y curl apt-transport-https
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/docker.list
deb https://download.docker.com/linux/$(lsb_release -si | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable
EOF
apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
```

{% endcapture %}

{% capture docker_centos %}

Install Docker using your operating system's bundled package:

```bash
yum install -y docker
systemctl enable docker && systemctl start docker
```

{% endcapture %}

{% assign tab_set_name = "docker_install" %}
{% assign tab_names = "Ubuntu, Debian or HypriotOS;CentOS, RHEL or Fedora" | split: ';' | compact %}
{% assign tab_contents = site.emptyArray | push: docker_ubuntu | push: docker_centos %}

{% include tabs.md %}

## Installing kubeadm, kubelet and kubectl

You will install these packages on all of your machines:

* `kubeadm`: the command to bootstrap the cluster.

* `kubelet`: the component that runs on all of the machines in your cluster
and does things like starting pods and containers.

* `kubeadm`: the command to bootstrap the cluster.
* `kubectl`: the command line util to talk to your cluster.

**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](https://github.com/kubernetes/kubeadm/blob/master/CHANGELOG.md).

For each machine:

* SSH into the machine and become root if you are not already (for example,
run `sudo -i`).

* If the machine is running Ubuntu or HypriotOS, run:

``` bash
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm
```

* If the machine is running CentOS, run:

``` bash
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm
systemctl enable kubelet && systemctl start kubelet
```
Please proceed with executing the following commands based on your OS as `root`.
You may become the `root` user by executing `sudo -i` after SSH-ing to each host.

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

```bash
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
```

{% endcapture %}

{% capture centos %}

```bash
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet
```

**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.
containers to access the host filesystem, which is required for the `kubeadm init`
process to complete successfully. You have to do this until SELinux support
is improved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be appropriate to link to the tracking issue here, for those who are interested? I'm not sure how often we do that from our user docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think right now is necessary. We haven't specced out a plan yet


{% endcapture %}

{% assign tab_set_name = "k8s_install" %}
{% assign tab_names = "Ubuntu, Debian or HypriotOS;CentOS, RHEL or Fedora" | split: ';' | compact %}
{% assign tab_contents = site.emptyArray | push: ubuntu | push: centos %}

{% include tabs.md %}

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

{% endcapture %}

Expand Down