Skip to content

Commit 14e613d

Browse files
committed
Clean up kubeadm/implementation-details.md
1 parent be17efa commit 14e613d

File tree

1 file changed

+65
-66
lines changed

1 file changed

+65
-66
lines changed

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

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ in a majority of cases, and the most intuitive location; other constants paths a
6666
- `admin.conf` for the cluster admin and kubeadm itself
6767
- `super-admin.conf` for the cluster super-admin that can bypass RBAC
6868

69-
- Names of certificates and key files :
69+
- Names of certificates and key files:
7070

7171
- `ca.crt`, `ca.key` for the Kubernetes certificate authority
7272
- `apiserver.crt`, `apiserver.key` for the API server certificate
@@ -93,29 +93,29 @@ Kubeadm executes a set of preflight checks before starting the init, with the ai
9393
preconditions and avoid common cluster startup problems.
9494
The user can skip specific preflight checks or all of them with the `--ignore-preflight-errors` option.
9595

96-
- [warning] If the Kubernetes version to use (specified with the `--kubernetes-version` flag) is
96+
- [Warning] if the Kubernetes version to use (specified with the `--kubernetes-version` flag) is
9797
at least one minor version higher than the kubeadm CLI version.
9898
- Kubernetes system requirements:
9999
- if running on linux:
100-
- [error] if Kernel is older than the minimum required version
101-
- [error] if required cgroups subsystem aren't set up
102-
- [error] if the CRI endpoint does not answer
103-
- [error] if user is not root
104-
- [error] if the machine hostname is not a valid DNS subdomain
105-
- [warning] if the host name cannot be reached via network lookup
106-
- [error] if kubelet version is lower that the minimum kubelet version supported by kubeadm (current minor -1)
107-
- [error] if kubelet version is at least one minor higher than the required controlplane version (unsupported version skew)
108-
- [warning] if kubelet service does not exist or if it is disabled
109-
- [warning] if firewalld is active
110-
- [error] if API server bindPort or ports 10250/10251/10252 are used
100+
- [Error] if Kernel is older than the minimum required version
101+
- [Error] if required cgroups subsystem aren't set up
102+
- [Error] if the CRI endpoint does not answer
103+
- [Error] if user is not root
104+
- [Error] if the machine hostname is not a valid DNS subdomain
105+
- [Warning] if the host name cannot be reached via network lookup
106+
- [Error] if kubelet version is lower that the minimum kubelet version supported by kubeadm (current minor -1)
107+
- [Error] if kubelet version is at least one minor higher than the required controlplane version (unsupported version skew)
108+
- [Warning] if kubelet service does not exist or if it is disabled
109+
- [Warning] if firewalld is active
110+
- [Error] if API server bindPort or ports 10250/10251/10252 are used
111111
- [Error] if `/etc/kubernetes/manifest` folder already exists and it is not empty
112112
- [Error] if swap is on
113113
- [Error] if `conntrack`, `ip`, `iptables`, `mount`, `nsenter` commands are not present in the command path
114-
- [warning] if `ebtables`, `ethtool`, `socat`, `tc`, `touch`, `crictl` commands are not present in the command path
115-
- [warning] if extra arg flags for API server, controller manager, scheduler contains some invalid options
116-
- [warning] if connection to https://API.AdvertiseAddress:API.BindPort goes through proxy
117-
- [warning] if connection to services subnet goes through proxy (only first address checked)
118-
- [warning] if connection to Pods subnet goes through proxy (only first address checked)
114+
- [Warning] if `ebtables`, `ethtool`, `socat`, `tc`, `touch`, `crictl` commands are not present in the command path
115+
- [Warning] if extra arg flags for API server, controller manager, scheduler contains some invalid options
116+
- [Warning] if connection to https://API.AdvertiseAddress:API.BindPort goes through proxy
117+
- [Warning] if connection to services subnet goes through proxy (only first address checked)
118+
- [Warning] if connection to Pods subnet goes through proxy (only first address checked)
119119
- If external etcd is provided:
120120
- [Error] if etcd version is older than the minimum required version
121121
- [Error] if etcd certificates or keys are specified, but not provided
@@ -127,11 +127,11 @@ The user can skip specific preflight checks or all of them with the `--ignore-pr
127127
- If authorization mode is WebHook
128128
- [Error] if webhook_authz.conf does not exist
129129

130-
Please note that:
131-
132-
1. Preflight checks can be invoked individually with the
133-
[`kubeadm init phase preflight`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-preflight)
134-
command
130+
{{< note >}}
131+
Preflight checks can be invoked individually with the
132+
[`kubeadm init phase preflight`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-preflight)
133+
command.
134+
{{< /note >}}
135135

136136
### Generate the necessary certificates
137137

@@ -146,7 +146,7 @@ Kubeadm generates certificate and private key pairs for different purposes:
146146

147147
- The Kubernetes service's internal clusterIP (the first address in the services CIDR, e.g.
148148
`10.96.0.1` if service subnet is `10.96.0.0/12`)
149-
- Kubernetes DNS names, e.g. `kubernetes.default.svc.cluster.local` if `--service-dns-domain`
149+
- Kubernetes DNS names, e.g. `kubernetes.default.svc.cluster.local` if `--service-dns-domain`
150150
flag value is `cluster.local`, plus default DNS names `kubernetes.default.svc`,
151151
`kubernetes.default`, `kubernetes`
152152
- The node-name
@@ -176,7 +176,7 @@ Please note that:
176176
`/etc/kubernetes/pki/ca.{crt,key}`, and then kubeadm will use those files for signing the rest of the certs.
177177
See also [using custom certificates](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#custom-certificates)
178178
1. Only for the CA, it is possible to provide the `ca.crt` file but not the `ca.key` file, if all other certificates and kubeconfig files
179-
already are in place kubeadm recognize this condition and activates the ExternalCA , which also implies the `csrsigner`controller in
179+
already are in place kubeadm recognize this condition and activates the ExternalCA, which also implies the `csrsigner`controller in
180180
controller-manager won't be started
181181
1. If kubeadm is running in [external CA mode](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#external-ca-mode);
182182
all the certificates must be provided by the user, because kubeadm cannot generate them by itself
@@ -227,13 +227,13 @@ for additional information RBAC and built-in ClusterRoles and groups.
227227
Please note that:
228228

229229
1. `ca.crt` certificate is embedded in all the kubeconfig files.
230-
2. If a given kubeconfig file exists, and its content is evaluated compliant with the above specs,
230+
1. If a given kubeconfig file exists, and its content is evaluated compliant with the above specs,
231231
the existing file will be used and the generation phase for the given kubeconfig skipped
232-
3. If kubeadm is running in [ExternalCA mode](/docs/reference/setup-tools/kubeadm/kubeadm-init/#external-ca-mode),
232+
1. If kubeadm is running in [ExternalCA mode](/docs/reference/setup-tools/kubeadm/kubeadm-init/#external-ca-mode),
233233
all the required kubeconfig must be provided by the user as well, because kubeadm cannot
234234
generate any of them by itself
235-
4. In case of kubeadm is executed in the `--dry-run` mode, kubeconfig files are written in a temporary folder
236-
5. Kubeconfig files generation can be invoked individually with the
235+
1. In case of kubeadm is executed in the `--dry-run` mode, kubeconfig files are written in a temporary folder
236+
1. Kubeconfig files generation can be invoked individually with the
237237
[`kubeadm init phase kubeconfig all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-kubeconfig) command
238238

