Skip to content

Commit 4ec371d

Browse files
authored
Merge pull request #4302 from neolit123/1.29-add-kep-for-separate-kubeconfig-system-masters
keps/../kubeadm: 4214: revisit test plan and risks/mitigations
2 parents 0d9f0c4 + 95f1f4d commit 4ec371d

File tree

2 files changed

+37
-38
lines changed
  • keps/sig-cluster-lifecycle/kubeadm/4214-separate-super-user-kubeconfig

2 files changed

+37
-38
lines changed

keps/sig-cluster-lifecycle/kubeadm/4214-separate-super-user-kubeconfig/README.md

+36-37
Original file line numberDiff line numberDiff line change
@@ -348,33 +348,30 @@ called. On later upgrades, one release after this feature is added, the certific
348348
renewal logic of `kubeadm upgrade` must be aware that the `super-admin.conf` file could
349349
be missing and should not be rotated.
350350

351-
Updating the `kube-system/kubeadm-certs` Secret contents where an encrypted
352-
`admin.conf` is stored will not be updated during upgrade.
353-
354351
The mitigation here is detailed unit tests and e2e tests that ensure that
355352
the migration for in-place upgrades is handled properly.
356353

357354
#### Risk: Implementation complexity during re-place upgrade
358355

359356
Users or higher level tools that manage kubeadm re-place upgrades, by removing old
360357
control plane nodes and adding new control plane nodes, without calling
361-
`kubeadm upgrade apply/node` should handle this transition manually.
362-
The RBAC ClusterRoleBinding `kubeadm:cluster-admins` must be created before
363-
the upgrade has started. A new `admin.conf` that has the subject:
364-
`O = kubeadm:cluster-admins, CN = kubernetes-admin` must be uploaded in the
365-
`kube-system/kubeadm-certs` Secret and encrypted with the appropriate certificate key.
366-
Joining control plane nodes, must be able to download and decrypt the new `admin.conf`.
367-
368-
Again, tests will be required to ensure that the `admin.conf` subject is migrated
369-
properly. The `super-admin.conf` file will not exist at all under such conditions,
370-
therefore the administrator can sign one manually by using
371-
the `kubeadm kubeconfig user --client-name=kubernetes-super-admin --org=system:masters`
372-
command.
373-
374-
The same users or higher level tools can decide not to opt-in into this
375-
new behavior for existing clusters and continue using the `admin.conf` with
376-
`system:masters`. However, this means such clusters will drift away
377-
from the kubeadm security defaults.
358+
`kubeadm upgrade apply/node` must handle this transition manually.
359+
The ClusterRoleBinding `kubeadm:cluster-admins` must be created before
360+
the upgrade has started. The `kubeadm join` process for control plane nodes
361+
will create new `admin.conf` files with certificates that bind to the
362+
`kubeadm:cluster-admins` Group.
363+
364+
Again, tests will be required to ensure that the `admin.conf` works
365+
properly and the ClusterRoleBinding `kubeadm:cluster-admins` exists.
366+
367+
The `super-admin.conf` file will not exist at all in such clusters,
368+
that were upgraded from older versions of kubeadm. The administrator can sign
369+
a `super-admin.conf` manually by using the
370+
`kubeadm kubeconfig user --client-name=kubernetes-super-admin --org=system:masters`
371+
command and store it in a safe location.
372+
373+
For new clusters of this kind, the `super-admin.conf` will exist on the node
374+
where `kubeadm init` was called. It can be left untouched or manually moved.
378375

379376
## Design Details
380377

@@ -403,18 +400,21 @@ existing tests to make this code solid enough prior to committing the changes ne
403400
to implement this enhancement.
404401

405402
kubeadm will include new unit tests to ensure the new separate admin files are
406-
generated properly. During init/join-control-plane/upgrade the existing
407-
[kinder](https://git.k8s.io/kubeadm/kinder) upgrade e2e test jobs will
408-
test this functionality.
409-
410-
One additional integration test can be added in `cmd/kubeadm/test`. It can be maintained
411-
for one or more releases until more users upgrade to the first release where this
412-
feature is available. It can do the following (can vary, subject to implementation details):
413-
- Calls `kubeadm init phase certs ca`.
414-
- Calls `kubeadm init phase kubeconfig admin`.
415-
- Checks if two admin kubeconfig files are generated.
416-
- Calls `kubeadm certs renew admin.conf` and verifies whether the kubeconfig files
417-
are updated.
403+
generated properly.
404+
405+
One additional e2e test will be added in the kubernetes/kubeadm repository
406+
by using the kinder tool. It can be maintained for one or more releases until
407+
more users upgrade to the first release where this feature is available.
408+
It can do the following:
409+
- Creates a 3 control plane node cluster that has the latest kubeadm installed.
410+
- Calls `kubeadm init` on one of them.
411+
- Verifies that kubeconfig files and RBAC are setup properly.
412+
- Calls `kubeadm join` on the remaining control plane nodes.
413+
- Verifies the kubeconfig files on the remaining control plane nodes.
414+
- Deletes the `super-admin.conf` file from the first control plane node.
415+
- Deletes the `kubeadm:cluster-admins` ClusterRoleBinding.
416+
- Calls `kubeadm upgrade` using the same kubeadm version.
417+
- Ensures that the RBAC and `super-admin.conf` are recreated.
418418

419419
##### Prerequisite testing updates
420420

@@ -472,8 +472,7 @@ https://storage.googleapis.com/k8s-triage/index.html
472472

473473
<!-- - <test>: <link to test coverage> -->
474474

475-
One new integration test can be added here:
476-
- `cmd/kubeadm/test`
475+
NONE
477476

478477
##### e2e tests
479478

@@ -489,8 +488,7 @@ We expect no non-infra related flakes in the last month as a GA graduation crite
489488

490489
<!-- - <test>: <link to test coverage> -->
491490

492-
The functionality will be exercised by the existing regular and upgrade e2e tests
493-
that use the kinder tool.
491+
A new e2e test will be added by using the kinder tool.
494492

495493
### Graduation Criteria
496494

@@ -631,8 +629,9 @@ Major milestones might include:
631629
- when the KEP was retired or superseded
632630
-->
633631

634-
- 18.09.2023: KEP created (1.29)
632+
- 18.09.2023: KEP created (1.29).
635633
- 10.10.2023: Address minor feedback. KEP marked as implementable.
634+
- 10.19.2023: Adjust test plan and risk / mitigations.
636635

637636
## Drawbacks
638637

keps/sig-cluster-lifecycle/kubeadm/4214-separate-super-user-kubeconfig/kep.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ participating-sigs:
77
- sig-cluster-lifecycle
88
status: implementable
99
creation-date: 2023-9-18
10-
last-updated: 2023-10-10
10+
last-updated: 2023-10-19
1111
reviewers:
1212
- "@SataQiu"
1313
- "@pacoxu"

0 commit comments

Comments
 (0)