serviceAccounts, clusterDomain,
roles, and rolebindings to build the SVID, e.g., spiffe://nico.local/nico-system/nico-api/run/secrets/spiffe.io/{tls.crt,tls.key,ca.crt}serviceAccount, role, and roleBinding (example below)namespace to the correct valueLabels you see in the
example below; you can omit those.role associated with the serviceAccount grants enough permissions to request a certificate from cert-manager-csi-driver-spiffeThe CertificateRequest (which includes the CSR) references a
ClusterIssuer set up during the initial bootstrap of the site.
The ClusterIssuer sends CSRs to Vault for signing using the nicoCA PKI.
Before a CertificateRequest can be signed, it must be approved.
cert-manager-csi-driver-spiffe-approver runs as a deployment and is
responsible for verifying the CertificateRequest meets specific
criteria
If all criteria are met, the CertificateRequest is approved, and cert-manager sends the CSR portion of the CertificateRequest to
Vault for signing.
SPIFFE is a means of identifying software systems. The identity of the software is cryptographically verifiable and exists within a “trust domain” The trust domain could be a user, organization, or anything representable in a URI.
With SPIFFE formatted Certificates, the only field populated is the SAN (Subject Alternative Name). The SAN must conform to the
SPIFFE ID format.
The validation of the SPIFFE ID format and submission of CertificateRequest gets handled by cert-manager-csi-driver-spiffe-approver and cert-manager-csi-driver-spiffe, respectively.
cert-manager-csi-driver-spiffe runs as a DaemonSet. It is responsible for generating the TLS key, CSR and submitting the CSR for
approval (By way of CertificateRequest).
NOTE
The TLS key generated in every pod never leaves the host which it was generated on. If a migration event occurs, the CSR/key are regenerated, submitted to CertManager, and then signed again.
After creating the serviceAccount, role, and rolebinding, modify your deployment/pod spec to request a Certificate
Some components in Kubernetes cannot use SPIFFE formatted certs
ValidatingWebhooks and MutatingWebhooks can not use SPIFFE formatted CertificateRequests
For those resources, there is a separate ClusterIssuer that signs CertificateRequests which are not SPIFFE formatted.
There is a CertificateRequestPolicy that enforces specific criteria for non-SPIFFE CertificateRequests. The policy only allows signing
requests for Service based TLS certs.