Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bbdb8dd

Browse filesBrowse files
committed
kubeadm: update authored docs for 1.32
1 parent ed06b86 commit bbdb8dd
Copy full SHA for bbdb8dd

File tree

4 files changed

+210
-48
lines changed
Filter options

4 files changed

+210
-48
lines changed

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

Copy file name to clipboardExpand all lines: content/en/docs/reference/setup-tools/kubeadm/implementation-details.md
+127-27
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The cluster that `kubeadm init` and `kubeadm join` set up should be:
3535
- **User-friendly**: The user should not have to run anything more than a couple of commands:
3636
- `kubeadm init`
3737
- `export KUBECONFIG=/etc/kubernetes/admin.conf`
38-
- `kubectl apply -f <network-of-choice.yaml>`
38+
- `kubectl apply -f <network-plugin-of-choice.yaml>`
3939
- `kubeadm join --token <token> <endpoint>:<port>`
4040
- **Extendable**:
4141
- It should _not_ favor any particular network provider. Configuring the cluster network is out-of-scope
@@ -76,6 +76,23 @@ in a majority of cases, and the most intuitive location; other constant paths an
7676
- `front-proxy-ca.crt`, `front-proxy-ca.key` for the front proxy certificate authority
7777
- `front-proxy-client.crt`, `front-proxy-client.key` for the front proxy client
7878

79+
## The kubeadm configuration file format
80+
81+
Most kubeadm commands support a `--config` flag which allows passing a configuration file from
82+
disk. The configuration file format follows the common Kubernetes API `apiVersion` / `kind` scheme,
83+
but is considered a component configuration format. Several Kubernetes components, such as the kubelet,
84+
also support file-based configuration.
85+
86+
Different kubeadm subcommands require a different `kind` of configuration file.
87+
For example, `InitConfiguration` for `kubeadm init`, `JoinConfiguration` for `kubeadm join`, `UpgradeConfiguration` for `kubeadm upgrade` and `ResetConfiguration`
88+
for `kubeadm reset`.
89+
90+
The command `kubeadm config migrate` can be used to migrate an older format configuration
91+
file to a newer (current) configuration format. The kubeadm tool only supports migrating from
92+
deprecated configuration formats to the current format.
93+
94+
See the [kubeadm configuration reference](/docs/reference/config-api/kubeadm-config.v1beta4/) page for more details.
95+
7996
## kubeadm init workflow internal design
8097

8198
The `kubeadm init` consists of a sequence of atomic work tasks to perform,
@@ -110,7 +127,7 @@ The user can skip specific preflight checks or all of them with the `--ignore-pr
110127
- [Error] if `/etc/kubernetes/manifest` folder already exists and it is not empty
111128
- [Error] if swap is on
112129
- [Error] if `ip`, `iptables`, `mount`, `nsenter` commands are not present in the command path
113-
- [Warning] if `ebtables`, `ethtool`, `socat`, `tc`, `touch`, `crictl` commands are not present in the command path
130+
- [Warning] if `ethtool`, `tc`, `touch` commands are not present in the command path
114131
- [Warning] if extra arg flags for API server, controller manager, scheduler contains some invalid options
115132
- [Warning] if connection to https://API.AdvertiseAddress:API.BindPort goes through proxy
116133
- [Warning] if connection to services subnet goes through proxy (only first address checked)
@@ -188,7 +205,7 @@ Please note that:
188205
Kubeadm generates kubeconfig files with identities for control plane components:
189206

190207
- A kubeconfig file for the kubelet to use during TLS bootstrap -
191-
/etc/kubernetes/bootstrap-kubelet.conf. Inside this file, there is a bootstrap-token or embedded
208+
`/etc/kubernetes/bootstrap-kubelet.conf`. Inside this file, there is a bootstrap-token or embedded
192209
client certificates for authenticating this node with the cluster.
193210

194211
This client certificate should:
@@ -223,7 +240,15 @@ The `super-admin.conf` file must be stored in a safe location and should not be
223240
See [RBAC user facing role bindings](/docs/reference/access-authn-authz/rbac/#user-facing-roles)
224241
for additional information on RBAC and built-in ClusterRoles and groups.
225242

226-
Please note that:
243+
You can run [`kubeadm kubeconfig user`](/docs/reference/setup-tools/kubeadm/kubeadm-kubeconfig/#cmd-kubeconfig-user)
244+
to generate kubeconfig files for additional users.
245+
246+
{{< caution >}}
247+
The generated configuration files include an embedded authentication key, and you should treat
248+
them as confidential.
249+
{{< /caution >}}
250+
251+
Also note that:
227252

228253
1. `ca.crt` certificate is embedded in all the kubeconfig files.
229254
1. If a given kubeconfig file exists, and its content is evaluated as compliant with the above specs,
@@ -253,7 +278,7 @@ Static Pod manifests share a set of common properties:
253278

254279
- Leader election is enabled for both the controller-manager and the scheduler
255280
- Controller-manager and the scheduler will reference kubeconfig files with their respective, unique identities
256-
- All static Pods get any extra flags specified by the user as described in
281+
- All static Pods get any extra flags or patches that you specify, as described in
257282
[passing custom arguments to control plane components](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/)
258283
- All static Pods get any extra Volumes specified by the user (Host path)
259284

@@ -344,10 +369,6 @@ the users:
344369
- `--allocate-node-cidrs=true`
345370
- `--cluster-cidr` and `--node-cidr-mask-size` flags according to the given CIDR
346371

347-
- If a cloud provider is specified, the corresponding `--cloud-provider` is specified together
348-
with the `--cloud-config` path if such configuration file exists (this is experimental, alpha
349-
and will be removed in a future version)
350-
351372
Other flags that are set unconditionally are:
352373

353374
- `--controllers` enabling all the default controllers plus `BootstrapSigner` and `TokenCleaner`
@@ -365,7 +386,7 @@ Other flags that are set unconditionally are:
365386

366387
#### Scheduler
367388

368-
The static Pod manifest for the scheduler is not affected by parameters provided by the users.
389+
The static Pod manifest for the scheduler is not affected by parameters provided by the user.
369390

370391
### Generate static Pod manifest for local etcd
371392

@@ -389,12 +410,10 @@ Please note that:
389410

390411
### Wait for the control plane to come up
391412

392-
kubeadm waits (upto 4m0s) until `localhost:6443/healthz` (kube-apiserver liveness) returns `ok`.
393-
However, in order to detect deadlock conditions, kubeadm fails fast if `localhost:10255/healthz`
394-
(kubelet liveness) or `localhost:10255/healthz/syncloop` (kubelet readiness) don't return `ok`
395-
within 40s and 60s respectively.
413+
On control plane nodes, kubeadm waits up to 4 minutes for the control plane components
414+
and the kubelet to be available. It does that by performing a health check on the respective
415+
component `/healthz` or `/livez` endpoints.
396416

397-
kubeadm relies on the kubelet to pull the control plane images and run them properly as static Pods.
398417
After the control plane is up, kubeadm completes the tasks described in following paragraphs.
399418

400419
### Save the kubeadm ClusterConfiguration in a ConfigMap for later reference
@@ -518,9 +537,8 @@ deployed as a DaemonSet:
518537

519538
#### DNS
520539

521-
- The CoreDNS service is named `kube-dns`. This is done to prevent any interruption
522-
in service when the user is switching the cluster DNS from kube-dns to CoreDNS
523-
through the `--config` method described [here](/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/#cmd-phase-addon).
540+
- The CoreDNS service is named `kube-dns` for compatibility reasons with the legacy `kube-dns`
541+
addon.
524542

525543
- A ServiceAccount for CoreDNS is created in the `kube-system` namespace.
526544

@@ -534,8 +552,8 @@ You can use CoreDNS with kubeadm even when the related Service is named `kube-dn
534552
Similarly to `kubeadm init`, also `kubeadm join` internal workflow consists of a sequence of
535553
atomic work tasks to perform.
536554

537-
This is split into discovery (having the Node trust the Kubernetes Master) and TLS bootstrap
538-
(having the Kubernetes Master trust the Node).
555+
This is split into discovery (having the Node trust the Kubernetes API Server) and TLS bootstrap
556+
(having the Kubernetes API Server trust the Node).
539557

540558
see [Authenticating with Bootstrap Tokens](/docs/reference/access-authn-authz/bootstrap-tokens/)
541559
or the corresponding [design proposal](https://git.k8s.io/design-proposals-archive/cluster-lifecycle/bootstrap-discovery.md).
@@ -545,12 +563,10 @@ or the corresponding [design proposal](https://git.k8s.io/design-proposals-archi
545563
`kubeadm` executes a set of preflight checks before starting the join, with the aim to verify
546564
preconditions and avoid common cluster startup problems.
547565

548-
Please note that:
566+
Also note that:
549567

550568
1. `kubeadm join` preflight checks are basically a subset of `kubeadm init` preflight checks
551-
1. Starting from 1.24, kubeadm uses crictl to communicate to all known CRI endpoints.
552-
1. Starting from 1.9, kubeadm provides support for joining nodes running on Windows; in that case,
553-
linux specific controls are skipped.
569+
1. If you are joining a Windows node, Linux specific controls are skipped.
554570
1. In any case the user can skip specific preflight checks (or eventually all preflight checks)
555571
with the `--ignore-preflight-errors` option.
556572

@@ -582,9 +598,8 @@ In order to prevent "man in the middle" attacks, several steps are taken:
582598
compared with the CA retrieved initially
583599

584600
{{< note >}}
585-
586-
Pub key validation can be skipped passing `--discovery-token-unsafe-skip-ca-verification` flag;
587-
This weakens the kubeadm security model since others can potentially impersonate the Kubernetes Master.
601+
You can skip CA validation by passing the `--discovery-token-unsafe-skip-ca-verification` flag on the command line.
602+
This weakens the kubeadm security model since others can potentially impersonate the Kubernetes API server.
588603
{{< /note >}}
589604

590605
#### File/https discovery
@@ -620,3 +635,88 @@ is deleted.
620635
- The automatic CSR approval is managed by the csrapprover controller, according to
621636
the configuration present in the `kubeadm init` process
622637
{{< /note >}}
638+
639+
## kubeadm upgrade workflow internal design
640+
641+
`kubeadm upgrade` has sub-commands for handling the upgrade of the Kubernets cluster created by kubeadm.
642+
You must run `kubeadm upgrade apply` on a control plane node (you can choose which one);
643+
this starts the upgrade process. You then run `kubeadm upgrade node` on all remaining
644+
nodes (both worker nodes and control plane nodes).
645+
646+
Both `kubeadm upgrade apply` and `kubeadm upgrade node` have a `phase` subcommand which provides access
647+
to the internal phases of the upgrade process.
648+
See [`kubeadm upgrade phase`](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade-phase/) for more details.
649+
650+
Additional utility upgrade commands are `kubeadm upgrade plan` and `kubeadm upgrade diff`.
651+
652+
All upgrade sub-commands support passing a configuration file.
653+
654+
### kubeadm upgrade plan
655+
656+
You can optionally run `kubeadm upgrade plan` before you run `kubeadm upgrade apply`.
657+
The `plan` subcommand checks which versions are available to upgrade
658+
to and validates whether your current cluster is upgradeable.
659+
660+
### kubeadm upgrade diff
661+
662+
This shows what differences would be applied to existing static pod manifests for control plane nodes.
663+
A more verbose way to do the same thing is running `kubeadm upgrade apply --dry-run` or
664+
`kubeadm upgrade node --dry-run`.
665+
666+
### kubeadm upgrade apply
667+
668+
`kubeadm upgrade apply` prepares the cluster for the upgrade of all nodes, and also
669+
upgrades the control plane node where it's run. The steps it performs are:
670+
671+
- Runs preflight checks similarly to `kubeadm init` and `kubeadm join`, ensuring container images are downloaded
672+
and the cluster is in a good state to be upgraded.
673+
- Upgrades the control plane manifest files on disk in `/etc/kubernetes/manifests` and waits
674+
for the kubelet to restart the components if the files have changed.
675+
- Uploads the updated kubeadm and kubelet configurations to the cluster in the `kubeadm-config`
676+
and the `kubelet-config` ConfigMaps (both in the `kube-system` namespace).
677+
- Writes updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`.
678+
- Configures bootstrap token and the `cluster-info` ConfigMap for RBAC rules. This is the same as
679+
in the `kubeadm init` stage and ensures that the cluster continues to support nodes joining with bootstrap tokens.
680+
- Upgrades the kube-proxy and CoreDNS addons conditionally if all existing kube-apiservers in the cluster
681+
have already been upgraded to the target version.
682+
- Performs any post-upgrade tasks, such as, cleaning up deprecated features which are release specific.
683+
684+
### kubeadm upgrade node
685+
686+
`kubeadm upgrade node` upgrades a single control plane or worker node after the cluster upgrade has
687+
started (by running `kubeadm upgrade apply`). The command detects if the node is a control plane node by checking
688+
if the file `/etc/kubernetes/manifests/kube-apiserver.yaml` exists. On finding that file, the kubeadm tool
689+
infers that there is a running kube-apiserver Pod on this node.
690+
691+
- Runs preflight checks similarly to `kubeadm upgrade apply`.
692+
- For control plane nodes, upgrades the control plane manifest files on disk in `/etc/kubernetes/manifests`
693+
and waits for the kubelet to restart the components if the files have changed.
694+
- Writes the updated kubelet configuration for this node in `/var/lib/kubelet/config.yaml`.
695+
- (For control plane nodes) upgrades the kube-proxy and CoreDNS
696+
{{< glossary_tooltip text="addons" term_id="addons" >}} conditionally, provided that all existing
697+
API servers in the cluster have already been upgraded to the target version.
698+
- Performs any post-upgrade tasks, such as cleaning up deprecated features which are release specific.
699+
700+
## kubeadm reset workflow internal design
701+
702+
You can use the `kubeadm reset` subcommand on a node where kubeadm commands previously executed.
703+
This subcommand performs a **best-effort** cleanup of the node.
704+
If certain actions fail you must intervene and perform manual cleanup.
705+
706+
The command supports phases.
707+
See [`kubeadm reset phase`](/docs/reference/setup-tools/kubeadm/kubeadm-reset-phase/) for more details.
708+
709+
The command supports a configuration file.
710+
711+
Additionally:
712+
- IPVS, iptables and nftables rules are **not** cleaned up.
713+
- CNI (network plugin) configuration is **not** cleaned up.
714+
- `.kube/` in the user's home directory is **not** cleaned up.
715+
716+
The command has the following stages:
717+
- Runs preflight checks on the node to determine if its healthy.
718+
- For control plane nodes, removes any local etcd member data.
719+
- Stops the kubelet.
720+
- Stops running containers.
721+
- Unmounts any mounted directories in `/var/lib/kubelet`.
722+
- Deletes any files and directories managed by kubeadm in `/var/lib/kubelet` and `/etc/kubernetes`.

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

Copy file name to clipboardExpand all lines: content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md
+28-13
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Feature | Default | Alpha | Beta | GA
157157
:-------|:--------|:------|:-----|:----
158158
`ControlPlaneKubeletLocalMode` | `false` | 1.31 | - | -
159159
`EtcdLearnerMode` | `true` | 1.27 | 1.29 | 1.32
160-
`PublicKeysECDSA` | `false` | 1.19 | - | -
160+
`NodeLocalCRISocket` | `false` | 1.32 | - | -
161161
`WaitForAllControlPlaneComponents` | `false` | 1.30 | - | -
162162
{{< /table >}}
163163

@@ -176,20 +176,26 @@ policy during rolling upgrades.
176176
: With this feature gate enabled, when joining a new control plane node, a new etcd member will be created
177177
as a learner and promoted to a voting member only after the etcd data are fully aligned.
178178

179-
`PublicKeysECDSA`
180-
: Can be used to create a cluster that uses ECDSA certificates instead of the default RSA algorithm.
181-
Renewal of existing ECDSA certificates is also supported using `kubeadm certs renew`, but you cannot
182-
switch between the RSA and ECDSA algorithms on the fly or during upgrades. Kubernetes
183-
{{< skew currentVersion >}} has a bug where keys in generated kubeconfig files are set use RSA
184-
despite the feature gate being enabled. Kubernetes versions before v1.31 had a bug where keys in generated kubeconfig files
185-
were set use RSA, even when you had enabled the `PublicKeysECDSA` feature gate.
179+
`NodeLocalCRISocket`
180+
: With this feature gate enabled, kubeadm will read/write the CRI socket for each node from/to the file
181+
`/var/lib/kubelet/instance-config.yaml` instead of reading/writing it from/to the annotation
182+
`kubeadm.alpha.kubernetes.io/cri-socket` on the Node object. The new file is applied as an instance
183+
configuration patch, before any other user managed patches are applied when the `--patches` flag
184+
is used. It contains a single field `containerRuntimeEndpoint` from the
185+
[KubeletConfiguration file format](/docs/reference/config-api/kubelet-config.v1beta1/). If the feature gate
186+
is enabled during upgrade, but the file `/var/lib/kubelet/instance-config.yaml` does not exist yet,
187+
kubeadm will attempt to read the CRI socket value from the file `/var/lib/kubelet/kubeadm-flags.env`.
186188

187189
`WaitForAllControlPlaneComponents`
188-
: With this feature gate enabled kubeadm will wait for all control plane components (kube-apiserver,
189-
kube-controller-manager, kube-scheduler) on a control plane node to report status 200 on their `/healthz`
190-
endpoints. These checks are performed on `https://127.0.0.1:PORT/healthz`, where `PORT` is taken from
191-
`--secure-port` of a component. If you specify custom `--secure-port` values in the kubeadm configuration
192-
they will be respected. Without the feature gate enabled, kubeadm will only wait for the kube-apiserver
190+
: With this feature gate enabled, kubeadm will wait for all control plane components (kube-apiserver,
191+
kube-controller-manager, kube-scheduler) on a control plane node to report status 200 on their `/livez`
192+
or `/healthz` endpoints. These checks are performed on `https://ADDRESS:PORT/ENDPOINT`.
193+
- `PORT` is taken from `--secure-port` of a component.
194+
- `ADDRESS` is `--advertise-address` for kube-apiserver and `--bind-address` for the kube-controller-manager
195+
and kube-scheduler.
196+
- `ENDPOINT` is only `/healthz` for kube-controller-manager until it supports `/livez` as well.
197+
If you specify custom `ADDRESS` or `PORT` in the kubeadm configuration they will be respected.
198+
Without the feature gate enabled, kubeadm will only wait for the kube-apiserver
193199
on a control plane node to become ready. The wait process starts right after the kubelet on the host
194200
is started by kubeadm. You are advised to enable this feature gate in case you wish to observe a ready
195201
state from all control plane components during the `kubeadm init` or `kubeadm join` command execution.
@@ -199,11 +205,20 @@ List of deprecated feature gates:
199205
{{< table caption="kubeadm deprecated feature gates" >}}
200206
Feature | Default | Alpha | Beta | GA | Deprecated
201207
:-------|:--------|:------|:-----|:---|:----------
208+
`PublicKeysECDSA` | `false` | 1.19 | - | - | 1.31
202209
`RootlessControlPlane` | `false` | 1.22 | - | - | 1.31
203210
{{< /table >}}
204211

205212
Feature gate descriptions:
206213

214+
`PublicKeysECDSA`
215+
: Can be used to create a cluster that uses ECDSA certificates instead of the default RSA algorithm.
216+
Renewal of existing ECDSA certificates is also supported using `kubeadm certs renew`, but you cannot
217+
switch between the RSA and ECDSA algorithms on the fly or during upgrades.Kubernetes versions before v1.31
218+
had a bug where keys in generated kubeconfig files were set use RSA, even when you had enabled the
219+
`PublicKeysECDSA` feature gate. This feature gate is deprecated in favor of the `encryptionAlgorithm`
220+
functionality available in kubeadm v1beta4.
221+
207222
`RootlessControlPlane`
208223
: Setting this flag configures the kubeadm deployed control plane component static Pod containers
209224
for `kube-apiserver`, `kube-controller-manager`, `kube-scheduler` and `etcd` to run as non-root users.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.