From 6f77c2d08ba48af79b8ed7e97397c29f846e0745 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 30 Mar 2023 15:38:49 +0800 Subject: [PATCH 1/5] kubeadm: init kep for no cri socket annotation --- .../sig-cluster-lifecycle/3929.yaml | 3 + .../3929-no-cri-socket-annotation/README.md | 772 ++++++++++++++++++ .../3929-no-cri-socket-annotation/kep.yaml | 16 + 3 files changed, 791 insertions(+) create mode 100644 keps/prod-readiness/sig-cluster-lifecycle/3929.yaml create mode 100644 keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md create mode 100644 keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml diff --git a/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml b/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml new file mode 100644 index 00000000000..f9a687a8007 --- /dev/null +++ b/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml @@ -0,0 +1,3 @@ +kep-number: 3929 +alpha: + approver: "@" diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md new file mode 100644 index 00000000000..2c15263b40a --- /dev/null +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md @@ -0,0 +1,772 @@ + +# 3929: Remove CRI Socket Annotation from Node Object + + + + + + +- [Release Signoff Checklist](#release-signoff-checklist) +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (Optional)](#user-stories-optional) + - [Story 1](#story-1) + - [Story 2](#story-2) + - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) + - [Risks and Mitigations](#risks-and-mitigations) +- [Design Details](#design-details) + - [Test Plan](#test-plan) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [e2e tests](#e2e-tests) + - [Graduation Criteria](#graduation-criteria) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) + - [Version Skew Strategy](#version-skew-strategy) +- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) + - [Feature Enablement and Rollback](#feature-enablement-and-rollback) + - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) + - [Monitoring Requirements](#monitoring-requirements) + - [Dependencies](#dependencies) + - [Scalability](#scalability) + - [Troubleshooting](#troubleshooting) +- [Implementation History](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) + + +## Release Signoff Checklist + + + +Items marked with (R) are required *prior to targeting to a milestone / release*. + +- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) +- [ ] (R) KEP approvers have approved the KEP status as `implementable` +- [ ] (R) Design details are appropriately documented +- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) + - [ ] e2e Tests for all Beta API Operations (endpoints) + - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) + - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free +- [ ] (R) Graduation criteria is in place + - [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) +- [ ] (R) Production readiness review completed +- [ ] (R) Production readiness review approved +- [ ] "Implementation History" section is up-to-date for milestone +- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] +- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes + + + +[kubernetes.io]: https://kubernetes.io/ +[kubernetes/enhancements]: https://git.k8s.io/enhancements +[kubernetes/website]: https://git.k8s.io/website + +## Summary + +The proposal is to remove the Container Runtime Interface (CRI) socket annotation +from the Node object in Kubernetes, which is currently added during the +"init upload-config" phase in Kubeadm. This annotation is used to specify the CRI +socket endpoint used by the kubelet on each node for communication with the container +runtime. Instead of relying on this annotation, the proposal suggests using a global +kubelet configuration with a CRI socket specified, as well as providing the ability to +override this configuration during kubeadm join using the --config flag. This would +eliminate the need for kubeadm to store CRI socket configuration on each node, and +instead rely on the Kubernetes configuration files for specifying this information. + +## Motivation + +Currently, kubeadm adds a CRI socket annotation to the Node object during the +"init upload-config" phase, which specifies the endpoint for the CRI that is being +used by the kubelet on each node. This annotation is persistent on the Node object, +even if the kubelet is updated or the CRI is changed. + +After migration of container runtime endpoint flag to kubelet config, we can set +cri socket in kubelet configuration. + +### Goals + +- Remove the use of CRI socket annotation on Node object +- For node customized kubelet configuration, it can be saved locally on disk with file path + `/var/lib/kubelet/kubeadm-config.yaml` and we will prioritize respecting the local + setting over the global one. + +### Non-Goals + +- Update the CRI socket annotation on Node object to be the latest + +## Proposal + +1. init: upload a global kubelet configuration with cri socket +2. join: can override it using --config +3. upgrade: re-download global one, but should use local kubelet configuration firstly + +### User Stories (Optional) + +#### Story 1 + +#### Story 2 + +### Notes/Constraints/Caveats (Optional) + +### Risks and Mitigations + +## Design Details + +### init: upload a global kubelet configuration with cri socket + +- `kubeadm init` will not add the annotation to node. +- `kubeadm init` will check the customized `--config` at first and if no cri socket is set, it will + auto-detect it and save it global configuration and local as well. + +### join: can override it using --config + +- `kubeadm join` will not add the annotation to node. +- `kubeadm join` will download the kubelet configuration from apiserver and the customized `--config` + at first and auto-detect will work only if not set. Auto-detect may log a warning message if it may + be misconfigured and log a general debug log if there is multi CRI-sockets. + +### upgrade: re-download global one, but should use local kubelet configuration firstly + +- `kubeadm upgrade` will download the kubelet configuration from apiserver and respect local one. + +### old version handling + +For old version cluster upgradation with the annotation, we will not touch the annotation at first. + +1. in v1.28, `kubeadm upgrade` will respect the annotation and save it to `/var/lib/kubelet/kubeadm-config.yaml`. +2. in v1.29, `kubeadm upgrade` will ignore the annotation. + +### Test Plan + + + +[ ] I/we understand the owners of the involved components may require updates to +existing tests to make this code solid enough prior to committing the changes necessary +to implement this enhancement. + +##### Prerequisite testing updates + + + +##### Unit tests + + + + + +- ``: `` - `` + +##### Integration tests + + + +- : + +##### e2e tests + + + +- : + +### Graduation Criteria + + + +### Upgrade / Downgrade Strategy + + + +### Version Skew Strategy + + + +## Production Readiness Review Questionnaire + + + +### Feature Enablement and Rollback + + + +###### How can this feature be enabled / disabled in a live cluster? + + + +- [ ] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: + - Components depending on the feature gate: +- [ ] Other + - Describe the mechanism: + - Will enabling / disabling the feature require downtime of the control + plane? + - Will enabling / disabling the feature require downtime or reprovisioning + of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled). + +###### Does enabling the feature change any default behavior? + + + +###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? + + + +###### What happens if we reenable the feature if it was previously rolled back? + +###### Are there any tests for feature enablement/disablement? + + + +### Rollout, Upgrade and Rollback Planning + + + +###### How can a rollout or rollback fail? Can it impact already running workloads? + + + +###### What specific metrics should inform a rollback? + + + +###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? + + + +###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? + + + +### Monitoring Requirements + + + +###### How can an operator determine if the feature is in use by workloads? + + + +###### How can someone using this feature know that it is working for their instance? + + + +- [ ] Events + - Event Reason: +- [ ] API .status + - Condition name: + - Other field: +- [ ] Other (treat as last resort) + - Details: + +###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? + + + +###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? + + + +- [ ] Metrics + - Metric name: + - [Optional] Aggregation method: + - Components exposing the metric: +- [ ] Other (treat as last resort) + - Details: + +###### Are there any missing metrics that would be useful to have to improve observability of this feature? + + + +### Dependencies + + + +###### Does this feature depend on any specific services running in the cluster? + + + +### Scalability + + + +###### Will enabling / using this feature result in any new API calls? + + + +###### Will enabling / using this feature result in introducing new API types? + + + +###### Will enabling / using this feature result in any new calls to the cloud provider? + + + +###### Will enabling / using this feature result in increasing size or count of the existing API objects? + + + +###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? + + + +###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? + + + +###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? + + + +### Troubleshooting + + + +###### How does this feature react if the API server and/or etcd is unavailable? + +###### What are other known failure modes? + + + +###### What steps should be taken if SLOs are not being met to determine the problem? + +## Implementation History + + + +## Drawbacks + + + +## Alternatives + + + +## Infrastructure Needed (Optional) + + diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml new file mode 100644 index 00000000000..403320c0338 --- /dev/null +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml @@ -0,0 +1,16 @@ +title: "Remove CRI Socket Annotation from Node Object" +kep-number: 3929 +authors: + - "@pacoxu" +owning-sig: sig-cluster-lifecycle +participating-sigs: + - sig-cluster-lifecycle +status: provisional +creation-date: 2023-03-30 +last-updated: 2022-03-30 +reviewers: + - "@neolit123" +approvers: + - "@neolit123" +latest-milestone: "0.0" +stage: "alpha" From c77f42ddcc13d3fc8e01c15670dccb9260a80089 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 30 Mar 2023 17:51:39 +0800 Subject: [PATCH 2/5] add some details to make the kep more substantial --- .../3929-no-cri-socket-annotation/README.md | 80 ++++++------------- 1 file changed, 25 insertions(+), 55 deletions(-) diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md index 2c15263b40a..c4bfbddb132 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md @@ -128,9 +128,9 @@ checklist items _must_ be updated for the enhancement to be released. Items marked with (R) are required *prior to targeting to a milestone / release*. -- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) +- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) - [ ] (R) KEP approvers have approved the KEP status as `implementable` -- [ ] (R) Design details are appropriately documented +- [x] (R) Design details are appropriately documented - [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) - [ ] e2e Tests for all Beta API Operations (endpoints) - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) @@ -202,6 +202,16 @@ cri socket in kubelet configuration. ## Design Details +We should introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration. +It is similar to `/var/lib/kubelet/kubeadm-flags.env`. + +```text +KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=k8s.m.daocloud.io/pause:3.9" +``` + +[To be discussed] Another proposal is using a strategy like `--patch`. A file like `/var/lib/kubelet/kubeadm-config.patch` +or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This should be removed if we make a decision). + ### init: upload a global kubelet configuration with cri socket - `kubeadm init` will not add the annotation to node. @@ -239,10 +249,15 @@ when drafting this test plan. [testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md --> -[ ] I/we understand the owners of the involved components may require updates to +[x] I/we understand the owners of the involved components may require updates to existing tests to make this code solid enough prior to committing the changes necessary to implement this enhancement. +Install/Join/Upgrade test in + +- upgrade v1.(n-1) to v1.n. +- upgrade v1.n to v1.n. + ##### Prerequisite testing updates - ### Upgrade / Downgrade Strategy - +See above. ### Version Skew Strategy @@ -435,14 +405,14 @@ well as the [existing list] of feature gates. --> - [ ] Feature gate (also fill in values in `kep.yaml`) - - Feature gate name: + - Feature gate name: No - Components depending on the feature gate: - [ ] Other - Describe the mechanism: - Will enabling / disabling the feature require downtime of the control - plane? + plane? No. - Will enabling / disabling the feature require downtime or reprovisioning - of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled). + of a node? No. ###### Does enabling the feature change any default behavior? From 5c6d843f349225d8ca181a1f91ff78d3525fb9ee Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Fri, 31 Mar 2023 10:46:20 +0800 Subject: [PATCH 3/5] add two proposal: a node-specific overwrite list or a node specific yaml --- .../3929-no-cri-socket-annotation/README.md | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md index c4bfbddb132..c813da06c81 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md @@ -176,9 +176,9 @@ cri socket in kubelet configuration. ### Goals - Remove the use of CRI socket annotation on Node object -- For node customized kubelet configuration, it can be saved locally on disk with file path - `/var/lib/kubelet/kubeadm-config.yaml` and we will prioritize respecting the local - setting over the global one. +- We will prioritize respecting the local setting over the global one. +- [Not decided yet] For further node customized kubelet configuration, it can be saved locally + on disk with file path `/var/lib/kubelet/kubeadm-config.yaml`. (If not used, I will move it to Non-Goals) ### Non-Goals @@ -202,16 +202,6 @@ cri socket in kubelet configuration. ## Design Details -We should introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration. -It is similar to `/var/lib/kubelet/kubeadm-flags.env`. - -```text -KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=k8s.m.daocloud.io/pause:3.9" -``` - -[To be discussed] Another proposal is using a strategy like `--patch`. A file like `/var/lib/kubelet/kubeadm-config.patch` -or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This should be removed if we make a decision). - ### init: upload a global kubelet configuration with cri socket - `kubeadm init` will not add the annotation to node. @@ -229,11 +219,35 @@ or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This sh - `kubeadm upgrade` will download the kubelet configuration from apiserver and respect local one. +### Proposal 1: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one + +During `kubeadm ugprade`, kubeadm will read the local kubelet configuration in `/var/lib/kubelet/config.yaml`. +kubeadm also download the kubelet configuration from configmap and replace the `containerRuntimeEndpoint` and +`imageServiceEndpoint`(This maybe empty and I prefer to respect it as well) with the local configuration. + +A node-specific kubelet configuration list should be maintained in kubeadm code. + +- containerRuntimeEndpoint +- imageServiceEndpoint + +### Proposal 2: introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration + +We should introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration. +It is similar to `/var/lib/kubelet/kubeadm-flags.env`. + +```text +KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=k8s.m.daocloud.io/pause:3.9" +``` + +[To be discussed] Another proposal is using a strategy like `--patch`. A file like `/var/lib/kubelet/kubeadm-config.patch` +or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This should be removed if we make a decision). + ### old version handling For old version cluster upgradation with the annotation, we will not touch the annotation at first. -1. in v1.28, `kubeadm upgrade` will respect the annotation and save it to `/var/lib/kubelet/kubeadm-config.yaml`. +1. in v1.28, `kubeadm upgrade` will respect the annotation and save it to local kubelet configuration or node + specific configuration `/var/lib/kubelet/kubeadm-config.yaml`. [TODO update according to the final decision] 2. in v1.29, `kubeadm upgrade` will ignore the annotation. ### Test Plan From 5d9d3dcc36a110dd13c1437d31363437fe56fc2b Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Mon, 3 Apr 2023 16:57:45 +0800 Subject: [PATCH 4/5] add feature gate for using --- .../sig-cluster-lifecycle/3929.yaml | 3 - .../3929-no-cri-socket-annotation/README.md | 380 +----------------- .../3929-no-cri-socket-annotation/kep.yaml | 2 +- 3 files changed, 21 insertions(+), 364 deletions(-) delete mode 100644 keps/prod-readiness/sig-cluster-lifecycle/3929.yaml diff --git a/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml b/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml deleted file mode 100644 index f9a687a8007..00000000000 --- a/keps/prod-readiness/sig-cluster-lifecycle/3929.yaml +++ /dev/null @@ -1,3 +0,0 @@ -kep-number: 3929 -alpha: - approver: "@" diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md index c813da06c81..b22cf60978d 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md @@ -89,12 +89,22 @@ tags, and then generate with `hack/update-toc.sh`. - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) - [Risks and Mitigations](#risks-and-mitigations) - [Design Details](#design-details) + - [init: upload a global kubelet configuration with cri socket](#init-upload-a-global-kubelet-configuration-with-cri-socket) + - [join: can override it using --config](#join-can-override-it-using---config) + - [upgrade: re-download global one, but should use local kubelet configuration firstly](#upgrade-re-download-global-one-but-should-use-local-kubelet-configuration-firstly) + - [Proposal 1: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one](#proposal-1-respect-a-list-of-configuration-in-local-kubelet-configuration-and-in-v127-cri-socket-is-the-only-one) + - [Proposal 2: introduce a /var/lib/kubelet/kubeadm-config.yaml to maintain node specific configuration](#proposal-2-introduce-a--to-maintain-node-specific-configuration) + - [old version handling](#old-version-handling) - [Test Plan](#test-plan) - - [Prerequisite testing updates](#prerequisite-testing-updates) - - [Unit tests](#unit-tests) - - [Integration tests](#integration-tests) - - [e2e tests](#e2e-tests) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [e2e tests](#e2e-tests) - [Graduation Criteria](#graduation-criteria) + - [Alpha](#alpha) + - [Beta](#beta) + - [GA](#ga) + - [Deprecation](#deprecation) - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) - [Version Skew Strategy](#version-skew-strategy) - [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) @@ -221,7 +231,7 @@ cri socket in kubelet configuration. ### Proposal 1: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one -During `kubeadm ugprade`, kubeadm will read the local kubelet configuration in `/var/lib/kubelet/config.yaml`. +During `kubeadm upgrade`, kubeadm will read the local kubelet configuration in `/var/lib/kubelet/config.yaml`. kubeadm also download the kubelet configuration from configmap and replace the `containerRuntimeEndpoint` and `imageServiceEndpoint`(This maybe empty and I prefer to respect it as well) with the local configuration. @@ -239,6 +249,11 @@ It is similar to `/var/lib/kubelet/kubeadm-flags.env`. KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=k8s.m.daocloud.io/pause:3.9" ``` +We may introduce a feature gate "KubeadmNodeSpecificConfig" to enable the use the `/var/lib/kubelet/kubeadm-config.yaml` here. + +- If the feature gate is disabled, use the cri socket annotation directly. +- If the feature gate is enabled, `/var/lib/kubelet/kubeadm-config.yaml` will be created and the cri socket will be maintained in it. + [To be discussed] Another proposal is using a strategy like `--patch`. A file like `/var/lib/kubelet/kubeadm-config.patch` or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This should be removed if we make a decision). @@ -252,17 +267,6 @@ For old version cluster upgradation with the annotation, we will not touch the a ### Test Plan - - [x] I/we understand the owners of the involved components may require updates to existing tests to make this code solid enough prior to committing the changes necessary to implement this enhancement. @@ -274,58 +278,16 @@ Install/Join/Upgrade test in - ##### Unit tests - - - - - ``: `` - `` ##### Integration tests - - - : ##### e2e tests - - - : ### Graduation Criteria @@ -363,61 +325,12 @@ See above. ### Version Skew Strategy - - ## Production Readiness Review Questionnaire - - ### Feature Enablement and Rollback - - ###### How can this feature be enabled / disabled in a live cluster? - - - [ ] Feature gate (also fill in values in `kep.yaml`) - Feature gate name: No - Components depending on the feature gate: @@ -430,108 +343,28 @@ well as the [existing list] of feature gates. ###### Does enabling the feature change any default behavior? - - ###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? - - ###### What happens if we reenable the feature if it was previously rolled back? ###### Are there any tests for feature enablement/disablement? - - ### Rollout, Upgrade and Rollback Planning - - ###### How can a rollout or rollback fail? Can it impact already running workloads? - - ###### What specific metrics should inform a rollback? - - ###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? - - ###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? - - ### Monitoring Requirements - - ###### How can an operator determine if the feature is in use by workloads? - - ###### How can someone using this feature know that it is working for their instance? - - - [ ] Events - Event Reason: - [ ] API .status @@ -542,215 +375,42 @@ Recall that end users cannot usually observe component logs or access metrics. ###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? - - ###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? - - -- [ ] Metrics - - Metric name: - - [Optional] Aggregation method: - - Components exposing the metric: -- [ ] Other (treat as last resort) - - Details: - ###### Are there any missing metrics that would be useful to have to improve observability of this feature? - - ### Dependencies - - ###### Does this feature depend on any specific services running in the cluster? - - ### Scalability - - ###### Will enabling / using this feature result in any new API calls? - - ###### Will enabling / using this feature result in introducing new API types? - - ###### Will enabling / using this feature result in any new calls to the cloud provider? - - ###### Will enabling / using this feature result in increasing size or count of the existing API objects? - - ###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? - - ###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? - - ###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? - - ### Troubleshooting - - ###### How does this feature react if the API server and/or etcd is unavailable? ###### What are other known failure modes? - - ###### What steps should be taken if SLOs are not being met to determine the problem? ## Implementation History - - ## Drawbacks - - ## Alternatives - - ## Infrastructure Needed (Optional) - - diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml index 403320c0338..d271c447c93 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml @@ -7,7 +7,7 @@ participating-sigs: - sig-cluster-lifecycle status: provisional creation-date: 2023-03-30 -last-updated: 2022-03-30 +last-updated: 2022-04-03 reviewers: - "@neolit123" approvers: From 1bb9613b2c3ef74f3402b1269aeb37b58fd46f63 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Mon, 29 May 2023 12:24:09 +0800 Subject: [PATCH 5/5] use kubeadm-config-instance.yaml to save node specific configurations --- .../3929-no-cri-socket-annotation/README.md | 59 ++++++++----------- .../3929-no-cri-socket-annotation/kep.yaml | 3 +- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md index b22cf60978d..5f0c97f7dbc 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/README.md @@ -92,9 +92,7 @@ tags, and then generate with `hack/update-toc.sh`. - [init: upload a global kubelet configuration with cri socket](#init-upload-a-global-kubelet-configuration-with-cri-socket) - [join: can override it using --config](#join-can-override-it-using---config) - [upgrade: re-download global one, but should use local kubelet configuration firstly](#upgrade-re-download-global-one-but-should-use-local-kubelet-configuration-firstly) - - [Proposal 1: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one](#proposal-1-respect-a-list-of-configuration-in-local-kubelet-configuration-and-in-v127-cri-socket-is-the-only-one) - - [Proposal 2: introduce a /var/lib/kubelet/kubeadm-config.yaml to maintain node specific configuration](#proposal-2-introduce-a--to-maintain-node-specific-configuration) - - [old version handling](#old-version-handling) + - [other proposal: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one](#other-proposal-respect-a-list-of-configuration-in-local-kubelet-configuration-and-in-v127-cri-socket-is-the-only-one) - [Test Plan](#test-plan) - [Prerequisite testing updates](#prerequisite-testing-updates) - [Unit tests](#unit-tests) @@ -196,9 +194,15 @@ cri socket in kubelet configuration. ## Proposal -1. init: upload a global kubelet configuration with cri socket -2. join: can override it using --config -3. upgrade: re-download global one, but should use local kubelet configuration firstly +1. init: upload a global kubelet configuration with cri socket. + - the cri socket will take `--cri-socket` value and if the flag is empty, kubeadm will auto-detect it. + - After seting or auto-detecting, it will be set in the global kubelet configuration. +2. join: it will use the global confugration. + - if it is not set in the global configuration, it will use `--cri-socket` value + - if it is still empty, kubeadm will auto-detect it. + - join will not change the global configuration, and if it is different with the global, + kubeadm will save it in `/var/lib/kubelet/kubeadm-config-instance.yaml` +3. upgrade: re-download global one, but should use local kubelet configuration firstly in `kubeadm-config-instance.yaml` ### User Stories (Optional) @@ -214,9 +218,11 @@ cri socket in kubelet configuration. ### init: upload a global kubelet configuration with cri socket -- `kubeadm init` will not add the annotation to node. +- `kubeadm init` will not add the annotation to node any more. - `kubeadm init` will check the customized `--config` at first and if no cri socket is set, it will - auto-detect it and save it global configuration and local as well. + auto-detect it and save it global configuration. + if `--cri-socket` is specified, we will use it in the local kubelet configuration and `kubeadm-config-instance.yaml`, + but it will not be saved to the global configuration. ### join: can override it using --config @@ -224,12 +230,22 @@ cri socket in kubelet configuration. - `kubeadm join` will download the kubelet configuration from apiserver and the customized `--config` at first and auto-detect will work only if not set. Auto-detect may log a warning message if it may be misconfigured and log a general debug log if there is multi CRI-sockets. + if `--cri-socket` is specified, we will use it in the local kubelet configuration and `kubeadm-config-instance.yaml`, + but it will not be saved to the global configuration. ### upgrade: re-download global one, but should use local kubelet configuration firstly - `kubeadm upgrade` will download the kubelet configuration from apiserver and respect local one. +- in v1.28-1.29, for backward compatibility, when `kubeadm upgrade apply`, we will read the `cri` annotation(if no annotation, we autodetect it) + and then patch it to the global configuration. `kubeadm upgrade node` is similar, and it will never change global configuration. +- in v1.30+, `kubeadm upgrade apply` will not read the cri annotation any more. +- in v1.28, for other nodes, `kubeadm upgrade node` will check if the cri annotation is diffent with the global setting. + if `cri-socket` is different, we will use it in the local kubelet configuration and `kubeadm-config-instance.yaml`, + but it will not be saved to the global configuration. +- in v1.29 or later, `kubeadm upgrade node` will check `kubeadm-config-instance.yaml` at first and then check annoation like v1.28. +- in v1.30+, `kubeadm upgrade node` will check `kubeadm-config-instance.yaml` and then global configuration only. -### Proposal 1: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one +### other proposal: respect a list of configuration in local kubelet configuration, and in v1.27, CRI socket is the only one During `kubeadm upgrade`, kubeadm will read the local kubelet configuration in `/var/lib/kubelet/config.yaml`. kubeadm also download the kubelet configuration from configmap and replace the `containerRuntimeEndpoint` and @@ -240,31 +256,6 @@ A node-specific kubelet configuration list should be maintained in kubeadm code. - containerRuntimeEndpoint - imageServiceEndpoint -### Proposal 2: introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration - -We should introduce a `/var/lib/kubelet/kubeadm-config.yaml` to maintain node specific configuration. -It is similar to `/var/lib/kubelet/kubeadm-flags.env`. - -```text -KUBELET_KUBEADM_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=k8s.m.daocloud.io/pause:3.9" -``` - -We may introduce a feature gate "KubeadmNodeSpecificConfig" to enable the use the `/var/lib/kubelet/kubeadm-config.yaml` here. - -- If the feature gate is disabled, use the cri socket annotation directly. -- If the feature gate is enabled, `/var/lib/kubelet/kubeadm-config.yaml` will be created and the cri socket will be maintained in it. - -[To be discussed] Another proposal is using a strategy like `--patch`. A file like `/var/lib/kubelet/kubeadm-config.patch` -or a `kubelet.yaml`/`config.ayml` file under `/var/lib/kubelet/patch/`. (This should be removed if we make a decision). - -### old version handling - -For old version cluster upgradation with the annotation, we will not touch the annotation at first. - -1. in v1.28, `kubeadm upgrade` will respect the annotation and save it to local kubelet configuration or node - specific configuration `/var/lib/kubelet/kubeadm-config.yaml`. [TODO update according to the final decision] -2. in v1.29, `kubeadm upgrade` will ignore the annotation. - ### Test Plan [x] I/we understand the owners of the involved components may require updates to diff --git a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml index d271c447c93..212e63a744a 100644 --- a/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml +++ b/keps/sig-cluster-lifecycle/kubeadm/3929-no-cri-socket-annotation/kep.yaml @@ -7,9 +7,10 @@ participating-sigs: - sig-cluster-lifecycle status: provisional creation-date: 2023-03-30 -last-updated: 2022-04-03 +last-updated: 2022-05-29 reviewers: - "@neolit123" + - "@chendave" approvers: - "@neolit123" latest-milestone: "0.0"