Skip to content

Commit b58517c

Browse files
authored
Merge pull request #20492 from prasadkatti/doc_fixes
Update kubeadm implementation details page
2 parents d0ab4d6 + 4efaf2a commit b58517c

File tree

2 files changed

+29
-41
lines changed

2 files changed

+29
-41
lines changed

content/en/docs/reference/setup-tools/kubeadm/implementation-details.md

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ The cluster that `kubeadm init` and `kubeadm join` set up should be:
2929
- lock-down the kubelet API
3030
- locking down access to the API for system components like the kube-proxy and CoreDNS
3131
- locking down what a Bootstrap Token can access
32-
- etc.
3332
- **Easy to use**: The user should not have to run anything more than a couple of commands:
3433
- `kubeadm init`
3534
- `export KUBECONFIG=/etc/kubernetes/admin.conf`
3635
- `kubectl apply -f <network-of-choice.yaml>`
3736
- `kubeadm join --token <token> <master-ip>:<master-port>`
3837
- **Extendable**:
39-
- It should for example _not_ favor any network provider, instead configuring a network is out-of-scope
40-
- Should provide the possibility to use a config file for customizing various parameters
38+
- It should _not_ favor any particular network provider. Configuring the cluster network is out-of-scope
39+
- It should provide the possibility to use a config file for customizing various parameters
4140

4241
## Constants and well-known values and paths
4342

44-
In order to reduce complexity and to simplify development of an on-top-of-kubeadm-implemented deployment solution, kubeadm uses a
45-
limited set of constants values for well know-known paths and file names.
43+
In order to reduce complexity and to simplify development of higher level tools that build on top of kubeadm, it uses a
44+
limited set of constant values for well-known paths and file names.
4645

4746
The Kubernetes directory `/etc/kubernetes` is a constant in the application, since it is clearly the given path
4847
in a majority of cases, and the most intuitive location; other constants paths and file names are:
@@ -70,14 +69,14 @@ in a majority of cases, and the most intuitive location; other constants paths a
7069
The `kubeadm init` [internal workflow](/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-workflow) consists of a sequence of atomic work tasks to perform,
7170
as described in `kubeadm init`.
7271

73-
The [`kubeadm init phase`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/) command allows users to invoke individually each task, and ultimately offers a reusable and composable
74-
API/toolbox that can be used by other Kubernetes bootstrap tools, by any IT automation tool or by advanced user
72+
The [`kubeadm init phase`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/) command allows users to invoke each task individually, and ultimately offers a reusable and composable
73+
API/toolbox that can be used by other Kubernetes bootstrap tools, by any IT automation tool or by an advanced user
7574
for creating custom clusters.
7675

7776
### Preflight checks
7877

7978
Kubeadm executes a set of preflight checks before starting the init, with the aim to verify preconditions and avoid common cluster startup problems.
80-
In any case the user can skip specific preflight checks (or eventually all preflight checks) with the `--ignore-preflight-errors` option.
79+
The user can skip specific preflight checks or all of them with the `--ignore-preflight-errors` option.
8180

8281
- [warning] If the Kubernetes version to use (specified with the `--kubernetes-version` flag) is at least one minor version higher than the kubeadm CLI version.
8382
- Kubernetes system requirements:
@@ -161,9 +160,9 @@ Certificates are stored by default in `/etc/kubernetes/pki`, but this directory
161160

162161
### Generate kubeconfig files for control plane components
163162

164-
Kubeadm kubeconfig files with identities for control plane components:
163+
Kubeadm generates kubeconfig files with identities for control plane components:
165164

