-
Notifications
You must be signed in to change notification settings - Fork 16
API-Gateway-Controller fails to resolve Vault Service registered in Consul #299
Comments
It looks like the error you're hitting is https://github.com/hashicorp/consul-api-gateway/blob/v0.3.0/internal/k8s/service/resolver.go#L244 - could you try capturing Consul API Gateway controller logs with The code path you're getting an error from iterates over services registered to all Consul nodes - what I'm not quite sure about is how the Vault backend integration registers itself with Consul - it may be as an external service which could be an edge case our logic doesn't cover yet. |
Thank you so much for getting back to me! We tried bumping the logLevel to trace, resulting in this message back from the controller:
Definitely more info coming back, but we haven't seen anything to clue us in on whether or not vault is registering itself as an external service. We're going to keep doing some digging on our end as to whether or not that's the case. Out of curiosity what is your timeline for external services support? |
Hmm, those logs mostly look like the gateway itself spinning up normally, the only thing that looked off is
but I'm guessing that was a temporary state given that the route eventually gets an It may be worth checking the ListenerStatus field on the Gateway to make sure everything looks okay first, then checking the controller logs specifically for errors originating from (EDIT: Looking more closely, it appears that Vault uses a standard |
I did a little bit of digging here today and now understand more as to why Consul API Gateway's controller isn't able to resolve the reference to the vault The For a "normal" $ curl https://localhost:8501/v1/catalog/service/echo-1 --insecure --silent | jq
[
{
...
"ServiceID": "echo-1-bf966d7c9-nt5dh-echo-1",
"ServiceName": "echo-1",
"ServiceTags": [],
"ServiceMeta": {
"k8s-namespace": "default",
"k8s-service-name": "echo-1",
"managed-by": "consul-k8s-endpoints-controller",
"pod-name": "echo-1-bf966d7c9-nt5dh",
"synthetic-node": "true"
},
"CreateIndex": 2508,
"ModifyIndex": 2508
}
] For the $ curl https://localhost:8501/v1/catalog/service/vault --insecure --silent | jq
[
{
...
"ServiceID": "vault:10.60.0.9:8200",
"ServiceName": "vault",
"ServiceTags": [
"standby"
],
"ServiceMeta": {
"external-source": "vault"
},
"CreateIndex": 1737,
"ModifyIndex": 1737
}
...
] |
Overview of the Issue
The TL;DR:
The api-gateway-controller fails to resolve the consul service registration on deployment of httproutes for vault when deploying Vault with a consul HA backend.
The longer version:
I have a GKE cluster that I’m running Vault with Consul serving as the HA backend. I’ve installed Vault and Consul via helm charts, everything between those two installations appears to be playing nice. I’m now attempting to set up Consul API Gateway with that Consul cluster to set up some (internal) ingress traffic for a vault-injector living in another cluster. Everything is working together flawlessly until it comes to setting up the HTTPRoute, when doing so the api-gateway-controller fails to resolve the the consul service registration for Vault.
Reproduction Steps
Here's all of the things we've got setup for the installations of Vault + Consul + API Gateway:
Consul helm overrides:
Vault helm overrides:
API Gateway resources: (I'm including the TLS block in case it turns out to be a clue, but I have validated that the api gateway at least receives traffic ok over ssl)
Logs
The HTTPRoute registration
Expected behavior
The HTTPRoute registers both the kubernetes and consul service registrations for vault and allows for the api gateway to route traffic to vault.
Environment details
consul-api-gateway
version: 0.3.0Additional Context
In case this helps, below is also a listing of the vault service registered in consul.
Thank you for taking a look at this!
The text was updated successfully, but these errors were encountered: