Policies · Kong Mesh

MeshOPA

Kong Mesh targetRef policy that runs OPA rego authorization on selected proxies.

Kong Mesh

Behaviour per target

--to-latest v2 (2.x) warned

Output: MeshOPA

Copied unchanged, with forward-looking advisories:

  • spec.targetRef.{name,namespace,mesh} are removed in 3.0. Dropping name widens the policy to every proxy matching kind.
  • spec.targetRef.kind: MeshService is rejected in 3.0; plan kind: Dataplane with labels: {app: <svc>}.
  • agentConfig and appendPolicies[].rego in the flat DataSource shape (inline/inlineString/secret) must become SecureDataSource. Kong Mesh 2.14.6+ accepts both shapes: rewrite there, on every control plane, before upgrading the Global.
--to-latest v3 (3.0) rewritten

Output: MeshOPA

Rewritten in this order:

  1. targetRef.kind: MeshService → Dataplane, and a kuma.io/display-name label is renamed to app.
  2. targetRef.name → a label (app for Dataplane), keeping the scope. An existing conflicting label blocks the move and is reported. namespace and mesh are dropped.
  3. DataSources → SecureDataSource: inlineString and base64-decoded inline → 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

VersionChange
3.0targetRef.{name,namespace,mesh} removed; targetRef.kind limited to Mesh and Dataplane; DataSources use SecureDataSource.
2.14.6SecureDataSource accepted alongside the flat shape (Kong Mesh).

Source files