166-
- A kubeconfig file for kubelet to use, `/etc/kubernetes/kubelet.conf`; inside this file is embedded a client certificate with kubelet identity.
165+
- A kubeconfig file for the kubelet to use during TLS bootstrap - /etc/kubernetes/bootstrap-kubelet.conf. Inside this file there is a bootstrap-token or embedded client certificates for authenticating this node with the cluster.
167166
This client cert should:
168167
- Be in the `system:nodes` organization, as required by the [Node Authorization](/docs/reference/access-authn-authz/node/) module
169168
- Have the Common Name (CN) `system:node:<hostname-lowercased>`
@@ -173,11 +172,11 @@ by default [RBAC core components roles](/docs/reference/access-authn-authz/rbac/
173172
- A kubeconfig file for scheduler, `/etc/kubernetes/scheduler.conf`; inside this file is embedded a client certificate with scheduler identity.
174173
This client cert should have the CN `system:kube-scheduler`, as defined by default [RBAC core components roles](/docs/reference/access-authn-authz/rbac/#core-component-roles)
175174

176-
Additionally, a kubeconfig file for kubeadm to use itself and the admin is generated and save into the `/etc/kubernetes/admin.conf` file.
177-
The "admin" here is defined the actual person(s) that is administering the cluster and want to have full control (**root**) over the cluster.
178-
The embedded client certificate for admin should:
179-
- Be in the `system:masters` organization, as defined by default [RBAC user facing role bindings](/docs/reference/access-authn-authz/rbac/#user-facing-roles)
180-
- Include a CN, but that can be anything. Kubeadm uses the `kubernetes-admin` CN
175+
Additionally, a kubeconfig file for kubeadm itself and the admin is generated and saved into the `/etc/kubernetes/admin.conf` file.
176+
The "admin" here is defined as the actual person(s) that is administering the cluster and wants to have full control (**root**) over the cluster.
177+
The embedded client certificate for admin should be in the `system:masters` organization, as defined by default
178+
[RBAC user facing role bindings](/docs/reference/access-authn-authz/rbac/#user-facing-roles). It should also include a
179+
CN. Kubeadm uses the `kubernetes-admin` CN.
181180

182181
Please note that:
183182

@@ -189,28 +188,24 @@ Please note that:
189188

190189
### Generate static Pod manifests for control plane components
191190

192-
Kubeadm writes static Pod manifest files for control plane components to `/etc/kubernetes/manifests`; the kubelet watches this directory for Pods to create on startup.
191+
Kubeadm writes static Pod manifest files for control plane components to `/etc/kubernetes/manifests`. The kubelet watches this directory for Pods to create on startup.
193192

194193
Static Pod manifest share a set of common properties:
195194

196195
- All static Pods are deployed on `kube-system` namespace
197-
- All static Pods gets `tier:control-plane` and `component:{component-name}` labels
198-
- All static Pods gets `scheduler.alpha.kubernetes.io/critical-pod` annotation (this will be moved over to the proper solution
199-
of using Pod Priority and Preemption when ready)
196+
- All static Pods get `tier:control-plane` and `component:{component-name}` labels
197+
- All static Pods use the `system-node-critical` priority class
200198
- `hostNetwork: true` is set on all static Pods to allow control plane startup before a network is configured; as a consequence:
201199
* The `address` that the controller-manager and the scheduler use to refer the API server is `127.0.0.1`
202200
* If using a local etcd server, `etcd-servers` address will be set to `127.0.0.1:2379`
203201
- Leader election is enabled for both the controller-manager and the scheduler
204202
- Controller-manager and the scheduler will reference kubeconfig files with their respective, unique identities
205-
- All static Pods gets any extra flags specified by the user as described in [passing custom arguments to control plane components](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/)
206-
- All static Pods gets any extra Volumes specified by the user (Host path)
203+
- All static Pods get any extra flags specified by the user as described in [passing custom arguments to control plane components](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/)
204+
- All static Pods get any extra Volumes specified by the user (Host path)
207205

208206
Please note that:
209207

210-
1. All the images, for the `--kubernetes-version`/current architecture, will be pulled from `k8s.gcr.io`;
211-
In case an alternative image repository or CI image repository is specified this one will be used; In case a specific container image
212-
should be used for all control plane components, this one will be used. see [using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images)
213-
for more details
208+
1. All images will be pulled from k8s.gcr.io by default. See [using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images) for customizing the image repository
214209
2. In case of kubeadm is executed in the `--dry-run` mode, static Pods files are written in a temporary folder
215210
3. Static Pod manifest generation for master components can be invoked individually with the [`kubeadm init phase control-plane all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-control-plane) command
216211

@@ -300,8 +295,7 @@ a local etcd instance running in a Pod with following attributes:
300295

301296
Please note that:
302297

303-
1. The etcd image will be pulled from `k8s.gcr.io`. In case an alternative image repository is specified this one will be used;
304-
In case an alternative image name is specified, this one will be used. see [using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images) for more details
298+
1. The etcd image will be pulled from `k8s.gcr.io` by default. See [using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images) for customizing the image repository
305299
2. in case of kubeadm is executed in the `--dry-run` mode, the etcd static Pod manifest is written in a temporary folder
306300
3. Static Pod manifest generation for local etcd can be invoked individually with the [`kubeadm init phase etcd local`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-etcd) command
307301

@@ -324,10 +318,9 @@ Please note that:
324318

325319
### Wait for the control plane to come up
326320

327-
This is a critical moment in time for kubeadm clusters.
328-
kubeadm waits until `localhost:6443/healthz` returns `ok`, however in order to detect deadlock conditions, kubeadm fails fast
329-
if `localhost:10255/healthz` (kubelet liveness) or `localhost:10255/healthz/syncloop` (kubelet readiness) don't return `ok`,
330-
respectively after 40 and 60 second.
321+
kubeadm waits (upto 4m0s) until `localhost:6443/healthz` (kube-apiserver liveness) returns `ok`. However in order to detect
322+
deadlock conditions, kubeadm fails fast if `localhost:10255/healthz` (kubelet liveness) or
323+
`localhost:10255/healthz/syncloop` (kubelet readiness) don't return `ok` within 40s and 60s respectively.
331324

332325
kubeadm relies on the kubelet to pull the control plane images and run them properly as static Pods.
333326
After the control plane is up, kubeadm completes the tasks described in following paragraphs.
@@ -343,19 +336,15 @@ If kubeadm is invoked with `--feature-gates=DynamicKubeletConfig`:
343336

344337
### Save the kubeadm ClusterConfiguration in a ConfigMap for later reference
345338

346-
kubeadm saves the configuration passed to `kubeadm init`, either via flags or the config file, in a ConfigMap
347-
named `kubeadm-config` under `kube-system` namespace.
339+
kubeadm saves the configuration passed to `kubeadm init` in a ConfigMap named `kubeadm-config` under `kube-system` namespace.
348340

349341
This will ensure that kubeadm actions executed in future (e.g `kubeadm upgrade`) will be able to determine the actual/current cluster
350342
state and make new decisions based on that data.
351343

352344
Please note that:
353345

354-
1. Before uploading, sensitive information like e.g. the token is stripped from the configuration
346+
1. Before saving the ClusterConfiguration, sensitive information like the token is stripped from the configuration
355347
2. Upload of master configuration can be invoked individually with the [`kubeadm init phase upload-config`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-upload-config) command
356-
3. If you initialized your cluster using kubeadm v1.7.x or lower, you must create manually the master configuration ConfigMap
357-
before `kubeadm upgrade` to v1.8 . In order to facilitate this task, the [`kubeadm config upload (from-flags|from-file)`](/docs/reference/setup-tools/kubeadm/kubeadm-config/)
358-
was implemented
359348

360349
### Mark master
361350

@@ -421,8 +410,8 @@ and the default role `system:certificates.k8s.io:certificatesigningrequests:self
421410

422411
This phase creates the `cluster-info` ConfigMap in the `kube-public` namespace.
423412

424-
Additionally it is created a role and a RoleBinding granting access to the ConfigMap for unauthenticated users
425-
(i.e. users in RBAC group `system:unauthenticated`)
413+
Additionally it creates a Role and a RoleBinding granting access to the ConfigMap for unauthenticated users
414+
(i.e. users in RBAC group `system:unauthenticated`).
426415

427416
Please note that:
428417

content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ following steps:
2323
considered errors and will exit kubeadm until the problem is corrected or the
2424
user specifies `--ignore-preflight-errors=<list-of-errors>`.
2525

26-
1. Generates a self-signed CA (or using an existing one if provided) to set up
27-
identities for each component in the cluster. If the user has provided their
26+
1. Generates a self-signed CA to set up identities for each component in the cluster. The user can provide their
2827
own CA cert and/or key by dropping it in the cert directory configured via `--cert-dir`
2928
(`/etc/kubernetes/pki` by default).
3029
The APIServer certs will have additional SAN entries for any `--apiserver-cert-extra-sans` arguments, lowercased if necessary.

0 commit comments

Comments
 (0)