-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Gateway Controller in secondary datacenter has insufficient permissions #1344
Comments
Thanks for reporting @krarey! This is an issue with the Helm chart that the API Gateway team will work on addressing |
I'm also seeing issues that may be related in a federated secondary datacenter. I can set up routes manually and when I check the routes status, it appears to be correct. When I try to connect to the API gateway using curl, I get an immediate closing of the connection: In the primary datacenter the connection works correctly as expected. It seems possible that this is a TLS issue related to the shared consul-federation caCert and caKey, but I'm not at all sure. I know it's not exactly the same issue as above, but seems to be closely relate. |
I have just fall into this issue while testing the new URLrewrite filter on latest consul-k8s helm chart (v0.47.1). Managed to register routes in primary datacenter, but similar configs does not work in secondary datacenter. @nathancoleman do you think that if I change one of secondary cluster to Cluster peering instead of WAN federation that would work? |
@nathancoleman, do you have any idea when your code is likely to be released so that we can test it? |
Thank you guys, will test it right now. |
@nathancoleman Consul API gateway controller never becomes ready:
It looks to be related to serviceaccount/rolebinding stuff, since I've managed to run the following command in
I have also been able to complete the initContainer using the "consul-controller" service account instead of "consul-api-gateway-controler". Any suggestion? maybe track in a separate issue? |
Please could you keep us updated on the progress with this, it looks like it has become more complicated. Unfortunately running a single datacenter isn't an option for us due to the flat networking requirements. |
Hi @codex70 the insufficient permissions issue described here is resolved by the combination of #1462 (merged + released) and #1481 (in code review). With the API Gateway controller running in both the primary and the secondary datacenter, there is one other issue preventing you from successfully spinning up a Edit: We've also updated our docs describing current limitations with regard to federation here. I expect I'll have the datacenter federation feature described there working (controller per datacenter, gateways routing within the datacenter they're deployed to) with #1481 and a fix for hashicorp/consul-api-gateway#361; however, routing from a gateway in one datacenter to a service in a different datacenter is unlikely in the short term. |
Hi all! @nathancoleman @krarey
{{- if and .Values.global.federation.enabled .Values.global.federation.primaryDatacenter }}
-acl-auth-method={{ template "consul.fullname" . }}-k8s-component-auth-method-{{ .Values.global.datacenter }} \
-primary-datacenter={{ .Values.global.federation.primaryDatacenter }} \
{{-else}}
{{- if and .Values.global.federation.enabled .Values.global.federation.primaryDatacenter }}
-primary-datacenter={{ .Values.global.federation.primaryDatacenter }} \
{{-end}} |
Community Note
Overview of the Issue
When deploying a federated secondary Consul datacenter via Helm chart, the API Gateway Controller deployment is configured to retrieve a token at launch time via Kubernetes auth method. This token has the
local
flag set, and the associated policy is further scoped only to the secondary datacenter.Because this token is used to create config-entry resources, which are globally created in the primary datacenter and replicated back to the secondaries, attachment of new HTTPRoute and TCPRoute resources within the secondary cluster fails to complete as the attached token is invalid in the primary DC. This prevents creation of the underlying Consul
*-gateway
,service-defaults
, andservice-intentions
resources managed by the API Gateway Controller.Reproduction Steps
HTTPRoute
orTCPRoute
with the deployed Gateway, that references a running and connect-injected upstream service. e.g.:ingress-gateway
orservice-intentions
are created by the gateway controller.Expected behavior
HTTPRoute
andTCPRoute
resources created within a Kubernetes cluster configured as a Consul secondary DC should lead to successful creation of the associated config entries within Consul.Environment details
consul-k8s version: 0.45.0, also tested with 0.41.1 (prior to addition of component auth method)
API Gateway Version: 0.3.0, also tested with 0.1.0
Kubernetes version: v1.22.8-gke.20
Cloud Provider: GCP, also tested with Azure Red Hat OpenShift
Values.yaml:
The text was updated successfully, but these errors were encountered: