stefanprodan / flagger-appmesh-gateway

A Kubernetes API Gateway for AWS App Mesh powered by Envoy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error adding/updating listener(s) listener_http

jgordor opened this issue · comments

Hi,

I setup the appmesh gateway on EKS 1.14 ingress NLB.

After publishing a virtual service:

apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualService
metadata:
  name: s1.apps.svc.cluster.local
  namespace: apps
  annotations:
    gateway.appmesh.k8s.aws/expose: "true"
    gateway.appmesh.k8s.aws/retries: "5"
    gateway.appmesh.k8s.aws/timeout: "25s"
    gateway.appmesh.k8s.aws/domain: "example.com,www.example.com"
....

And check that the service has been registered in the controller:

I0316 09:52:01.373887       1 snapshot.go:119] cache updated for 1 services, version 1, checksum 1014069415403572753
I0316 09:52:01.420517       1 virtualnode.go:114] virtual node flagger-appmesh-gateway updated with 1 backends

I see errors registering in the proxy, not sure why the -3000 is being added:

[2020-03-16 09:52:01.386][1][warning][config] [source/common/config/grpc_mux_subscription_impl.cc:82] gRPC config for type.googleapis.com/envoy.api.v2.Listener rejected: Error adding/updating listener(s) listener_http: route: unknown cluster 's1.apps.svc.cluster.local-3000'

Some tip?

3000 is the port, looks like that port is not opened or it's not setup correctly in the virtual node, virtual service, deployment or kubernetes service. The name of the port should be http.

Thanks, I rechecked/recreated and I got the same error:

apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualService
metadata:
  name: s1.apps.svc.cluster.local
  namespace: apps
  annotations:
    gateway.appmesh.k8s.aws/expose: "true"
    gateway.appmesh.k8s.aws/retries: "5"
    gateway.appmesh.k8s.aws/timeout: "25s"
    gateway.appmesh.k8s.aws/domain: "example.com,www.example.com"
spec:
  meshName: applications
  routes:
    - name: route-to-svc-blue
      http:
        match:
          prefix: /
        action:
          weightedTargets:
            - virtualNodeName: s1-blue
              weight: 1
---
apiVersion: appmesh.k8s.aws/v1beta1
kind: VirtualNode
metadata:
  name: s1-blue
  namespace: apps
spec:
  meshName: applications
  listeners:
    - portMapping:
        port: 3000
        protocol: http
  serviceDiscovery:
    dns:
      hostName: s1-blue.apps.svc.cluster.local
  backends: 
    - virtualService:
        virtualServiceName: s1.apps.svc.cluster.local
    - virtualService:
        virtualServiceName: s2.apps.svc.cluster.local
  logging:
    accessLog:
      file:
        path: /dev/stdout
---
apiVersion: v1
kind: Service
metadata:
  name: s1
  namespace: apps
  labels:
    app: s1
spec:
  ports:
    - name: http
      port: 3000
      protocol: TCP
      targetPort: http
---
apiVersion: v1
kind: Service
metadata:
  name: s1-blue
  namespace: apps
  labels:
    app: s1
    version: blue
spec:
  ports:
    - port: 3000
      name: http
  selector:
    app: s1
    version: blue
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: s1-blue
  namespace: apps
spec:
  replicas: 1
  selector:
    matchLabels:
      app: s1
      version: blue
  template:
    metadata:
      labels:
        app: s1
        version: blue
    spec:
      containers:
        - name: xxx
          image: xxx.dkr.ecr.eu-west-1.amazonaws.com/xxx:12
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP

So did it work in the end?

No, same behaviour, we are currently testing gloo. Thank you very much for your support

FYI: I finally get it working, I changed the mesh-name in kustomize, but only on nlb/deployment, I changed it also in base/gateway/deployment and everything is working, thank you again

ezoic increase your site revenue