@@ -376,6 +376,97 @@ you like. If you want to add a note for human consumption, use the
376
376
` status.conditions.message` field.
377
377
378
378
379
+ # # PodCertificateRequests {#pod-certificate-requests}
380
+
381
+ {{< feature-state feature_gate_name="PodCertificateRequest" >}}
382
+
383
+ {{< note >}}
384
+ In Kubernetes {{< skew currentVersion >}}, you must enable support for Pod
385
+ Certificates using the `PodCertificateRequest` [feature
386
+ gate](/docs/reference/command-line-tools-reference/feature-gates/) and the
387
+ ` --runtime-config=certificates.k8s.io/v1alpha1/podcertificaterequests=true`
388
+ kube-apiserver flag.
389
+ {{< /note >}}
390
+
391
+ PodCertificateRequests are API objects tailored to provisioning certificates to
392
+ workloads running as Pods within a cluster. The user typically does not
393
+ interact with PodCertificateRequests directly, but uses [podCertificate
394
+ projected volume sources](
395
+ /docs/concepts/storage/projected-volumes#podcertificate), which are a `kubelet`
396
+ feature that handles secure key provisioning and automatic certificate refresh.
397
+ The application inside the pod only needs to know how to read the certificates
398
+ from the filesystem.
399
+
400
+ PodCertificateRequests are similar to CertificateSigningRequests, but have a
401
+ simpler format enabled by their narrower use case.
402
+
403
+ A PodCertificateRequest has the following spec fields :
404
+ * `signerName`: The signer to which this request is addressed.
405
+ * `podName` and `podUID`: The Pod that Kubelet is requesting a certificate for.
406
+ * `serviceAccountName` and `serviceAccountUID`: The ServiceAccount corresponding to the Pod.
407
+ * `nodeName` and `nodeUID`: The Node corresponding to the Pod.
408
+ * `maxExpirationSeconds`: The maximum lifetime that the workload author will
409
+ accept for this certificate. Defaults to 24 hours if not specified.
410
+ * `pkixPublicKey`: The public key for which the certificate should be issued.
411
+ * `proofOfPossession`: A signature demonstrating that the requester controls the
412
+ private key corresponding to `pkixPublicKey`.
413
+
414
+ Nodes automatically receive permissions to create PodCertificateRequests and
415
+ read PodCertificateRequests related to them (as determined by the
416
+ ` spec.nodeName` field). The `NodeRestriction` admission plugin, if enabled,
417
+ ensures that nodes can only create PodCertificateRequests that correspond to a
418
+ real pod that is currently running on the node.
419
+
420
+ After creation, the `spec` of a PodCertificateRequest is immutable.
421
+
422
+ Unlike CSRs, PodCertificateRequests do not have an
423
+ approval phase. Once the PodCertificateRequest is created, the signer's
424
+ controller directly decides to issue or deny the request. It also has the
425
+ option to mark the request as failed, if it encountered a permanent error when
426
+ attempting to issue the request.
427
+
428
+ To take any of these actions, the signing controller needs to have the
429
+ appropriate permissions on both the PodCertificateRequest type, as well as on
430
+ the signer name :
431
+ * Verbs: **update**, group: `certificates.k8s.io`, resource:
432
+ ` podcertificaterequests/status`
433
+ * Verbs: **sign**, group: `certificates.k8s.io`, resource: `signers`,
434
+ resourceName : ` <signerNameDomain>/<signerNamePath>` or `<signerNameDomain>/*`
435
+
436
+ The signing controller is free to consider other information beyond what's
437
+ contained in the request, but it can rely on the information in the request to
438
+ be accurate. For example, the signing controller might load the Pod and read
439
+ annotations set on it, or perform a SubjectAccessReview on the ServiceAccount.
440
+
441
+ To issue a certificate in response to a request, the signing controller :
442
+ * Adds an `Issued` condition to `status.conditions`.
443
+ * Puts the issued certificate in `status.certificateChain`
444
+ * Puts the `NotBefore` and `NotAfter` fields of the certificate in the
445
+ ` status.notBefore` and `status.notAfter` fields — these fields are
446
+ denormalized into the Kubernetes API in order to aid debugging
447
+ * Suggests a time to begin attempting to refresh the certificate using
448
+ ` status.beginRefreshAt` .
449
+
450
+ To deny a request, the signing controller adds a "Denied" condition to
451
+ ` status.conditions[]` .
452
+
453
+ To mark a request failed, the signing controller adds a "Failed" condition to
454
+ ` status.conditions[]` .
455
+
456
+ All of these conditions are mutually-exclusive, and must have status "True". No
457
+ other condition types are permitted on PodCertificateRequests. In addition,
458
+ once any of these conditions are set, the `status` field becomes immutable.
459
+
460
+ Like all conditions, the `status.conditions[].reason` field is meant to contain
461
+ a machine-readable code describing the condition in TitleCase. The
462
+ ` status.conditions[].message` field is meant for a free-form explanation for
463
+ human consumption.
464
+
465
+ To ensure that terminal PodCertificateRequests do not build up in the cluster, a
466
+ ` kube-controller-manager` controller deletes all PodCertificateRequests older
467
+ than 15 minutes. All certificate issuance flows are expected to complete within
468
+ this 15-minute limit.
469
+
379
470
# # Cluster trust bundles {#cluster-trust-bundles}
380
471
381
472
{{< feature-state feature_gate_name="ClusterTrustBundle" >}}
0 commit comments