@@ -87,12 +87,16 @@ tags, and then generate with `hack/update-toc.sh`.
87
87
- [ Story 1] ( #story-1 )
88
88
- [ Story 2] ( #story-2 )
89
89
- [ Story 3] ( #story-3 )
90
+ - [ Story 4] ( #story-4 )
90
91
- [ Notes/Constraints/Caveats (optional)] ( #notesconstraintscaveats-optional )
91
92
- [ Risks and Mitigations] ( #risks-and-mitigations )
92
93
- [ Design Details] ( #design-details )
93
94
- [ Code organization] ( #code-organization )
94
95
- [ Patch formats] ( #patch-formats )
95
96
- [ Patch file naming format] ( #patch-file-naming-format )
97
+ - [ Patch targets] ( #patch-targets )
98
+ - [ Control plane static Pods] ( #control-plane-static-pods )
99
+ - [ Kubelet ComponentConfig] ( #kubelet-componentconfig )
96
100
- [ Support for multiple patches per file] ( #support-for-multiple-patches-per-file )
97
101
- [ Test Plan] ( #test-plan )
98
102
- [ Graduation Criteria] ( #graduation-criteria )
@@ -168,11 +172,12 @@ A good summary is probably at least a paragraph in length.
168
172
This KEP proposes a replacement for the feature introduced by the kubeadm KEP
169
173
"20190722-Advanced-configurations-with-kubeadm-(Kustomize)".
170
174
171
- It has the same scope and goals, allowing the users to amend manifests
172
- generated by kubeadm using patches, but not using Kustomize as the backend
173
- for applying the patches.
175
+ It has similar scope and goals, allowing the users to amend manifests
176
+ and configuration files generated by kubeadm using patches, but not using
177
+ Kustomize as the backend for applying the patches.
174
178
175
- The existing Kustomize implementation in kubeadm is in Alpha state.
179
+ The Kustomize implementation in kubeadm was in an Alpha state and was
180
+ removed.
176
181
177
182
## Motivation
178
183
@@ -198,10 +203,10 @@ know that this has succeeded?
198
203
-->
199
204
200
205
- Implement a solution for applying patches over kubeadm generated manifests
201
- during the common kubeadm commands "init", "join" and "upgrade" and their phases.
206
+ and configuration during the common kubeadm commands "init", "join" and "upgrade"
207
+ and their phases.
202
208
- Deprecate and remove the existing Kustomize solution after a grace period
203
209
of at least one release.
204
- - To initially allow patching of static Pod manifests only.
205
210
206
211
### Non-Goals
207
212
@@ -214,8 +219,6 @@ and make progress.
214
219
sane security values.
215
220
- Allow patching of core addon configuration generated by kubeadm - e.g. CoreDNS,
216
221
kube-proxy (until further notice).
217
- - Allowing patches to be added using the kubeadm ComponentConfig (until
218
- further notice).
219
222
- Replace the kubeadm ComponentConfig. The sane defaults would still be
220
223
generated by kubeadm.
221
224
@@ -265,6 +268,11 @@ liveness probes for edge clusters.
265
268
As a cluster administrator, I want to upgrade my cluster preserving all the
266
269
patches that were applied during "init"/"join".
267
270
271
+ #### Story 4
272
+
273
+ As a cluster administrator, I want to be able to apply instance specific
274
+ configuration to kubelets on different nodes.
275
+
268
276
### Notes/Constraints/Caveats (optional)
269
277
270
278
<!--
@@ -304,7 +312,7 @@ and release notes what is the scope of the new feature.
304
312
- Users are allowed to pass configuration for components using the
305
313
kubeadm ComponentConfiguration.
306
314
- kubeadm applies sane / secure defaults.
307
- - The users can patch the generated manifests to their liking.
315
+ - The users can patch the generated configuration to their liking.
308
316
309
317
_ Misleading expectations on the level of flexibility_
310
318
@@ -315,7 +323,7 @@ will be examined before moving forward in graduating the feature to beta.
315
323
316
324
_ Breaking changes post upgrade_
317
325
318
- A change in a kubeadm manifest can make a patch apply to fail.
326
+ A change in a kubeadm generated configuration can make a patch apply to fail.
319
327
320
328
The kubeadm maintainers will work on release notes to make potential
321
329
breaking changes more visible. Additionally, upgrade instructions will be
@@ -388,16 +396,17 @@ Conversion from YAML to JSON will be performed using the
388
396
389
397
Once the user passes a folder with patches to a kubeadm command,
390
398
kubeadm must be able to determine what format each file is and what
391
- manifest it is targeting .
399
+ is its target .
392
400
393
401
Parsing the patch contents to determine the patch format is not possible,
394
402
because the formats ` strategic ` and ` merge ` are the same, while they do
395
403
have different apply mechanisms.
396
404
397
405
The proposal is to have the following naming format:
398
- ` componentname [suffix][+patchtype].{yaml|json}`
406
+ ` target [suffix][+patchtype].{yaml|json}`
399
407
400
- - ` componentname ` must be a known component name - e.g. ` kube-apiserver ` .
408
+ - ` target ` must be a known component name - e.g. ` kube-apiserver ` or
409
+ the name of generated configuration.
401
410
- ` suffix ` is optional and can be used to ensure an order when applying
402
411
patches from multiple files for the same component.
403
412
- ` +patchtype ` is optional and can be used to pass one of the supported
@@ -424,6 +433,28 @@ but also allow for advanced usage with patch ordering and the `json` type.
424
433
- Would allow having arbitrary files that are ignored in the patch folder -
425
434
e.g. having a ` README.md ` .
426
435
436
+ ### Patch targets
437
+
438
+ The mechanism allows patching the following targets via the ` target ` naming property:
439
+
440
+ #### Control plane static Pods
441
+
442
+ Static Pod manifests generated on control plane nodes can be patched with the following
443
+ targets: ` kube-apiserver ` , ` kube-controller-manager ` , ` kube-scheduler ` and ` etcd ` .
444
+ Their API GroupVersionKind is ` core/v1.Pod ` .
445
+
446
+ Patches for the control plane static Pods are applied over the generated manifests
447
+ in memory during ` init/join/upgrade ` .
448
+
449
+ #### Kubelet ComponentConfig
450
+
451
+ The generated per-node kubelet ComponentConfig can be patched with the ` kubeletconfiguration `
452
+ target. Its API GroupVersionKind is of type ` kubelet.config.k8s.io/v1beta1.KubeletConfiguration ` .
453
+
454
+ During ` init ` patches for the kubelet are applied over the user provided and kubeadm defaulted
455
+ ` KubeletConfiguration ` . During ` join/upgrade ` patches are applied over the downloaded
456
+ from the cluster global ` KubeletConfiguration ` .
457
+
427
458
### Support for multiple patches per file
428
459
429
460
To support multiple patches per file, the proposal is to implement
@@ -537,6 +568,7 @@ ComponentConfig version increment, so could land in GA graduation.
537
568
- The feature is widely used and at least 2 cycles have passed since Beta.
538
569
- The ` --patches ` flag is removed (optional). Depends on user feedback
539
570
and the wider kubeadm plan for removing flags in favor of ComponentConfig.
571
+ - More patch targets are considered (optional).
540
572
541
573
### Upgrade / Downgrade Strategy
542
574
@@ -575,6 +607,8 @@ enhancement:
575
607
CRI or CNI may require updating that component before the kubelet.
576
608
-->
577
609
610
+ This section covers the ` corev1.Pod ` as a example target for version skew.
611
+
578
612
Once introduced, the feature will support patching at minimum the ` corev1.Pod `
579
613
object. If at some point the Kubernetes core API graduates to ` v2 ` , kubeadm would
580
614
have to support patching both ` corev2 ` and ` corev1 ` for at least one release
@@ -584,8 +618,7 @@ This is due to the fact kubeadm supports deploying Kubernetes `v1.YY` and `v1.YY
584
618
And if ` corev2 ` is added in ` v1.YY ` , kubeadm must be able to handle ` corev1 `
585
619
that is supported in ` v1.YY-1 ` .
586
620
587
- If the patching mechanic one day supports patching different API types,
588
- it must also apply similar skew strategy to those types.
621
+ A similar skew strategy must be applied for other supported patch target API types.
589
622
590
623
## Production Readiness Review Questionnaire
591
624
@@ -624,7 +657,7 @@ _This section must be completed when targeting alpha to a release._
624
657
- [x] Other
625
658
- Describe the mechanism:
626
659
When a new kubeadm control-plane Node joins the cluster it can optionally
627
- apply custom patches to the static Pods that kubeadm configures .
660
+ apply custom patches to kubeadm generated configuration .
628
661
- Will enabling / disabling the feature require downtime of the control
629
662
plane?
630
663
No, unless the user created patches result in bad configuration and
@@ -646,7 +679,7 @@ _This section must be completed when targeting alpha to a release._
646
679
feature, can it break the existing applications?).
647
680
Yes. Once the patches are applied for a ` kubeadm init|join|upgrade ` command,
648
681
the user can decide to roll-back the changes which will result in a restart
649
- of the control-plane component static Pods that were patches on this Node .
682
+ of component that was customized by the patches .
650
683
651
684
* ** What happens if we reenable the feature if it was previously rolled back?**
652
685
This is supported by invoking kubeadm phases. The patches will re-apply
@@ -669,7 +702,7 @@ _This section must be completed when targeting beta graduation to a release._
669
702
Try to be as paranoid as possible - e.g. what if some components will restart
670
703
in the middle of rollout?
671
704
The feature can result in malfunctioning control-plane components, due to the
672
- fact that it targets patching of static Pod manifests with user values.
705
+ fact that it targets patching of configuration with user values.
673
706
The user is responsible for configuring the control-plane correctly.
674
707
675
708
* ** What specific metrics should inform a rollback?**
@@ -744,7 +777,7 @@ _This section must be completed when targeting beta graduation to a release._
744
777
- Usage description:
745
778
- Impact of its outage on the feature:
746
779
- Impact of its degraded performance or high error rates on the feature:
747
- No, this feature customizes static Pod manifests for the control-plane .
780
+ No, this feature customizes on top of kubeadm generated configuration .
748
781
749
782
### Scalability
750
783
793
826
operations covered by [ existing SLIs/SLOs] [ ] ?**
794
827
Think about adding additional work or introducing new steps in between
795
828
(e.g. need to do X to start a container), etc. Please describe the details.
796
- No, unless the user patches the control-plane static Pods with undesired
797
- configuration .
829
+ No, unless the user patches kubeadm generated configuration with undesired
830
+ settings .
798
831
799
832
* ** Will enabling / using this feature result in non-negligible increase of
800
833
resource usage (CPU, RAM, disk, IO, ...) in any components?**
@@ -803,8 +836,8 @@ configuration.
803
836
volume), significant amount of data send and/or received over network, etc.
804
837
This through this both in small and large cases, again with respect to the
805
838
[ supported limits] [ ] .
806
- No, unless the user patches the control-plane static Pods with undesired
807
- configuration .
839
+ No, unless the user patches kubeadm generated configuration with undesired
840
+ settings .
808
841
809
842
### Troubleshooting
810
843
@@ -859,6 +892,9 @@ Major milestones might include
859
892
- 2020-05-14: addressed feedback, filled PRR questionnaire, KEP marked as implementable
860
893
- 2021-09-09: marked the feature as graduated to Beta. This was done as part of
861
894
the kubeadm v1beta3 API work. The actions under "Alpha -> Beta" are completed.
895
+ - 2022-05-16: adapted the KEP to be more generic, allowing support for patching
896
+ any kubeadm generated configuration in the future and not only control plane component
897
+ manifests. Added enumeration of supported patch targets.
862
898
863
899
## Drawbacks
864
900
0 commit comments