Skip to content

Commit 8ff98a8

Browse files
committed
Update docs/admin/kubeadm.md to cover self-hosting in 1.8.
This is a new beta feature in 1.8.
1 parent 5b9b634 commit 8ff98a8

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

docs/admin/kubeadm.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ using kubeadm.
607607
- Less convenient to use manually since the file is difficult to copy and paste
608608
between nodes.
609609

610-
## Use Kubeadm with other CRI runtimes
610+
## Use kubeadm with other CRI runtimes
611611

612612
Since [Kubernetes 1.6 release](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#node-components-1), Kubernetes container runtimes have been transferred to using CRI by default. Currently, the build-in container runtime is Docker which is enabled by build-in `dockershim` in `kubelet`.
613613

@@ -820,6 +820,60 @@ This means you can, for example, prepopulate `/etc/kubernetes/pki/ca.crt`
820820
and `/etc/kubernetes/pki/ca.key` with an existing CA, which then will be used
821821
for signing the rest of the certs.
822822

823+
## Self-hosting the Kubernetes control plane {#self-hosting}
824+
As of 1.8, kubeadm can experimentally create a _self-hosted_ Kubernetes control
825+
plane. This means that key components such as the API server, controller
826+
manager, and scheduler run as [DaemonSet pods](/docs/concepts/workloads/controllers/daemonset/)
827+
configured via the Kubernetes API instead of [static pods](/docs/tasks/administer-cluster/static-pod/)
828+
configured in the kubelet via static files.
829+
830+
Self-hosting is alpha in kubeadm 1.8 but is expected to become the default in
831+
a future version. To create a self-hosted cluster, pass the `--feature-gates=SelfHosting=true`
832+
flag to `kubeadm init`.
833+
834+
#### Caveats
835+
Kubeadm self-hosting in 1.8 has some important limitations. In particular, a
836+
self-hosted cluster cannot currently recover from a reboot of the master node
837+
without manual intervention. This and other limitations are expected to be
838+
resolved before self-hosting graduates from alpha.
839+
840+
By default, self-hosted control plane pods rely on credentials loaded from
841+
[`hostPath`](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath)
842+
volumes. Except for initial creation, these credentials are not managed by
843+
kubeadm. You can use `--feature-gates=StoreCertsInSecrets=true` to enable an
844+
experimental mode where control plane credentials are loaded from Secrets
845+
instead. This requires very careful control over the authentication and
846+
authorization configuration for your cluster, and may not be appropriate for
847+
your environment.
848+
849+
In 1.8, the self-hosted portion of the control plane does not include etcd,
850+
which still runs as a static pod.
851+
852+
#### Process
853+
The self-hosting bootstrap process is documented in [the kubeadm 1.8 design
854+
document](https://github.com/kubernetes/kubeadm/blob/master/docs/design/design_v1.8.md#optional-self-hosting).
855+
In summary, `kubeadm init --feature-gates=SelfHosting=true` works as follows:
856+
857+
1. As usual, kubeadm creates static pod YAML files in `/etc/kubernetes/manifests/`.
858+
859+
1. Kubelet loads these files and launches the initial static control plane.
860+
Kubeadm waits for this initial static control plane to be running and
861+
healthy. This is identical to the `kubeadm init` process without self-hosting.
862+
863+
1. Kubeadm uses the static control plane pod manifests to construct a set of
864+
DaemonSet manifests that will run the self-hosted control plane.
865+
866+
1. Kubeadm creates DaemonSets in the `kube-system` namespace and waits for the
867+
resulting pods to be running.
868+
869+
1. Once the new control plane is running (but not yet active), kubeadm deletes
870+
the static pod YAML files. This triggers kubelet to stop those static pods.
871+
872+
1. When the original static control plane stops, the new self-hosted control
873+
plane is able to bind to listening ports and become active.
874+
875+
This process (steps 3-6) can also be triggered with `kubeadm phase selfhosting convert-from-staticpods`.
876+
823877
## Releases and release notes
824878

825879
If you already have kubeadm installed and want to upgrade, run `apt-get update

0 commit comments

Comments
 (0)