You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Handle trust anchors expressed in other forms than PEM-wrapped, DER-formatted
229
236
X.509.
230
237
238
+
* Have the kube-apiserver consume ClusterTrustBundles as a part of service/webhook APIs.
239
+
This enhancement does not specify a revocation mechanism for a trust represented
240
+
by a ClusterTrustBundle. Having this mechanism would be a natural follow-up
241
+
candidate to this KEP.
242
+
231
243
## Proposal
232
244
233
245
This proposal is centered around a new cluster-scoped ClusterTrustBundle
234
246
resource, initially in the certificates/v1alpha1 API group. The
235
247
ClusterTrustBundle object can be thought of as a specialized configmap tailored
236
-
to the X.509 trust anchor use case. Introducing a dedicated type allows us to
248
+
to the X.509 trust anchor use case. Introducing a dedicated type allows us to
237
249
attach different RBAC policies to ClusterTrustBundle objects, which will
238
250
typically be wide-open for reading, but locked-down for writing.
239
251
@@ -253,6 +265,10 @@ projected volume source writes the certificates from a ClusterTrustBundle into
253
265
the container filesystem, with the contents of the projected files updating as
254
266
the corresponding trust anchor sets are updated.
255
267
268
+
Finally, the ClusterTrustBundle API is exercised to create an object for
269
+
distributing the serving trust to the kube-apiserver, currently represented by
270
+
the `kube-root-ca.crt`configMap that's synced into every namespace.
271
+
256
272
### User Stories
257
273
258
274
#### Trust Anchor Distribution for Private CAs
@@ -330,10 +346,6 @@ Kubelet in the cluster. When they are updated, workloads will need to receive
330
346
the updates fairly quickly (within 5 minutes across the whole cluster), to
331
347
accommodate emergency rotation of trust anchors for a private CA.
332
348
333
-
Security: Should individual trust anchor set entries designate an OCSP endpoint
334
-
to check for certificate revociation? Or should we require the URL to be
335
-
embedded in the issued certificates? Note: This question is deferred from the 1.30 beta scope, and will be discussed as an addition to the beta scope in 1.31.
336
-
337
349
## Design Details
338
350
339
351
### ClusterTrustBundle Object
@@ -359,18 +371,16 @@ as long as their name does not contain a colon.
359
371
Multiple ClusterTrustBundle objects may be associated with a single signer.
360
372
While each object is independent at the API level, consumers (mostly Kubelet)
361
373
will select trust anchors by a combination of field selector on signer name, and
362
-
a label selector. Signer controllers may follow the convention of making the
363
-
label selector `kubernetes.io/cluster-trust-bundle-version=live` correspond to a
364
-
meaningful set of trust anchors. In general, users are expected to read the documentation for their signer controller implementation in order to determine which label selectors to use for their needs, including [canarying](#canarying-changes-to-a-clustertrustbundle).
374
+
a label selector. In general, users are expected to read the documentation for their signer controller implementation in order to determine which label selectors to use for their needs, including [canarying](#canarying-changes-to-a-clustertrustbundle).
365
375
366
376
ClusterTrustBundle objects support `.metadata.generation`.
367
377
368
378
ClusterTrustBundle creates and updates that result in an empty
369
-
`.spec.pemTrustAnchors`will be rejected during validation.
379
+
`.spec.trustBundle`will be rejected during validation.
370
380
371
381
All of the new objects and fields described in this section are gated by the
372
382
ClusterTrustBundle kube-apiserver feature gate. Unless the feature gate is
373
-
enabled, usage of these alpha objects and fields will be rejected by
383
+
enabled, usage of these objects and fields will be rejected by
374
384
kube-apiserver.
375
385
376
386
#### API Object Definition
@@ -563,6 +573,65 @@ For example, if I maintain `example.com/my-signer`, I can use the following stra
563
573
canary object first, and assess the health of the canary workloads.
564
574
* Once I am satisfied that the change is safe, I edit the live object.
565
575
576
+
### Publishing the kube-apiserver-serving Trust Bundle
577
+
578
+
Today, the trust bundle that allows verifying kube-apiserver serving certificate(s)
579
+
at its internal endpoints is distributed into every namespace using a configMap.
580
+
This is so that it can be mounted along with the ServiceAccount token in order
581
+
for the workloads to be able to communicate with the kube-apiserver.
582
+
583
+
In the future, we should be able to replace mounting these configMaps in pods for
584
+
for kube-apiserver trust with the projected volume from this feature, and so a
585
+
ClusterTrustBundle API object will be created for all clusters:
**Expiration/certificate lifetime** - The recommended maximum lifetime is 30 days.
622
+
**CA bit allowed/disallowed** - not recommended.
623
+
624
+
#### Kubelet and KCM API discovery
625
+
626
+
Functionalities in both the kubelet and KCM depend on the presence of the ClusterTrustBundle
627
+
API. If the `ClusterTrustBundleProjection` (kubelet) and `ClusterTrustBundle` (KCM) feature
628
+
gates are enabled, the kubelet and the KCM perform API discovery at startup to check for the
629
+
API presence at the version they need. If the API is not present, neither kubelet nor KCM
630
+
will enable the new behavior, and the check won't be performed until they restart again.
631
+
632
+
If the API gets disabled on the kube-apiserver side, both the kubelet and KCM must be
633
+
restarted in order for the feature to be disabled there, too.
634
+
566
635
### Test Plan
567
636
568
637
[x] I/we understand the owners of the involved components may require updates to
@@ -739,15 +808,44 @@ in back-to-back releases.
739
808
740
809
### Upgrade / Downgrade Strategy
741
810
742
-
At present, there are no upgrade / downgrade concerns. The ClusterTrustBundle
743
-
feature gate controls overall availability of the feature.
811
+
The feature is gated by these feature flags:
812
+
- kube-apiserver
813
+
- `ClusterTrustBundle`controls availability of the ClusterTrustBundle API and
814
+
presence of the relevant rules in cluster roles for the kubelet and KCM.
815
+
- `ClusterTrustBundleProjection`controls availability of the `ClusterTrustBundle`
816
+
projected volume source in the Pod API.
817
+
- kubelet
818
+
- `ClusterTrustBundleProjection`controls the availability of the kubelet being
819
+
able to mount the volumes. If disabled, kubelet will error out on any attempt to
820
+
mount a ClusterTrustBundle projected volume.
821
+
- KCM - `ClusterTrustBundle` controls the availability of the kube-apiserver-serving's
822
+
signer ClusterTrustBundle.
823
+
824
+
The proper order at which the feature should be enabled is to start with the
825
+
kube-apiserver's feature flags. Aside from enabling the API, the `ClusterTrustBundle`
826
+
feature gate also creates the necessary rules in the `system:node` cluster role.
827
+
828
+
Once the kube-apiserver feature gates are enabled, the order of enabling the feature
829
+
at kubelet or KCM does not matter.
744
830
745
831
### Version Skew Strategy
746
832
747
-
Both kubelet and kube-apiserver will need to be at 1.29 for the full featureset
748
-
to be present. If only kube-apiserver is at 1.29 and kubelet is lower, then the
749
-
the pod mounting feature will be cleanly unavailable, but all other aspects of
750
-
the feature will work.
833
+
The ClusterTrustBundle volume projection was implemented in 1.29 and kubelet would fail to mount CTB
834
+
volumes if it was requested via the Pod API while the feature gate is disabled on
835
+
kubelet side. This means that pods will fail to become ready in version-skewed environments where the
836
+
`ClusterTrustBundleProjection`kubelet feature gate is disabled, independently of the
837
+
API version.
838
+
839
+
If the `ClusterTrustBundleProjection` kubelet feature gate is enabled but the API is at a different
840
+
version than the kubelet expects, the kubelet will behave as if the feature gate was disabled.
841
+
This will cause pods trying to mount a ClusterTrustBundle to fail to become ready as kubelet
842
+
won't be able to create the mount. If the API eventually appears at the desired version, the kubelet
843
+
must be restarted in order to enable the new behavior.
844
+
845
+
Enabling the `ClusterTrustBundle` feature gate at KCM while a different-than-KCM-expected
846
+
API version is being served will make the KCM to act as if the feature gate was disabled.
847
+
If the API eventually appears at the desired version, the KCM must be restarted in order
848
+
to enable the new behavior.
751
849
752
850
## Production Readiness Review Questionnaire
753
851
@@ -887,6 +985,7 @@ Recall that end users cannot usually observe component logs or access metrics.
887
985
- [x] Other (treat as last resort)
888
986
- Users can see that pods that use ClusterTrustBundle projected volume sources are able to begin running.
889
987
- This doesn't cover showing that running pods are having their mounted trust bundles updated properly, so we need to think about how to cover them with events or conditions.
988
+
- Users can see that a ClusterTrustBundle for the signer `kubernetes.io/kube-apiserver-serving` exists in the cluster
890
989
891
990
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
892
991
@@ -935,7 +1034,7 @@ None beyond kube-apiserver.
935
1034
Yes.
936
1035
937
1036
Kubelet will open a watch on ClusterTrustBundle objects. This watch will be
938
-
low-throughput.
1037
+
low-throughput. A similar watch is also opened from the KCM side.
939
1038
940
1039
###### Will enabling / using this feature result in introducing new API types?
941
1040
@@ -947,8 +1046,8 @@ No.
947
1046
948
1047
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
949
1048
950
-
No, except for the additional pod fields that the user sets to make use of the
951
-
feature.
1049
+
A new API ClusterTrustBundle API object is created for the new `kubernetes.io/kube-apiserver-serving` signer, and there are
1050
+
additional pod fields that the user sets to make use of the feature.
952
1051
953
1052
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
0 commit comments