Policies · Kong Mesh
MeshOPA
Kong Mesh targetRef policy that runs OPA rego authorization on selected proxies.
Behaviour per target
Output: MeshOPA
Copied unchanged, with forward-looking advisories:
spec.targetRef.{name,namespace,mesh}are removed in 3.0. Droppingnamewidens the policy to every proxy matchingkind.spec.targetRef.kind: MeshServiceis rejected in 3.0; plankind: Dataplanewithlabels: {app: <svc>}.agentConfigandappendPolicies[].regoin the flat DataSource shape (inline/inlineString/secret) must becomeSecureDataSource. Kong Mesh 2.14.6+ accepts both shapes: rewrite there, on every control plane, before upgrading the Global.
Output: MeshOPA
Rewritten in this order:
targetRef.kind: MeshService→Dataplane, and akuma.io/display-namelabel is renamed toapp.targetRef.name→ a label (appforDataplane), keeping the scope. An existing conflicting label blocks the move and is reported.namespaceandmeshare dropped.- DataSources →
SecureDataSource:inlineStringand base64-decodedinline→type: InsecureInline+insecureInline.value;secret→type: Secret+secretRef: {kind: Secret, name}.
Rego and agent config are not credentials, so decoding inline is done automatically.
Verify the app label matches the target pods.
A rewritten MeshOPA is applied before the Global upgrade: the Apply Checklist adds a
step to upgrade every control plane to 2.14.6 or later and apply these files there. 3.0
rejects the flat shape and nothing converts it over KDS, while a zone below 2.14.6 drops
the new fields: the MeshOPA fails to load and its proxies stop receiving configuration.
Timeline
| Version | Change |
|---|---|
| 3.0 | targetRef.{name,namespace,mesh} removed; targetRef.kind limited to Mesh and Dataplane; DataSources use SecureDataSource. |
| 2.14.6 | SecureDataSource accepted alongside the flat shape (Kong Mesh). |
Related topics
- Access control — MeshTrafficPermission from[] versus SPIFFE rules[], MeshOPA, and the Kong Mesh RBAC changes in 3.0 — what kuma-migrator converts and what stays manual.
- Policy targeting — Which targetRef kinds each policy accepts at each position on 2.14 and 3.0, labels-only selection, policy roles, and control-plane-owned labels.