@@ -262,3 +262,88 @@ const (
262
262
UsageMicrosoftSGC KeyUsage = "microsoft sgc"
263
263
UsageNetscapeSGC KeyUsage = "netscape sgc"
264
264
)
265
+
266
+ // +genclient
267
+ // +genclient:nonNamespaced
268
+ // +k8s:prerelease-lifecycle-gen:introduced=1.32
269
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
270
+
271
+ // ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors
272
+ // (root certificates).
273
+ //
274
+ // ClusterTrustBundle objects are considered to be readable by any authenticated
275
+ // user in the cluster, because they can be mounted by pods using the
276
+ // `clusterTrustBundle` projection. All service accounts have read access to
277
+ // ClusterTrustBundles by default. Users who only have namespace-level access
278
+ // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount
279
+ // that they have access to.
280
+ //
281
+ // It can be optionally associated with a particular assigner, in which case it
282
+ // contains one valid set of trust anchors for that signer. Signers may have
283
+ // multiple associated ClusterTrustBundles; each is an independent set of trust
284
+ // anchors for that signer. Admission control is used to enforce that only users
285
+ // with permissions on the signer can create or modify the corresponding bundle.
286
+ type ClusterTrustBundle struct {
287
+ metav1.TypeMeta `json:",inline"`
288
+
289
+ // metadata contains the object metadata.
290
+ // +optional
291
+ metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
292
+
293
+ // spec contains the signer (if any) and trust anchors.
294
+ Spec ClusterTrustBundleSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
295
+ }
296
+
297
+ // ClusterTrustBundleSpec contains the signer and trust anchors.
298
+ type ClusterTrustBundleSpec struct {
299
+ // signerName indicates the associated signer, if any.
300
+ //
301
+ // In order to create or update a ClusterTrustBundle that sets signerName,
302
+ // you must have the following cluster-scoped permission:
303
+ // group=certificates.k8s.io resource=signers resourceName=<the signer name>
304
+ // verb=attest.
305
+ //
306
+ // If signerName is not empty, then the ClusterTrustBundle object must be
307
+ // named with the signer name as a prefix (translating slashes to colons).
308
+ // For example, for the signer name `example.com/foo`, valid
309
+ // ClusterTrustBundle object names include `example.com:foo:abc` and
310
+ // `example.com:foo:v1`.
311
+ //
312
+ // If signerName is empty, then the ClusterTrustBundle object's name must
313
+ // not have such a prefix.
314
+ //
315
+ // List/watch requests for ClusterTrustBundles can filter on this field
316
+ // using a `spec.signerName=NAME` field selector.
317
+ //
318
+ // +optional
319
+ SignerName string `json:"signerName,omitempty" protobuf:"bytes,1,opt,name=signerName"`
320
+
321
+ // trustBundle contains the individual X.509 trust anchors for this
322
+ // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates.
323
+ //
324
+ // The data must consist only of PEM certificate blocks that parse as valid
325
+ // X.509 certificates. Each certificate must include a basic constraints
326
+ // extension with the CA bit set. The API server will reject objects that
327
+ // contain duplicate certificates, or that use PEM block headers.
328
+ //
329
+ // Users of ClusterTrustBundles, including Kubelet, are free to reorder and
330
+ // deduplicate certificate blocks in this file according to their own logic,
331
+ // as well as to drop PEM block headers and inter-block data.
332
+ TrustBundle string `json:"trustBundle" protobuf:"bytes,2,opt,name=trustBundle"`
333
+ }
334
+
335
+ // +k8s:prerelease-lifecycle-gen:introduced=1.32
336
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
337
+
338
+ // ClusterTrustBundleList is a collection of ClusterTrustBundle objects
339
+ type ClusterTrustBundleList struct {
340
+ metav1.TypeMeta `json:",inline"`
341
+
342
+ // metadata contains the list metadata.
343
+ //
344
+ // +optional
345
+ metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
346
+
347
+ // items is a collection of ClusterTrustBundle objects
348
+ Items []ClusterTrustBundle `json:"items" protobuf:"bytes,2,rep,name=items"`
349
+ }
0 commit comments