Overall cleanup for kubeadm setup guide. (#8981)
* Overall cleanup for kubeadm setup guide. * Add sonobuoy verification next step * Partial copyedits Hit a place where we also have formatting issues, plus a TODO (removed bc these changes go live as soon as merged). More work to do, but this should help the bottleneck for now. * Address comments from reviewers * Copy edits, fiddly bits, and clearer warnings Incorporated feedback from @mistyhacks, fixed many nits, reorganized some **Note:** content more sensibly. * Revised title per feedback
This commit is contained in:
committed by
k8s-ci-robot
parent
cb6af2a39c
commit
c09c48b2dc
+1
-6
@@ -62,15 +62,10 @@ aliases:
|
||||
- soltysh
|
||||
- sttts
|
||||
sig-cluster-lifecycle: #GH: sig-cluster-lifecycle-pr-reviews
|
||||
- jbeda
|
||||
- timothysc
|
||||
- lukemarsden
|
||||
- pipejakob
|
||||
- dmmcquay
|
||||
- mattmoyer
|
||||
- luxas
|
||||
- roberthbailey
|
||||
- medinatiger
|
||||
- fabriziopandini
|
||||
sig-cluster-ops:
|
||||
- zehicle
|
||||
- jdumars
|
||||
|
||||
@@ -1,98 +1,37 @@
|
||||
---
|
||||
reviewers:
|
||||
- mikedanese
|
||||
- luxas
|
||||
- errordeveloper
|
||||
- jbeda
|
||||
title: Using kubeadm to Create a Cluster
|
||||
- sig-cluster-lifecycle
|
||||
title: Creating a single master cluster with kubeadm
|
||||
content_template: templates/task
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
<img src="https://raw.githubusercontent.com/cncf/artwork/master/kubernetes/certified-kubernetes/versionless/color/certified-kubernetes-color.png" align="right" width="150px">**kubeadm** is a toolkit that helps you bootstrap a best-practice Kubernetes
|
||||
cluster in an easy, reasonably secure and extensible way. It also supports
|
||||
managing [Bootstrap Tokens](/docs/admin/bootstrap-tokens/) for you and upgrading/downgrading clusters.
|
||||
<img src="https://raw.githubusercontent.com/cncf/artwork/master/kubernetes/certified-kubernetes/versionless/color/certified-kubernetes-color.png" align="right" width="150px">**kubeadm** helps you bootstrap a minimum viable Kubernetes cluster that conforms to best practices. With kubeadm, your cluster should pass [Kubernetes Conformance tests](https://kubernetes.io/blog/2017/10/software-conformance-certification). Kubeadm also supports other cluster
|
||||
lifecycle functions, such as upgrades, downgrade, and managing [bootstrap tokens](/docs/admin/bootstrap-tokens/).
|
||||
|
||||
kubeadm aims to set up a minimum viable cluster that pass the
|
||||
[Kubernetes Conformance tests](https://kubernetes.io/blog/2017/10/software-conformance-certification), but installing other addons than
|
||||
really necessary for a functional cluster is out of scope.
|
||||
Because you can install kubeadm on various types of machine (e.g. laptop, server,
|
||||
Raspberry Pi, etc.), it's well suited for integration with provisioning systems
|
||||
such as Terraform or Ansible.
|
||||
|
||||
It by design does not install a networking solution for you, which means you
|
||||
have to install a third-party CNI-compliant networking solution yourself
|
||||
using `kubectl apply`.
|
||||
kubeadm's simplicity means it can serve a wide range of use cases:
|
||||
|
||||
kubeadm expects the user to bring a machine to execute on, the type doesn't
|
||||
matter, can be a Linux laptop, virtual machine, physical/cloud server or
|
||||
Raspberry Pi. This makes kubeadm well suited to integrate with provisioning
|
||||
systems of different kinds (e.g. Terraform, Ansible, etc.).
|
||||
- New users can start with kubeadm to try Kubernetes out for the first time.
|
||||
- Users familiar with Kubernetes can spin up clusters with kubeadm and test their applications.
|
||||
- Larger projects can include kubeadm as a building block in a more complex system that can also include other installer tools.
|
||||
|
||||
kubeadm is designed to be a simple way for new users to start trying
|
||||
Kubernetes out, possibly for the first time, a way for existing users to
|
||||
test their application on and stitch together a cluster easily, and also to be
|
||||
a building block in other ecosystem and/or installer tool with a larger
|
||||
scope.
|
||||
|
||||
You can install _kubeadm_ very easily on operating systems that support
|
||||
installing deb or rpm packages. The responsible SIG for kubeadm,
|
||||
[SIG Cluster Lifecycle](https://github.com/kubernetes/community/tree/master/sig-cluster-lifecycle), provides these packages pre-built for you,
|
||||
but you may also on other OSes.
|
||||
|
||||
|
||||
### kubeadm Maturity
|
||||
|
||||
| Area | Maturity Level |
|
||||
|---------------------------|--------------- |
|
||||
| Command line UX | beta |
|
||||
| Implementation | beta |
|
||||
| Config file API | alpha |
|
||||
| Self-hosting | alpha |
|
||||
| kubeadm alpha subcommands | alpha |
|
||||
| CoreDNS | alpha |
|
||||
| DynamicKubeletConfig | alpha |
|
||||
|
||||
|
||||
kubeadm's overall feature state is **Beta** and will soon be graduated to
|
||||
**General Availability (GA)** during 2018. Some sub-features, like self-hosting
|
||||
or the configuration file API are still under active development. The
|
||||
implementation of creating the cluster may change slightly as the tool evolves,
|
||||
but the overall implementation should be pretty stable. Any commands under
|
||||
`kubeadm alpha` are by definition, supported on an alpha level.
|
||||
|
||||
|
||||
### Support timeframes
|
||||
|
||||
Kubernetes releases are generally supported for nine months, and during that
|
||||
period a patch release may be issued from the release branch if a severe bug or
|
||||
security issue is found. Here are the latest Kubernetes releases and the support
|
||||
timeframe; which also applies to `kubeadm`.
|
||||
|
||||
| Kubernetes version | Release month | End-of-life-month |
|
||||
|--------------------|----------------|-------------------|
|
||||
| v1.6.x | March 2017 | December 2017 |
|
||||
| v1.7.x | June 2017 | March 2018 |
|
||||
| v1.8.x | September 2017 | June 2018 |
|
||||
| v1.9.x | December 2017 | September 2018 |
|
||||
| v1.10.x | March 2018 | December 2018 |
|
||||
kubeadm's overall feature state is **Beta**.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
1. One or more machines running a deb/rpm-compatible OS, e.g. Ubuntu or CentOS
|
||||
1. 2 GB or more of RAM per machine (any less will leave little room for your
|
||||
apps)
|
||||
1. 2 CPUs or more on the master
|
||||
1. Full network connectivity between all machines in the cluster (public or
|
||||
private network is fine)
|
||||
|
||||
{{< note >}}
|
||||
**Note:** This guide results in a Kubernetes cluster with one master and a
|
||||
number of nodes that you decide. A single master is not highly available. If
|
||||
you want to set up a multi-master cluster for high availability, you can
|
||||
follow
|
||||
[this guide instead](https://kubernetes.io/docs/setup/independent/high-availability/).
|
||||
{{< /note >}}
|
||||
- One or more machines running a deb/rpm-compatible OS, for example Ubuntu or CentOS
|
||||
- 2 GB or more of RAM per machine. Any less leaves little room for your
|
||||
apps.
|
||||
- 2 CPUs or more on the master
|
||||
- Full network connectivity among all machines in the cluster. A public or
|
||||
private network is fine.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
@@ -100,7 +39,7 @@ follow
|
||||
|
||||
## Objectives
|
||||
|
||||
* Install a secure Kubernetes cluster on your machines
|
||||
* Install a single master Kubernetes cluster or [high availability cluster](https://kubernetes.io/docs/setup/independent/high-availability/)
|
||||
* Install a Pod network on the cluster so that your Pods can
|
||||
talk to each other
|
||||
|
||||
@@ -108,15 +47,16 @@ follow
|
||||
|
||||
### Installing kubeadm on your hosts
|
||||
|
||||
See [Installing kubeadm](/docs/setup/independent/install-kubeadm/).
|
||||
See ["Installing kubeadm"](/docs/setup/independent/install-kubeadm/).
|
||||
|
||||
**Note:** If you already have kubeadm installed, you should do a `apt-get update &&
|
||||
{{< note >}}
|
||||
**Note:** If you have already installed kubeadm, run `apt-get update &&
|
||||
apt-get upgrade` or `yum update` to get the latest version of kubeadm.
|
||||
|
||||
|
||||
The kubelet is now restarting every few seconds, as it waits in a crashloop for
|
||||
kubeadm to tell it what to do. This crashloop is expected and normal, please
|
||||
proceed with the next step and the kubelet will start running normally.
|
||||
When you upgrade, the kubelet restarts every few seconds as it waits in a crashloop for
|
||||
kubeadm to tell it what to do. This crashloop is expected and normal.
|
||||
After you initialize your master, the kubelet runs normally.
|
||||
{{< /note >}}
|
||||
|
||||
### Initializing your master
|
||||
|
||||
@@ -124,72 +64,46 @@ The master is the machine where the control plane components run, including
|
||||
etcd (the cluster database) and the API server (which the kubectl CLI
|
||||
communicates with).
|
||||
|
||||
To initialize the master, first choose the pod network plugin you want and check if it requires any parameters to be passed to kubeadm while initializing the cluster. Pick one of the machines you previously installed
|
||||
kubeadm on, and run:
|
||||
1. Choose a pod network add-on, and verify whether it requires any arguments to
|
||||
be passed to kubeadm initialization. Depending on which
|
||||
third-party provider you choose, you might need to set the `--pod-network-cidr` to
|
||||
a provider-specific value. See [Installing a pod network add-on](#pod-network).
|
||||
1. (Optional) Unless otherwise specified, kubeadm uses the network interface associated
|
||||
with the default gateway to advertise the master's IP. To use a different
|
||||
network interface, specify the `--apiserver-advertise-address=<ip-address>` argument
|
||||
to `kubeadm init`. To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you
|
||||
must specify an IPv6 address, for example `--apiserver-advertise-address=fd00::101`
|
||||
|
||||
Now run:
|
||||
|
||||
```bash
|
||||
kubeadm init
|
||||
kubeadm init <args>
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
### More information
|
||||
|
||||
- Please refer to the [kubeadm reference guide](/docs/reference/setup-tools/kubeadm/kubeadm/) if you want to
|
||||
read more about the flags `kubeadm init` provides. You can also specify a
|
||||
[configuration file](/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file) instead of using flags.
|
||||
- You need to choose a Pod Network Plugin in the next step. Depending on what
|
||||
third-party provider you choose, you might have to set the `--pod-network-cidr` to
|
||||
something provider-specific. The tabs below will contain a notice about what flags
|
||||
on `kubeadm init` are required.
|
||||
- Unless otherwise specified, kubeadm uses the default gateway's network interface
|
||||
to advertise the master's IP. If you want to use a different network interface, specify
|
||||
`--apiserver-advertise-address=<ip-address>` argument to `kubeadm init`. To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you must specify an IPv6, e.g. `--apiserver-advertise-address=fd00::101`
|
||||
- If you would like to customise control plane components including optional IPv6 assignment to liveness probe for control plane components and etcd server, you can do so by providing extra args to each one, as documented [here](/docs/admin/kubeadm#custom-args).
|
||||
- `kubeadm init` will first run a series of prechecks to ensure that the machine
|
||||
is ready to run Kubernetes. It will expose warnings and exit on errors. It
|
||||
will then download and install the cluster database and control plane
|
||||
components. This may take several minutes.
|
||||
- You can't run `kubeadm init` twice without tearing down the cluster in between
|
||||
([unless you're upgrading from v1.6 to v1.7](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/)),
|
||||
see [Tear Down](#tear-down).
|
||||
- If you join a node with a different architecture to your cluster, you should create a separate
|
||||
For more information about `kubeadm init` arguments, see the [kubeadm reference guide](/docs/reference/setup-tools/kubeadm/kubeadm/).
|
||||
|
||||
For a complete list of configuration options, see the [configuration file documentation](/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file).
|
||||
|
||||
To customize control plane components, including optional IPv6 assignment to liveness probe for control plane components and etcd server, provide extra arguments to each component as documented in [custom arguments](/docs/admin/kubeadm#custom-args).
|
||||
|
||||
To run `kubeadm init` again, you must first [tear down the cluster](#tear-down).
|
||||
|
||||
If you join a node with a different architecture to your cluster, create a separate
|
||||
Deployment or DaemonSet for `kube-proxy` and `kube-dns` on the node. This is because the Docker images for these
|
||||
components do not currently support multi-architecture.
|
||||
|
||||
`kubeadm init` first runs a series of prechecks to ensure that the machine
|
||||
is ready to run Kubernetes. These prechecks expose warnings and exit on errors. `kubeadm init`
|
||||
then downloads and installs the cluster control plane components. This may take several minutes.
|
||||
The output should look like:
|
||||
|
||||
```
|
||||
[init] Using Kubernetes version: v1.8.0
|
||||
[init] Using Authorization modes: [Node RBAC]
|
||||
[init] Using Kubernetes version: vX.Y.Z
|
||||
[preflight] Running pre-flight checks
|
||||
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
|
||||
[certificates] Generated ca certificate and key.
|
||||
[certificates] Generated apiserver certificate and key.
|
||||
[certificates] apiserver serving cert is signed for DNS names [kubeadm-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.138.0.4]
|
||||
[certificates] Generated apiserver-kubelet-client certificate and key.
|
||||
[certificates] Generated sa key and public key.
|
||||
[certificates] Generated front-proxy-ca certificate and key.
|
||||
[certificates] Generated front-proxy-client certificate and key.
|
||||
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
|
||||
[kubeconfig] Wrote KubeConfig file to disk: "admin.conf"
|
||||
[kubeconfig] Wrote KubeConfig file to disk: "kubelet.conf"
|
||||
[kubeconfig] Wrote KubeConfig file to disk: "controller-manager.conf"
|
||||
[kubeconfig] Wrote KubeConfig file to disk: "scheduler.conf"
|
||||
[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
|
||||
[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
|
||||
[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
|
||||
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
|
||||
[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests"
|
||||
[init] This often takes around a minute; or longer if the control plane images have to be pulled.
|
||||
[apiclient] All control plane components are healthy after 39.511972 seconds
|
||||
[uploadconfig] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
|
||||
[markmaster] Will mark node master as master by adding a label and a taint
|
||||
[markmaster] Master master tainted and labelled with key/value: node-role.kubernetes.io/master=""
|
||||
[bootstraptoken] Using token: <token>
|
||||
[bootstraptoken] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
|
||||
[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
|
||||
[bootstraptoken] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
|
||||
[addons] Applied essential addon: kube-dns
|
||||
[addons] Applied essential addon: kube-proxy
|
||||
|
||||
... (log output of initialization workflow) ...
|
||||
|
||||
Your Kubernetes master has initialized successfully!
|
||||
|
||||
@@ -200,7 +114,7 @@ To start using your cluster, you need to run (as a regular user):
|
||||
sudo chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
|
||||
You should now deploy a pod network to the cluster.
|
||||
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
|
||||
Run "kubectl apply -f [podnetwork].yaml" with one of the addon options listed at:
|
||||
http://kubernetes.io/docs/admin/addons/
|
||||
|
||||
You can now join any number of machines by running the following on each node
|
||||
@@ -209,7 +123,8 @@ as root:
|
||||
kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>
|
||||
```
|
||||
|
||||
To make kubectl work for your non-root user, you might want to run these commands (which is also a part of the `kubeadm init` output):
|
||||
To make kubectl work for your non-root user, run these commands, which are
|
||||
also part of the `kubeadm init` output:
|
||||
|
||||
```bash
|
||||
mkdir -p $HOME/.kube
|
||||
@@ -217,36 +132,41 @@ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
sudo chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
```
|
||||
|
||||
Alternatively, if you are the `root` user, you could run this:
|
||||
Alternatively, if you are the `root` user, you can run:
|
||||
|
||||
```bash
|
||||
export KUBECONFIG=/etc/kubernetes/admin.conf
|
||||
```
|
||||
|
||||
Make a record of the `kubeadm join` command that `kubeadm init` outputs. You
|
||||
will need this in a moment.
|
||||
need this command to [join nodes to your cluster](#join-nodes).
|
||||
|
||||
The token is used for mutual authentication between the master and the joining
|
||||
nodes. The token included here is secret, keep it safe as anyone with this
|
||||
nodes. The token included here is secret. Keep it safe, because anyone with this
|
||||
token can add authenticated nodes to your cluster. These tokens can be listed,
|
||||
created and deleted with the `kubeadm token` command. See the
|
||||
[reference guide](/docs/reference/setup-tools/kubeadm/kubeadm-token/) for more details.
|
||||
created, and deleted with the `kubeadm token` command. See the
|
||||
[kubeadm reference guide](/docs/reference/setup-tools/kubeadm/kubeadm-token/).
|
||||
|
||||
### Installing a pod network {#pod-network}
|
||||
### Installing a pod network add-on {#pod-network}
|
||||
|
||||
You **MUST** install a pod network add-on so that your pods can communicate with
|
||||
{{< caution >}}
|
||||
**Caution:** This section contains important information about installation and deployment order. Read it carefully before proceeding.
|
||||
{{< /caution >}}
|
||||
|
||||
You must install a pod network add-on so that your pods can communicate with
|
||||
each other.
|
||||
|
||||
**The network must be deployed before any applications. Also, kube-dns, an
|
||||
internal helper service, will not start up before a network is installed. kubeadm only
|
||||
supports Container Network Interface (CNI) based networks (and does not support kubenet).**
|
||||
The network must be deployed before any applications. An
|
||||
internal helper service, kube-dns, will not start up before a network is installed. kubeadm
|
||||
supports only Container Network Interface (CNI) based networks. It 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 page](/docs/concepts/cluster-administration/addons/) for a complete list of available network add-ons. IPv6 support was added in [CNI v0.6.0](https://github.com/containernetworking/cni/releases/tag/v0.6.0). [CNI bridge](https://github.com/containernetworking/plugins/blob/master/plugins/main/bridge/README.md) and [local-ipam](https://github.com/containernetworking/plugins/blob/master/plugins/ipam/host-local/README.md) are the only supported IPv6 network plugins in 1.9.
|
||||
support [Network Policy](/docs/concepts/services-networking/networkpolicies/). See the [add-ons page](/docs/concepts/cluster-administration/addons/) for a complete list of available network add-ons.
|
||||
- IPv6 support was added in [CNI v0.6.0](https://github.com/containernetworking/cni/releases/tag/v0.6.0).
|
||||
- [CNI bridge](https://github.com/containernetworking/plugins/blob/master/plugins/main/bridge/README.md) and [local-ipam](https://github.com/containernetworking/plugins/blob/master/plugins/ipam/host-local/README.md) are the only supported IPv6 network plugins in Kubernetes version 1.9.
|
||||
|
||||
|
||||
**Note:** kubeadm sets up a more secure cluster by default and enforces use of [RBAC](#TODO).
|
||||
Please make sure that the network manifest of choice supports RBAC.
|
||||
Note that kubeadm sets up a more secure cluster by default and enforces use of [RBAC].
|
||||
Make sure that your network manifest supports RBAC.
|
||||
|
||||
You can install a pod network add-on with the following command:
|
||||
|
||||
@@ -254,45 +174,41 @@ You can install a pod network add-on with the following command:
|
||||
kubectl apply -f <add-on.yaml>
|
||||
```
|
||||
|
||||
**NOTE:** You can install **only one** pod network per cluster.
|
||||
You can install only one pod network per cluster.
|
||||
|
||||
{{< tabs name="tabs-pod-install" >}}
|
||||
{{% tab name="Choose one..." %}}
|
||||
Please select one of the tabs to see installation instructions for the respective third-party Pod Network Provider.
|
||||
{{% /tab %}}
|
||||
|
||||
{{% tab name="Calico" %}}
|
||||
For more information about using Calico, see [Quickstart for Calico on Kubernetes](https://docs.projectcalico.org/latest/getting-started/kubernetes/), [Installing Calico for policy and networking](https://docs.projectcalico.org/latest/getting-started/kubernetes/installation/calico), and other related resources.
|
||||
|
||||
**Note:**
|
||||
|
||||
- In order for Network Policy to work correctly, you need to pass `--pod-network-cidr=192.168.0.0/16` to `kubeadm init`.
|
||||
- Calico works on `amd64` only.
|
||||
In order for Network Policy to work correctly, you need to pass `--pod-network-cidr=192.168.0.0/16` to `kubeadm init`. Note that Calico works on `amd64` only.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
|
||||
```
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab name="Canal" %}}
|
||||
Canal uses Calico for policy and Flannel for networking. Refer to the Calico documentation for the [official getting started guide](https://docs.projectcalico.org/latest/getting-started/kubernetes/installation/flannel).
|
||||
|
||||
**Note:**
|
||||
|
||||
- For Canal to work correctly, `--pod-network-cidr=10.244.0.0/16` has to be passed to `kubeadm init`.
|
||||
- Canal works on `amd64` only.
|
||||
For Canal to work correctly, `--pod-network-cidr=10.244.0.0/16` has to be passed to `kubeadm init`. Note that Canal works on `amd64` only.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/canal/rbac.yaml
|
||||
kubectl apply -f https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/canal/canal.yaml
|
||||
```
|
||||
|
||||
{{% /tab %}}
|
||||
{{% tab name="Flannel" %}}
|
||||
**Note:**
|
||||
|
||||
- For `flannel` to work correctly, `--pod-network-cidr=10.244.0.0/16` has to be passed to `kubeadm init`.
|
||||
- `flannel` works on `amd64`, `arm`, `arm64` and `ppc64le`, but for it to work on a platform other than
|
||||
`amd64` you have to manually download the manifest and replace `amd64` occurrences with your chosen platform.
|
||||
- Set `/proc/sys/net/bridge/bridge-nf-call-iptables` to `1` by running `sysctl net.bridge.bridge-nf-call-iptables=1`
|
||||
For `flannel` to work correctly, `--pod-network-cidr=10.244.0.0/16` has to be passed to `kubeadm init`. Note that `flannel` works on `amd64`, `arm`, `arm64` and `ppc64le`. For it to work on a platform other than
|
||||
`amd64`, you must manually download the manifest and replace `amd64` occurrences with your chosen platform.
|
||||
|
||||
Set `/proc/sys/net/bridge/bridge-nf-call-iptables` to `1` by running `sysctl net.bridge.bridge-nf-call-iptables=1`
|
||||
to pass bridged IPv4 traffic to iptables' chains. This is a requirement for some CNI plugins to work, for more information
|
||||
please see [here](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements).
|
||||
|
||||
@@ -300,8 +216,10 @@ please see [here](https://kubernetes.io/docs/concepts/cluster-administration/net
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml
|
||||
```
|
||||
|
||||
- For more information about `flannel`, please see [here](https://github.com/coreos/flannel).
|
||||
For more information about `flannel`, see [the CoreOS flannel repository on GitHub
|
||||
](https://github.com/coreos/flannel).
|
||||
{{% /tab %}}
|
||||
|
||||
{{% tab name="Kube-router" %}}
|
||||
Set `/proc/sys/net/bridge/bridge-nf-call-iptables` to `1` by running `sysctl net.bridge.bridge-nf-call-iptables=1`
|
||||
to pass bridged IPv4 traffic to iptables' chains. This is a requirement for some CNI plugins to work, for more information
|
||||
@@ -313,6 +231,7 @@ Kube-router provides pod networking, network policy, and high-performing IP Virt
|
||||
|
||||
For information on setting up Kubernetes cluster with Kube-router using kubeadm, please see official [setup guide](https://github.com/cloudnativelabs/kube-router/blob/master/docs/kubeadm.md).
|
||||
{{% /tab %}}
|
||||
|
||||
{{% tab name="Romana" %}}
|
||||
Set `/proc/sys/net/bridge/bridge-nf-call-iptables` to `1` by running `sysctl net.bridge.bridge-nf-call-iptables=1`
|
||||
to pass bridged IPv4 traffic to iptables' chains. This is a requirement for some CNI plugins to work, for more information
|
||||
@@ -320,12 +239,13 @@ please see [here](https://kubernetes.io/docs/concepts/cluster-administration/net
|
||||
|
||||
The official Romana set-up guide is [here](https://github.com/romana/romana/tree/master/containerize#using-kubeadm).
|
||||
|
||||
**Note:** Romana works on `amd64` only.
|
||||
Romana works on `amd64` only.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/romana/romana/master/containerize/specs/romana-kubeadm.yml
|
||||
```
|
||||
{{% /tab %}}
|
||||
|
||||
{{% tab name="Weave Net" %}}
|
||||
Set `/proc/sys/net/bridge/bridge-nf-call-iptables` to `1` by running `sysctl net.bridge.bridge-nf-call-iptables=1`
|
||||
to pass bridged IPv4 traffic to iptables' chains. This is a requirement for some CNI plugins to work, for more information
|
||||
@@ -333,7 +253,7 @@ please see [here](https://kubernetes.io/docs/concepts/cluster-administration/net
|
||||
|
||||
The official Weave Net set-up guide is [here](https://www.weave.works/docs/net/latest/kube-addon/).
|
||||
|
||||
**Note:** Weave Net works on `amd64`, `arm`, `arm64` and `ppc64le` without any extra action required.
|
||||
Weave Net works on `amd64`, `arm`, `arm64` and `ppc64le` without any extra action required.
|
||||
Weave Net sets hairpin mode by default. This allows Pods to access themselves via their Service IP address
|
||||
if they don't know their PodIP.
|
||||
|
||||
@@ -343,10 +263,9 @@ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl versio
|
||||
{{% /tab %}}
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
Once a pod network has been installed, you can confirm that it is working by
|
||||
Once you install a pod network, you can confirm that it works by
|
||||
checking that the kube-dns pod is Running in the output of `kubectl get pods --all-namespaces`.
|
||||
And once the kube-dns pod is up and running, you can continue by joining your nodes.
|
||||
Once the kube-dns pod is up and running, you can continue by joining your nodes.
|
||||
|
||||
If your network is not working or kube-dns is not in the Running state, check
|
||||
out our [troubleshooting docs](/docs/setup/independent/troubleshooting-kubeadm/).
|
||||
@@ -373,7 +292,7 @@ This will remove the `node-role.kubernetes.io/master` taint from any nodes that
|
||||
have it, including the master node, meaning that the scheduler will then be able
|
||||
to schedule pods everywhere.
|
||||
|
||||
### Joining your nodes
|
||||
### Joining your nodes {join-nodes}
|
||||
|
||||
The nodes are where your workloads (containers and pods, etc) run. To add new nodes to your cluster do the following for each machine:
|
||||
|
||||
@@ -393,15 +312,8 @@ The output should look something like:
|
||||
|
||||
```
|
||||
[preflight] Running pre-flight checks
|
||||
[discovery] Trying to connect to API Server "10.138.0.4:6443"
|
||||
[discovery] Created cluster-info discovery client, requesting info from "https://10.138.0.4:6443"
|
||||
[discovery] Requesting info from "https://10.138.0.4:6443" again to validate TLS against the pinned public key
|
||||
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "10.138.0.4:6443"
|
||||
[discovery] Successfully established connection with API Server "10.138.0.4:6443"
|
||||
[bootstrap] Detected server version: v1.8.0
|
||||
[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)
|
||||
[csr] Created API client to obtain unique certificate for this node, generating keys and certificate signing request
|
||||
[csr] Received signed certificate from the API server, generating KubeConfig...
|
||||
|
||||
... (log output of join workflow) ...
|
||||
|
||||
Node join complete:
|
||||
* Certificate signing request sent to master and response
|
||||
@@ -425,17 +337,19 @@ scp root@<master ip>:/etc/kubernetes/admin.conf .
|
||||
kubectl --kubeconfig ./admin.conf get nodes
|
||||
```
|
||||
|
||||
**Note:**
|
||||
- The example above assumes SSH access is enabled for root. If that is not the
|
||||
case, you can copy the `admin.conf` file to be accessible by some other user
|
||||
and `scp` using that other user instead.
|
||||
- The `admin.conf` file gives the user _superuser_ privileges over the cluster.
|
||||
This file should be used sparingly. For normal users, it's recommended to
|
||||
generate an unique credential to which you whitelist privileges. You can do
|
||||
this with the `kubeadm alpha phase kubeconfig user --client-name <CN>`
|
||||
command. That command will print out a KubeConfig file to STDOUT which you
|
||||
should save to a file and distribute to your user. After that, whitelist
|
||||
privileges by using `kubectl create (cluster)rolebinding`.
|
||||
{{< note >}}
|
||||
**Note:** The example above assumes SSH access is enabled for root. If that is not the
|
||||
case, you can copy the `admin.conf` file to be accessible by some other user
|
||||
and `scp` using that other user instead.
|
||||
|
||||
The `admin.conf` file gives the user _superuser_ privileges over the cluster.
|
||||
This file should be used sparingly. For normal users, it's recommended to
|
||||
generate an unique credential to which you whitelist privileges. You can do
|
||||
this with the `kubeadm alpha phase kubeconfig user --client-name <CN>`
|
||||
command. That command will print out a KubeConfig file to STDOUT which you
|
||||
should save to a file and distribute to your user. After that, whitelist
|
||||
privileges by using `kubectl create (cluster)rolebinding`.
|
||||
{{< /note >}}
|
||||
|
||||
### (Optional) Proxying API Server to localhost
|
||||
|
||||
@@ -474,17 +388,9 @@ appropriate arguments.
|
||||
More options and information about the
|
||||
[`kubeadm reset command`](/docs/reference/setup-tools/kubeadm/kubeadm-reset/).
|
||||
|
||||
## Upgrading a kubeadm cluster {#upgrades}
|
||||
## Maintaining a cluster {#lifecycle}
|
||||
|
||||
Instructions for upgrading kubeadm clusters are available for:
|
||||
|
||||
* [1.6 to 1.7 upgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-7/)
|
||||
* [1.7.x to 1.7.y upgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-8/)
|
||||
* [1.7 to 1.8 upgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-8/)
|
||||
* [1.8.x to 1.8.y upgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-8/)
|
||||
* [1.8 to 1.9 upgrades/downgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-9/)
|
||||
* [1.9.x to 1.9.y upgrades](/docs/tasks/administer-cluster/kubeadm-upgrade-1-9/)
|
||||
* [1.9.x to 1.9.y HA cluster upgrades](/docs/tasks/administer-cluster/upgrade-downgrade/kubeadm-upgrade-ha/)
|
||||
Instructions for maintaining kubeadm clusters (e.g. upgrades,downgrades, etc.) can be found [here.](/docs/tasks/administer-cluster/kubeadm)
|
||||
|
||||
## Explore other add-ons {#other-addons}
|
||||
|
||||
@@ -494,21 +400,21 @@ control of your Kubernetes cluster.
|
||||
|
||||
## What's next {#whats-next}
|
||||
|
||||
* Verify that your cluster is running properly with [Sonobuoy](https://github.com/heptio/sonobuoy)
|
||||
* Learn about kubeadm's advanced usage in the [kubeadm reference documentation](/docs/reference/setup-tools/kubeadm/kubeadm)
|
||||
* Learn more about Kubernetes [concepts](/docs/concepts/) and [`kubectl`](/docs/user-guide/kubectl-overview/).
|
||||
* Configure log rotation. You can use **logrotate** for that. When using Docker, you can specify log rotation options for Docker daemon, for example `--log-driver=json-file --log-opt=max-size=10m --log-opt=max-file=5`. See [Configure and troubleshoot the Docker daemon](https://docs.docker.com/engine/admin/) for more details.
|
||||
|
||||
## Feedback {#feedback}
|
||||
|
||||
* kubeadm support Slack Channel:
|
||||
* For bugs, visit [kubeadm Github issue tracker](https://github.com/kubernetes/kubeadm/issues)
|
||||
* For support, visit kubeadm Slack Channel:
|
||||
[#kubeadm](https://kubernetes.slack.com/messages/kubeadm/)
|
||||
* General SIG Cluster Lifecycle Development Slack Channel:
|
||||
[#sig-cluster-lifecycle](https://kubernetes.slack.com/messages/sig-cluster-lifecycle/)
|
||||
* SIG Cluster Lifecycle [SIG information](#TODO)
|
||||
* SIG Cluster Lifecycle Mailing List:
|
||||
[kubernetes-sig-cluster-lifecycle](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle)
|
||||
* [kubeadm Github issue tracker](https://github.com/kubernetes/kubeadm/issues)
|
||||
|
||||
|
||||
## Version skew policy {#version-skew-policy}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: "Administration with kubeadm"
|
||||
weight: 10
|
||||
---
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: "Upgrading or downgrading Kubernetes"
|
||||
weight: 10
|
||||
---
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
---
|
||||
reviewers:
|
||||
- pipejakob
|
||||
title: Upgrading kubeadm clusters from 1.6 to 1.7
|
||||
content_template: templates/task
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
|
||||
This guide is for upgrading kubeadm clusters from version 1.6.x to 1.7.x.
|
||||
Upgrades are not supported for clusters lower than 1.6, which is when kubeadm
|
||||
became Beta.
|
||||
|
||||
**WARNING**: These instructions will **overwrite** all of the resources managed
|
||||
by kubeadm (static pod manifest files, service accounts and RBAC rules in the
|
||||
`kube-system` namespace, etc.), so any customizations you may have made to these
|
||||
resources after cluster setup will need to be reapplied after the upgrade. The
|
||||
upgrade will not disturb other static pod manifest files or objects outside the
|
||||
`kube-system` namespace.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
You need to have a Kubernetes cluster running version 1.6.x.
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
## On the master
|
||||
|
||||
1. Upgrade system packages.
|
||||
|
||||
Upgrade your OS packages for kubectl, kubeadm, kubelet, and kubernetes-cni.
|
||||
|
||||
a. On Debian, this can be accomplished with:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
|
||||
b. On CentOS/Fedora, you would instead run:
|
||||
|
||||
sudo yum update
|
||||
|
||||
2. Restart kubelet.
|
||||
|
||||
systemctl restart kubelet
|
||||
|
||||
3. Delete the `kube-proxy` DaemonSet.
|
||||
|
||||
Although most components are automatically upgraded by the next step,
|
||||
`kube-proxy` currently needs to be manually deleted so it can be recreated at
|
||||
the correct version:
|
||||
|
||||
sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl delete daemonset kube-proxy -n kube-system
|
||||
|
||||
4. Perform kubeadm upgrade.
|
||||
|
||||
**WARNING**: All parameters you passed to the first `kubeadm init` when you bootstrapped your
|
||||
cluster **MUST** be specified here in the upgrade-`kubeadm init`-command. This is a limitation
|
||||
we plan to address in v1.8.
|
||||
|
||||
sudo kubeadm init --skip-preflight-checks --kubernetes-version <DESIRED_VERSION>
|
||||
|
||||
For instance, if you want to upgrade to `1.7.0`, you would run:
|
||||
|
||||
sudo kubeadm init --skip-preflight-checks --kubernetes-version v1.7.0
|
||||
|
||||
5. Upgrade CNI provider.
|
||||
|
||||
Your CNI provider might have its own upgrade instructions to follow now.
|
||||
Check the [addons](/docs/concepts/cluster-administration/addons/) page to
|
||||
find your CNI provider and see if there are additional upgrade steps
|
||||
necessary.
|
||||
|
||||
## On each node
|
||||
|
||||
1. Upgrade system packages.
|
||||
|
||||
Upgrade your OS packages for kubectl, kubeadm, kubelet, and kubernetes-cni.
|
||||
|
||||
a. On Debian, this can be accomplished with:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
|
||||
b. On CentOS/Fedora, you would instead run:
|
||||
|
||||
sudo yum update
|
||||
|
||||
2. Restart kubelet.
|
||||
|
||||
systemctl restart kubelet
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
reviewers:
|
||||
- mml
|
||||
title: Cluster Management Guide for Version 1.6
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
This document outlines the potentially disruptive changes that exist in the 1.6 release cycle. Operators, administrators, and developers should
|
||||
take note of the changes below in order to maintain continuity across their upgrade process.
|
||||
|
||||
## Cluster defaults set to etcd 3
|
||||
|
||||
In the 1.6 release cycle, the default backend storage layer has been upgraded to fully leverage [etcd 3 capabilities](https://coreos.com/blog/etcd3-a-new-etcd.html) by default.
|
||||
For new clusters, there is nothing an operator will need to do, it should "just work". However, if you are upgrading from a 1.5 cluster, care should be taken to ensure
|
||||
continuity.
|
||||
|
||||
It is possible to maintain v2 compatibility mode while running etcd 3 for an interim period of time. To do this, you will simply need to update an argument passed to your apiserver during
|
||||
startup:
|
||||
|
||||
```
|
||||
$ kube-apiserver --storage-backend='etcd2' $(EXISTING_ARGS)
|
||||
```
|
||||
|
||||
However, for long-term maintenance of the cluster, we recommend that the operator plan an outage window in order to perform a [v2->v3 data upgrade](https://coreos.com/etcd/docs/latest/upgrades/upgrade_3_0.html).
|
||||
Reference in New Issue
Block a user