Give a subset of workloads their own identity
A narrower selector wins over a mesh-wide one, so these proxies are issued from this CA instead. Make sure peers trust this CA before applying. A self-signed root CA also needs insecureAllowSelfSigned: true.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshIdentity
metadata:
name: payments-identity
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
spec:
selector:
dataplane:
matchLabels:
app: payments
provider:
type: Bundled
bundled:
ca:
certificate:
type: Secret
secretRef:
kind: Secret
name: payments-ca-cert
privateKey:
type: Secret
secretRef:
kind: Secret
name: payments-ca-keyCopied!
type: MeshIdentity
name: payments-identity
mesh: default
spec:
selector:
dataplane:
matchLabels:
app: payments
provider:
type: Bundled
bundled:
ca:
certificate:
type: Secret
secretRef:
kind: Secret
name: payments-ca-cert
privateKey:
type: Secret
secretRef:
kind: Secret
name: payments-ca-keyCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_identity" "payments_identity" {
provider = konnect-beta
type = "MeshIdentity"
name = "payments-identity"
spec = {
selector = {
dataplane = {
match_labels = {
app = "payments"
}
}
}
provider = {
type = "Bundled"
bundled = {
ca = {
certificate = {
type = "Secret"
secret_ref = {
kind = "Secret"
name = "payments-ca-cert"
}
}
private_key = {
type = "Secret"
secret_ref = {
kind = "Secret"
name = "payments-ca-key"
}
}
}
}
}
}
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!