Internal Consul API Gateway - Crashed After 0.3.0 Release

Hi,
I have a requirement where I wanted an internal consul API gateway and the following setup with old release (Install Consul API Gateway | Consul | HashiCorp Developer) worked perfectly:

  1. CRDS 0.3.0 (kubectl apply --kustomize=“github.com/hashicorp/consul-api-gateway/config/crd?ref=v0.3.0”)
  2. API GW 0.45.0 (helm install consul hashicorp/consul --version 0.45.0 --values values.yaml --create-namespace --namespace consul)

A. GatewayClassConfig:

apiVersion: api-gateway.consul.hashicorp.com/v1alpha1
kind: GatewayClassConfig
metadata:
name: internal-api-gateway-class-config
namespace: consul
spec:
serviceType: ClusterIP
useHostPorts: false


B. GatewayClass

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: GatewayClass
metadata:
name: internal-gateway-class
namespace: consul
spec:
controllerName: ‘hashicorp.com/consul-api-gateway-controller
parametersRef:
group: api-gateway.consul.hashicorp.com
kind: GatewayClassConfig
name: internal-api-gateway-class-config

C. Gateway
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: Gateway
metadata:
name: internal-api-gateway
namespace: consul
spec:
gatewayClassName: internal-gateway-class
listeners:

  • protocol: HTTP
    port: 8081
    name: http
    allowedRoutes:
    namespaces:
    from: All

After this release, I’ve tried all of them up to 0.54.0 (1.15.x) and the internal API Gateway just keeps getting crashed with the following error:

2023-05-31T00:02:21.313Z [INFO] trying to connect to a Consul server
Tue, May 30 2023 8:02:21 pm 2023-05-31T00:02:21.313Z [INFO] discovered Consul servers: addresses=[10.168.3.191:8502]
Tue, May 30 2023 8:02:21 pm 2023-05-31T00:02:21.313Z [INFO] current prioritized list of known Consul servers: addresses=[10.168.3.191:8502]
Tue, May 30 2023 8:02:31 pm {“@caller”:“/home/runner/work/consul-api-gateway/consul-api-gateway/internal/commands/exec/exec.go:92”,“@level”:“error”,“@message”:“unexpected error watching servers”,“@module”:“consul-api-gateway-exec”,“@timestamp”:“2023-05-31T00:02:31.314180Z”,“error”:“did not get state within time limit”}
Tue, May 30 2023 8:02:31 pm 2023-05-31T00:02:31.314Z [INFO] stopping


Any help will be greatly appreciated.
Thanks!

@nathancoleman You helped me with this internal api gw setup before (Can Consul API Gateway be used for east-west traffic?) so I was wondering if you have any idea with this issue. Thanks

I resolved the issue.
By looking at how the out of the box Gatewayclassconfig, GatewayClass were created, I was able to see that the issue was caused by the default Consul address (local).
Explicitly use ‘consul-server.consul.svc’ made it work.
Thanks!