Support-for-external-APIv2.6+
The agentConfig
field lets you define a custom configuration that points to an external management server
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshOPA
metadata:
name: mopa-1
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Mesh
default:
agentConfig:
inlineString: |-
services:
acmecorp:
url: https://example.com/control-plane-api/v1
credentials:
bearer:
token: "bGFza2RqZmxha3NkamZsa2Fqc2Rsa2ZqYWtsc2RqZmtramRmYWxkc2tm"
discovery:
name: example
resource: /configuration/example/discovery
apiVersion: kuma.io/v1alpha1
kind: MeshOPA
metadata:
name: mopa-1
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Mesh
default:
agentConfig:
inlineString: |-
services:
acmecorp:
url: https://example.com/control-plane-api/v1
credentials:
bearer:
token: "bGFza2RqZmxha3NkamZsa2Fqc2Rsa2ZqYWtsc2RqZmtramRmYWxkc2tm"
discovery:
name: example
resource: /configuration/example/discovery
type: MeshOPA
mesh: default
name: mopa-1
spec:
targetRef:
kind: Mesh
default:
agentConfig:
inlineString: |-
services:
acmecorp:
url: https://example.com/control-plane-api/v1
credentials:
bearer:
token: "bGFza2RqZmxha3NkamZsa2Fqc2Rsa2ZqYWtsc2RqZmtramRmYWxkc2tm"
discovery:
name: example
resource: /configuration/example/discovery
type: MeshOPA
mesh: default
name: mopa-1
spec:
targetRef:
kind: Mesh
default:
agentConfig:
inlineString: |-
services:
acmecorp:
url: https://example.com/control-plane-api/v1
credentials:
bearer:
token: "bGFza2RqZmxha3NkamZsa2Fqc2Rsa2ZqYWtsc2RqZmtramRmYWxkc2tm"
discovery:
name: example
resource: /configuration/example/discovery
Please adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_opa" "mopa_1" {
provider = konnect-beta
type = "MeshOPA"
name = "mopa-1"
spec = {
target_ref = {
kind = "Mesh"
}
default = {
agent_config = {
inline_string = "services:
acmecorp:
url: https://example.com/control-plane-api/v1
credentials:
bearer:
token: "bGFza2RqZmxha3NkamZsa2Fqc2Rsa2ZqYWtsc2RqZmtramRmYWxkc2tm"
discovery:
name: example
resource: /configuration/example/discovery"
}
}
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}