Hi,
I am trying to setup the API gateway on virtual machines.
The API Gateway service appears in the Consul UI, but the port for the listener is not opened on the gateway machines.
These are my configurations
Kind = "api-gateway"
Name = "consul-api-gw-fra1"
// Each listener configures a port which can be used to access the Consul cluster
Listeners = [
{
Port = 8443
Name = "api-gw-listener"
Protocol = "http"
TLS = {
Certificates = [
{
Kind = "inline-certificate"
Name = "my-certificate"
}
]
}
}
]
Kind = "http-route"
Name = "my-http-route"
// Rules define how requests will be routed
Rules = [
// Send all requests to UI services with 10% going to the "experimental" UI
{
Matches = [
{
Path = {
Match = "prefix"
Value = "/"
}
}
]
Services = [
{
Name = "ui"
Weight = 90
},
{
Name = "experimental-ui"
Weight = 10
}
]
},
// Send all requests that start with the path `/api` to the API service
{
Matches = [
{
Path = {
Match = "prefix"
Value = "/api"
}
}
]
Services = [
{
Name = "example"
}
]
}
]
Parents = [
{
Kind = "api-gateway"
Name = "consul-api-gw-fra1"
}
]
I write the config for the certificate first, then the config for the listener and then the routes
But I don’t see the port 8443 open on my gateway
This is the output of the config for the http route
"Kind": "http-route",
"Name": "my-http-route",
"Parents": [
{
"Kind": "api-gateway",
"Name": "consul-api-gw-fra1",
"SectionName": ""
}
],
"Rules": [
{
"Filters": {
"Headers": null,
"URLRewrite": null,
"RetryFilter": null,
"TimeoutFilter": null,
"JWT": null
},
"ResponseFilters": {
"Headers": null
},
"Matches": [
{
"Headers": null,
"Method": "",
"Path": {
"Match": "prefix",
"Value": "/api"
},
"Query": null
}
],
"Services": [
{
"Name": "example",
"Weight": 1,
"Filters": {
"Headers": null,
"URLRewrite": null,
"RetryFilter": null,
"TimeoutFilter": null,
"JWT": null
},
"ResponseFilters": {
"Headers": null
}
}
]
}
],
"Hostnames": null,
"CreateIndex": 454,
"ModifyIndex": 1578,
"Status": {
"Conditions": [
{
"Type": "Accepted",
"Status": "False",
"Reason": "InvalidDiscoveryChain",
"Message": "route protocol does not match targeted service protocol",
"Resource": {
"Kind": "",
"Name": "",
"SectionName": ""
},
"LastTransitionTime": "2024-04-28T07:16:46.600163222Z"
},
{
"Type": "Bound",
"Status": "False",
"Reason": "FailedToBind",
"Message": "failed to bind route to gateway consul-api-gw-fra1: route has not been accepted",
"Resource": {
"Kind": "api-gateway",
"Name": "consul-api-gw-fra1",
"SectionName": ""
},
"LastTransitionTime": "2024-04-28T07:16:46.600237032Z"
}
]
}
}
Any help is really appreciated,
Thanks