Allow one domain on two ports
Allow the same domain name on two explicit ports. The sidecar resolves the domain itself and connects on each listed port.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshPassthrough
metadata:
name: allow-api-both-ports
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Mesh
default:
appendMatch:
- type: Domain
value: api.example.com
protocol: tls
port: 443
- type: Domain
value: api.example.com
protocol: http
port: 80Copied!
type: MeshPassthrough
name: allow-api-both-ports
mesh: default
spec:
targetRef:
kind: Mesh
default:
appendMatch:
- type: Domain
value: api.example.com
protocol: tls
port: 443
- type: Domain
value: api.example.com
protocol: http
port: 80Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_passthrough" "allow_api_both_ports" {
provider = konnect-beta
type = "MeshPassthrough"
name = "allow-api-both-ports"
spec = {
target_ref = {
kind = "Mesh"
}
default = {
append_match = [
{
type = "Domain"
value = "api.example.com"
protocol = "tls"
port = 443
},
{
type = "Domain"
value = "api.example.com"
protocol = "http"
port = 80
}
]
}
}
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!