From 57385e8d868d1a1e0522aac371a77c005fc9ea5a Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Thu, 1 Jun 2017 18:03:47 -0700 Subject: [PATCH 1/5] Create Installing kubeadm topic. (#3709) * Create Installing kubeadm topic. * Put kubeadm installation under Setup. * Move topics to setup directory. * Move topics to setup directory. * Add redirects. --- _data/setup.yml | 3 +- _data/tasks.yml | 2 + .../independent/create-cluster-kubeadm.md} | 78 +------------ docs/setup/independent/install-kubeadm.md | 107 ++++++++++++++++++ 4 files changed, 117 insertions(+), 73 deletions(-) rename docs/{getting-started-guides/kubeadm.md => setup/independent/create-cluster-kubeadm.md} (89%) create mode 100644 docs/setup/independent/install-kubeadm.md diff --git a/_data/setup.yml b/_data/setup.yml index 91dfee7951..6d2d8a847f 100644 --- a/_data/setup.yml +++ b/_data/setup.yml @@ -7,7 +7,8 @@ toc: - title: Independent Solutions section: - docs/getting-started-guides/minikube.md - - docs/getting-started-guides/kubeadm.md + - docs/setup/independent/install-kubeadm.md + - docs/setup/independent/create-cluster-kubeadm.md - docs/getting-started-guides/scratch.md - docs/getting-started-guides/alternatives.md diff --git a/_data/tasks.yml b/_data/tasks.yml index 3170da003c..3193192942 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -7,6 +7,7 @@ toc: section: - docs/tasks/tools/install-kubectl.md - docs/tasks/tools/install-minikube.md + - docs/setup/independent/install-kubeadm.md - title: Configuring Pods and Containers section: @@ -151,3 +152,4 @@ toc: section: - docs/tasks/manage-gpus/scheduling-gpus.md + diff --git a/docs/getting-started-guides/kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md similarity index 89% rename from docs/getting-started-guides/kubeadm.md rename to docs/setup/independent/create-cluster-kubeadm.md index 61767ce642..63380682f4 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -4,7 +4,10 @@ assignees: - luxas - errordeveloper - jbeda -title: Installing Kubernetes on Linux with kubeadm +title: Using kubeadm to Create a Cluster +redirect_from: +- "/docs/getting-started-guides/kubeadm/" +- "/docs/getting-started-guides/kubeadm.html" --- ## Overview @@ -75,78 +78,9 @@ particularly easy. ## Instructions -### (1/4) Installing kubelet and kubeadm on your hosts +### (1/4) Installing kubeadm on your hosts -You will install the following packages on all the machines: - -* `docker`: the container runtime, which Kubernetes depends on. v1.12 is - recommended, but v1.10 and v1.11 are known to work as well. v1.13 and 17.03+ - have not yet been tested and verified by the Kubernetes node team. -* `kubelet`: the most core component of Kubernetes. It runs on all of the - machines in your cluster and does things like starting pods and containers. -* `kubectl`: the command to control the cluster once it's running. You will only - need this on the master, but it can be useful to have on the other nodes as - well. -* `kubeadm`: the command to bootstrap the 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 host in turn: - -* SSH into the machine and become root if you are not already (for example, - run `sudo su -`). - -* 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 </etc/apt/sources.list.d/kubernetes.list - deb http://apt.kubernetes.io/ kubernetes-xenial main - EOF - apt-get update - # Install docker if you don't have it already. - apt-get install -y docker-engine - apt-get install -y kubelet kubeadm kubectl kubernetes-cni - ``` - -* If the machine is running CentOS, run: - - ``` bash - ARCH=x86_64 - cat < /etc/yum.repos.d/kubernetes.repo - [kubernetes] - name=Kubernetes - baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-${ARCH} - 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 docker kubelet kubeadm kubectl kubernetes-cni - systemctl enable docker && systemctl start docker - systemctl enable kubelet && systemctl start kubelet - ``` - - If your hosts are a different architecture, you will need to modify the - `ARCH=x86_64` line above to the correct value. RPMs are currently available - for `armhfp`, `aarch64`, `ppc64le`, `s390x`, and `x86_64`. - - 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 in order 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. - -While this guide is correct for kubeadm 1.6, the previous version is still -available but can be a bit tricky to install. [See below](#old-kubeadm) for -details. +See [Installing kubeadm](/docs/setup/independent/install-kubeadm/) ### (2/4) Initializing your master diff --git a/docs/setup/independent/install-kubeadm.md b/docs/setup/independent/install-kubeadm.md new file mode 100644 index 0000000000..1de31d08de --- /dev/null +++ b/docs/setup/independent/install-kubeadm.md @@ -0,0 +1,107 @@ +--- +title: Installing kubeadm +--- + +{% capture overview %} + +This page shows how to use install kubeadm. + +{% endcapture %} + +{% capture prerequisites %} + +* One or more machines running Ubuntu 16.04+, CentOS 7 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) + +{% endcapture %} + +{% capture steps %} + +## 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/). + +## Installing kubectl + +On each of your machines, +[install kubectl](/docs/tasks/tools/install-kubectl/). +You only need kubectl on the master, 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: + +* `kubelet`: the most core component of Kubernetes. It runs on all of the + machines in your cluster and does things like starting pods and containers. + +* `kubeadm`: the command to bootstrap the 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 su -`). + +* 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 </etc/apt/sources.list.d/kubernetes.list + deb http://apt.kubernetes.io/ kubernetes-xenial main + EOF + apt-get update + # Install docker if you don't have it already. + apt-get install -y docker-engine + apt-get install -y kubelet kubeadm kubectl kubernetes-cni + ``` + +* If the machine is running CentOS, run: + + ``` bash + cat < /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 docker kubelet kubeadm kubectl kubernetes-cni + systemctl enable docker && systemctl start docker + systemctl enable kubelet && systemctl start kubelet + ``` + + 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. + +While this guide is correct for kubeadm 1.6, the previous version is still +available but can be a bit tricky to install. [See below](#old-kubeadm) for +details. + +{% endcapture %} + +{% capture whatsnext %} + +* [Installing Kubernetes on Linux with kubeadm](/docs/getting-started-guides/kubeadm/) + +{% endcapture %} + +{% include templates/task.md %} From 12ad70a8ca90ffd963d9260141486de4a9305a2a Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Fri, 2 Jun 2017 10:32:19 +0300 Subject: [PATCH 2/5] install-kubectl.md: Fix Windows texts, link to latest macOS binaries Fixes https://github.com/kubernetes/kubernetes.github.io/pull/3859#issuecomment-305710498 --- docs/tasks/tools/install-kubectl.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/tasks/tools/install-kubectl.md b/docs/tasks/tools/install-kubectl.md index c9a0319272..4ddd498566 100644 --- a/docs/tasks/tools/install-kubectl.md +++ b/docs/tasks/tools/install-kubectl.md @@ -28,9 +28,9 @@ Here are a few methods to install kubectl. To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. - For example, to download version 1.4.6 on MacOS, type: + For example, to download version {{page.fullversion}} on MacOS, type: - curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.4.6/bin/darwin/amd64/kubectl + curl -LO https://storage.googleapis.com/kubernetes-release/release/{{page.fullversion}}/bin/darwin/amd64/kubectl 2. Make the kubectl binary executable. @@ -70,27 +70,16 @@ Here are a few methods to install kubectl. {% endcapture %} {% capture win %} -1. Download the latest release with the command: +1. Download the latest release {{page.fullversion}} from [this link](https://storage.googleapis.com/kubernetes-release/release/{{page.fullversion}}/bin/windows/amd64/kubectl.exe). - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/windows/amd64/kubectl.exe - - To download a specific version, replace the `$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)` portion of the command with the specific version. - - For example, to download version {{page.fullversion}} on Windows, type: + Or if you have `curl` installed, use this command: curl -LO https://storage.googleapis.com/kubernetes-release/release/{{page.fullversion}}/bin/windows/amd64/kubectl.exe -2. Make the kubectl binary executable. + To find out the latest stable version (for example, for scripting), take a look at https://storage.googleapis.com/kubernetes-release/release/stable.txt - ``` - chmod +x ./kubectl - ``` +2. Add the binary in to your PATH. -3. Move the binary in to your PATH. - - ``` - sudo mv ./kubectl /usr/local/bin/kubectl - ``` {% endcapture %} {% assign tab_names = "macOS,Linux,Windows" | split: ',' | compact %} From 71c7f9efc4cc4dbfdf8b3523740c66778eec207c Mon Sep 17 00:00:00 2001 From: Kyle Gordon Date: Fri, 2 Jun 2017 09:57:32 +0100 Subject: [PATCH 3/5] Fix 404 to kubectl install link --- docs/getting-started-guides/kops.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started-guides/kops.md b/docs/getting-started-guides/kops.md index c3fa0a780f..cf3c96420c 100644 --- a/docs/getting-started-guides/kops.md +++ b/docs/getting-started-guides/kops.md @@ -25,7 +25,7 @@ a building block. kops builds on the kubeadm work. #### Requirements -You must have [kubectl](http://kubernetes.io/docs/getting-started-guides/kubectl/) installed in order for kops to work. +You must have [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed in order for kops to work. #### Installation From a6f31d4896f33c69f84f24e51ef7515d8ab67527 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Fri, 2 Jun 2017 06:21:21 -0400 Subject: [PATCH 4/5] Clarify CNI acronym Fixes kubernetes/kubernetes.github.io#3964 --- docs/setup/independent/create-cluster-kubeadm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup/independent/create-cluster-kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md index 63380682f4..dbe7346598 100644 --- a/docs/setup/independent/create-cluster-kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -221,7 +221,7 @@ each other. **The network must be deployed before any applications. Also, kube-dns, a helper service, will not start up before a network is installed. kubeadm only -supports CNI based networks (and does not support kubenet).** +supports Container Network Interface (CNI) based networks (and does not support kubenet).** Several projects provide Kubernetes pod networks using CNI, some of which also support [Network Policy](/docs/concepts/services-networking/networkpolicies/). See the [add-ons From 2841f6dabe92a7021fb60370ee8bd1dee9c21e46 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Fri, 2 Jun 2017 17:26:39 -0400 Subject: [PATCH 5/5] Improve RBAC doc (#3951) * Remove spurious cluster-status role description * Indicate controller-manager must be granted controller roles when not run with --use-service-account-credentials --- docs/admin/authorization/rbac.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/admin/authorization/rbac.md b/docs/admin/authorization/rbac.md index 6860f0b1ed..ca2f55d951 100644 --- a/docs/admin/authorization/rbac.md +++ b/docs/admin/authorization/rbac.md @@ -416,11 +416,6 @@ When used in a ClusterRoleBinding, it gives full control over every resou When used in a RoleBinding, it gives full control over every resource in the rolebinding's namespace, including the namespace itself. -cluster-status -None -Allows read-only access to basic cluster status information. - - admin None Allows admin access, intended to be granted within a namespace using a RoleBinding. @@ -531,6 +526,8 @@ This is commonly used by add-on API servers for unified authentication and autho The [Kubernetes controller manager](/docs/admin/kube-controller-manager/) runs core control loops. When invoked with `--use-service-account-credentials`, each control loop is started using a separate service account. Corresponding roles exist for each control loop, prefixed with `system:controller:`. +If the controller manager is not started with `--use-service-account-credentials`, +it runs all control loops using its own credential, which must be granted all the relevant roles. These roles include: * system:controller:attachdetach-controller