239239
### Generate static Pod manifests for control plane components
@@ -279,7 +279,7 @@ The static Pod manifest for the API server is affected by following parameters p
279279
(`etcd-cafile`, `etcd-certfile`, `etcd-keyfile`);
280280
if an external etcd server is not be provided, a local etcd will be used (via host network)
281281
- If a cloud provider is specified, the corresponding `--cloud-provider` is configured, together
282-
with the `--cloud-config` path if such file exists (this is experimental, alpha and will be
282+
with the `--cloud-config` path if such file exists (this is experimental, alpha and will be
283283
removed in a future version)
284284

285285
Other API server flags that are set unconditionally are:
@@ -321,7 +321,7 @@ Other API server flags that are set unconditionally are:
321321
- `--kubelet-client-certificate` to `apiserver-kubelet-client.crt`
322322
- `--kubelet-client-key` to `apiserver-kubelet-client.key`
323323
- `--service-account-key-file` to `sa.pub`
324-
- `--requestheader-client-ca-file` to`front-proxy-ca.crt`
324+
- `--requestheader-client-ca-file` to `front-proxy-ca.crt`
325325
- `--proxy-client-cert-file` to `front-proxy-client.crt`
326326
- `--proxy-client-key-file` to `front-proxy-client.key`
327327

@@ -346,14 +346,14 @@ the users:
346346
- `--cluster-cidr` and `--node-cidr-mask-size` flags according to the given CIDR
347347

348348
- If a cloud provider is specified, the corresponding `--cloud-provider` is specified, together
349-
with the `--cloud-config` path if such configuration file exists (this is experimental, alpha
349+
with the `--cloud-config` path if such configuration file exists (this is experimental, alpha
350350
and will be removed in a future version)
351351

352352
Other flags that are set unconditionally are:
353353

354354
- `--controllers` enabling all the default controllers plus `BootstrapSigner` and `TokenCleaner`
355-
controllers for TLS bootstrap. See [TLS Bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/)
356-
for more details
355+
controllers for TLS bootstrap. See [TLS Bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/)
356+
for more details.
357357

358358
- `--use-service-account-credentials` to `true`
359359

@@ -382,9 +382,9 @@ Please note that:
382382
1. The etcd container image will be pulled from `registry.gcr.io` by default. See
383383
[using custom images](/docs/reference/setup-tools/kubeadm/kubeadm-init/#custom-images)
384384
for customizing the image repository.
385-
2. If you run kubeadm in `--dry-run` mode, the etcd static Pod manifest is written
385+
1. If you run kubeadm in `--dry-run` mode, the etcd static Pod manifest is written
386386
into a temporary folder.
387-
3. You can directly invoke static Pod manifest generation for local etcd, using the
387+
1. You can directly invoke static Pod manifest generation for local etcd, using the
388388
[`kubeadm init phase etcd local`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-etcd)
389389
command.
390390

@@ -431,7 +431,6 @@ Please note that:
431431
1. Mark control-plane phase can be invoked individually with the command
432432
[`kubeadm init phase mark-control-plane`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-mark-control-plane)
433433

434-
435434
### Configure TLS-Bootstrapping for node joining
436435

437436
Kubeadm uses [Authenticating with Bootstrap Tokens](/docs/reference/access-authn-authz/bootstrap-tokens/)
@@ -442,12 +441,12 @@ for joining new nodes to an existing cluster; for more details see also
442441
following steps as well as setting API server and controller flags as already described in
443442
previous paragraphs.
444443

445-
Please note that:
446-
447-
1. TLS bootstrapping for nodes can be configured with the command
448-
[`kubeadm init phase bootstrap-token`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-bootstrap-token),
449-
executing all the configuration steps described in following paragraphs;
450-
alternatively, each step can be invoked individually
444+
{{< note >}}
445+
TLS bootstrapping for nodes can be configured with the command
446+
[`kubeadm init phase bootstrap-token`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-bootstrap-token),
447+
executing all the configuration steps described in following paragraphs;
448+
alternatively, each step can be invoked individually.
449+
{{< /note >}}
451450

452451
#### Create a bootstrap token
453452

@@ -460,13 +459,13 @@ Please note that:
460459
1. The default token created by `kubeadm init` will be used to validate temporary user during TLS
461460
bootstrap process; those users will be member of
462461
`system:bootstrappers:kubeadm:default-node-token` group
463-
2. The token has a limited validity, default 24 hours (the interval may be changed with the `—token-ttl` flag)
464-
3. Additional tokens can be created with the [`kubeadm token`](/docs/reference/setup-tools/kubeadm/kubeadm-token/)
462+
1. The token has a limited validity, default 24 hours (the interval may be changed with the `—token-ttl` flag)
463+
1. Additional tokens can be created with the [`kubeadm token`](/docs/reference/setup-tools/kubeadm/kubeadm-token/)
465464
command, that provide as well other useful functions for token management.
466465

467466
#### Allow joining nodes to call CSR API
468467

469-
Kubeadm ensures that users in `system:bootstrappers:kubeadm:default-node-token` group are able to
468+
Kubeadm ensures that users in `system:bootstrappers:kubeadm:default-node-token` group are able to
470469
access the certificate signing API.
471470

472471
This is implemented by creating a ClusterRoleBinding named `kubeadm:kubelet-bootstrap` between the
@@ -478,7 +477,7 @@ Kubeadm ensures that the Bootstrap Token will get its CSR request automatically
478477
csrapprover controller.
479478

480479
This is implemented by creating ClusterRoleBinding named `kubeadm:node-autoapprove-bootstrap`
481-
between the `system:bootstrappers:kubeadm:default-node-token` group and the default role
480+
between the `system:bootstrappers:kubeadm:default-node-token` group and the default role
482481
`system:certificates.k8s.io:certificatesigningrequests:nodeclient`.
483482

484483
The role `system:certificates.k8s.io:certificatesigningrequests:nodeclient` should be created as
@@ -491,7 +490,7 @@ Kubeadm ensures that certificate rotation is enabled for nodes, and that new cer
491490
for nodes will get its CSR request automatically approved by the csrapprover controller.
492491

493492
This is implemented by creating ClusterRoleBinding named
494-
`kubeadm:node-autoapprove-certificate-rotation` between the `system:nodes` group and the default
493+
`kubeadm:node-autoapprove-certificate-rotation` between the `system:nodes` group and the default
495494
role `system:certificates.k8s.io:certificatesigningrequests:selfnodeclient`.
496495

497496
#### Create the public cluster-info ConfigMap
@@ -501,21 +500,21 @@ This phase creates the `cluster-info` ConfigMap in the `kube-public` namespace.
501500
Additionally it creates a Role and a RoleBinding granting access to the ConfigMap for
502501
unauthenticated users (i.e. users in RBAC group `system:unauthenticated`).
503502

504-
Please note that:
505-
506-
1. The access to the `cluster-info` ConfigMap _is not_ rate-limited. This may or may not be a
507-
problem if you expose your cluster's API server to the internet; worst-case scenario here is a
508-
DoS attack where an attacker uses all the in-flight requests the kube-apiserver can handle to
509-
serving the `cluster-info` ConfigMap.
503+
{{< note >}}
504+
The access to the `cluster-info` ConfigMap _is not_ rate-limited. This may or may not be a
505+
problem if you expose your cluster's API server to the internet; worst-case scenario here is a
506+
DoS attack where an attacker uses all the in-flight requests the kube-apiserver can handle to
507+
serving the `cluster-info` ConfigMap.
508+
{{< /note >}}
510509

511510
### Install addons
512511

513512
Kubeadm installs the internal DNS server and the kube-proxy addon components via the API server.
514513

515-
Please note that:
516-
517-
1. This phase can be invoked individually with the command
518-
[`kubeadm init phase addon all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon).
514+
{{< note >}}
515+
This phase can be invoked individually with the command
516+
[`kubeadm init phase addon all`](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon).
517+
{{< /note >}}
519518

520519
#### proxy
521520

@@ -573,13 +572,13 @@ The second is to provide a file (that is a subset of the standard kubeconfig fil
573572
#### Shared token discovery
574573

575574
If `kubeadm join` is invoked with `--discovery-token`, token discovery is used; in this case the
576-
node basically retrieves the cluster CA certificates from the `cluster-info` ConfigMap in the
575+
node basically retrieves the cluster CA certificates from the `cluster-info` ConfigMap in the
577576
`kube-public` namespace.
578577

579578
In order to prevent "man in the middle" attacks, several steps are taken:
580579

581580
- First, the CA certificate is retrieved via insecure connection (this is possible because
582-
`kubeadm init` granted access to `cluster-info` users for `system:unauthenticated` )
581+
`kubeadm init` granted access to `cluster-info` users for `system:unauthenticated`)
583582

584583
- Then the CA certificate goes trough following validation steps:
585584

@@ -591,10 +590,11 @@ In order to prevent "man in the middle" attacks, several steps are taken:
591590
- As a additional validation, the CA certificate is retrieved via secure connection and then
592591
compared with the CA retrieved initially
593592

594-
Please note that:
593+
{{< note >}}
595594

596-
1. Pub key validation can be skipped passing `--discovery-token-unsafe-skip-ca-verification` flag;
597-
This weakens the kubeadm security model since others can potentially impersonate the Kubernetes Master.
595+
Pub key validation can be skipped passing `--discovery-token-unsafe-skip-ca-verification` flag;
596+
This weakens the kubeadm security model since others can potentially impersonate the Kubernetes Master.
597+
{{< /note >}}
598598

599599
#### File/https discovery
600600

@@ -620,13 +620,12 @@ The request is then automatically approved and the operation completes saving `c
620620
`kubelet.conf` file to be used by kubelet for joining the cluster, while`bootstrap-kubelet.conf`
621621
is deleted.
622622

623-
Please note that:
624-
623+
{{< note >}}
625624
- The temporary authentication is validated against the token saved during the `kubeadm init`
626625
process (or with additional tokens created with `kubeadm token`)
627626
- The temporary authentication resolve to a user member of
628627
`system:bootstrappers:kubeadm:default-node-token` group which was granted access to CSR api
629628
during the `kubeadm init` process
630629
- The automatic CSR approval is managed by the csrapprover controller, according with
631630
configuration done the `kubeadm init` process
632-
631+
{{< /note >}}

0 commit comments

Comments
 (0)