Rotate a CA without breaking verification
Publish the new CA alongside the old one so both are trusted while workloads are re-issued, then remove the old entry.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshTrust
metadata:
name: corporate-ca
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
spec:
trustDomain: corp.example.com
caBundles:
- type: Pem
pem:
value: |
-----BEGIN CERTIFICATE-----
... the new CA ...
-----END CERTIFICATE-----
- type: Pem
pem:
value: |
-----BEGIN CERTIFICATE-----
... the CA being retired ...
-----END CERTIFICATE-----Copied!
type: MeshTrust
name: corporate-ca
mesh: default
spec:
trustDomain: corp.example.com
caBundles:
- type: Pem
pem:
value: |
-----BEGIN CERTIFICATE-----
... the new CA ...
-----END CERTIFICATE-----
- type: Pem
pem:
value: |
-----BEGIN CERTIFICATE-----
... the CA being retired ...
-----END CERTIFICATE-----Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_trust" "corporate_ca" {
provider = konnect-beta
type = "MeshTrust"
name = "corporate-ca"
spec = {
trust_domain = "corp.example.com"
ca_bundles = [
{
type = "Pem"
pem = {
value = <<-EOT
-----BEGIN CERTIFICATE-----
... the new CA ...
-----END CERTIFICATE-----
EOT
}
},
{
type = "Pem"
pem = {
value = <<-EOT
-----BEGIN CERTIFICATE-----
... the CA being retired ...
-----END CERTIFICATE-----
EOT
}
}
]
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}
Copied!