For MeshIdentity to work, meshServices.mode: Exclusive must be set on the Mesh resource. This value is already configured in the demo Mesh.
MeshIdentity manages identity issuance. To issue a new identity in a mesh, create this resource:
echo "apiVersion: kuma.io/v1alpha1
kind: MeshIdentity
metadata:
name: identity
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
spec:
selector:
dataplane:
matchLabels: {}
spiffeID:
trustDomain: '{{ .Mesh }}.{{ .Zone }}.mesh.local'
path: '/ns/{{ .Namespace }}/sa/{{ .ServiceAccount }}'
provider:
type: Bundled
bundled:
meshTrustCreation: Enabled
insecureAllowSelfSigned: true
certificateParameters:
expiry: 24h
autogenerate:
enabled: true" | kubectl apply -f -
MeshIdentity uses selector to choose the data planes that receive identities. In this example, the selector issues identity to all data planes in the mesh.
spiffeID defines templates for workload SPIFFE IDs. In this example, the trust domain template combines the mesh name, zone name, and .mesh.local. The path template combines the namespace and service account.
The provider field contains identity provider-specific configuration. This guide uses the Bundled provider. This configuration enables MeshTrust generation, allows self-signed certificates, and sets the certificate expiry time to 24h.