api-gatewayangular10ambassador

Ambassador Edge Stack : Working with sample project but not with my project


I am trying to configure Ambassador as API Gateway in my kubernates cluster locally.

Installation:

  1. installed from https://www.getambassador.io/docs/latest/tutorials/getting-started/ both windows and Kubernetes part
  2. can login with >edgectl login --namespace=ambassador localhost and see dashboard
  3. configure with a sample project they provide from https://www.getambassador.io/docs/latest/tutorials/quickstart-demo/

Here is the YML file for deployment of demo app

apiVersion: apps/v1
kind: Deployment
metadata:
  name: quote
  namespace: ambassador
spec:
  replicas: 1
  selector:
    matchLabels:
      app: quote
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: quote
    spec:
      containers:
      - name: backend
        image: docker.io/datawire/quote:0.4.1
        ports:
        - name: http
          containerPort: 8080

Everything is working as expected. Now I am trying to configure with my project. But it is not working.

So for simpler case, with keeping every configuration as the demo of Ambassador, I just modify from image: docker.io/datawire/quote:0.4.1 to image: angularapp:latest where this is a docker image of Angular 10 project.

But I am getting upstream connect error or disconnect/reset before headers. reset reason: connection failure

I spent one day with this problem. I restored my Kubernates from docker desktop app and reconfigured but no luck.


Solution

  • That error occurs when a mapping is valid, but the service it is pointing to cannot be reached for some reason. Is the deployment actually running (kubectl get deploy -A -o wide)? Is your angular app exposing port 8080? 8080 is a pretty common kubernetes port, but not so much in the frontend development world. If you use kubectl exec -it {{AMBASSADOR_POD}} -- sh does curl http://quote return the expected output?