Hello! I am trying to get a consul ingress gateway with path-based routing working and for the life of me, I cannot get the ingress gateway to either function or show up in the service mesh. If anyone can offer advice, I’d really appreciate it. Stuck at this point and unsure what to try next.
I don’t see the services for ingress gateway in consul services, and I don’t see it when I run consul members as you can see here
❯ CONSUL_HTTP_ADDR="http://localhost:18500" consul catalog services consul grpc.health.v1.jobsvc jobs jobs-db jobs-db-sidecar-proxy jobs-sidecar-proxy ❯ CONSUL_HTTP_ADDR="http://localhost:18500" consul members Node Address Status Type Build Protocol DC Segment hashicorp-consul-server-0 172.17.0.9:8301 alive server 1.9.3 2 dc1 <all> minikube 172.17.0.6:8301 alive client 1.9.3 2 dc1 <default>
I have this in my helm values file, and I’ve run ❯ helm upgrade -f ./values.yml hashicorp hashicorp/consul on it. The values contains the following for ingressGateways:
--- ingressGateways: enabled: true defaults: service: type: LoadBalancer gateways: - name: ingress-service
I have run kubectl apply on the ingress definition, which is as follows:
apiVersion: consul.hashicorp.com/v1alpha1 kind: IngressGateway metadata: name: ingress-service labels: name: turbine-ingress tier: ingress spec: listeners: - port: 80 protocol: http services: - name: jobs-api --- apiVersion: consul.hashicorp.com/v1alpha1 kind: ServiceRouter namespace: default metadata: name: jobs-api spec: routes: - match: http: pathPrefix: '/jobs' destination: service: jobs
My job service is up and running as well which looks as follows:
--- apiVersion: v1 kind: Service metadata: name: jobs labels: app: jobs-v1 spec: type: NodePort ports: - port: 10122 targetPort: 10122 name: http - port: 10123 targetPort: 10123 name: grpc selector: app: jobs tier: api --- apiVersion: apps/v1 kind: Deployment metadata: name: jobs-deployment-v1 namespace: default labels: app: jobs tier: api spec: replicas: 1 selector: matchLabels: app: jobs tier: api template: # any matched pods from the matchlabels above will be given the below config metadata: labels: app: jobs tier: api annotations: 'consul.hashicorp.com/connect-inject': 'true' # inject consul connect # sidecar proxy spec: containers: - name: jobs # ... etc ...
Am I doing something wrong here? As far as I can find anywhere everything is correct. Any advice would be greatly appreciated.