aws-containers / eks-app-mesh-polyglot-demo

End to end deployment and observability of polyglot microservices in Amazon EKS using AWS App Mesh, AWS Fargate, Amazon Cloudwatch Container Insights, and AWS X-Ray
MIT No Attribution
64 stars 636 forks source link

failed to find matching virtualGateway for gatewayRoute #1

Open seanlee10 opened 3 years ago

seanlee10 commented 3 years ago

Hi, I'm following the tutorial and got stuck at creating GatewayRoute resource using manifest.

Versions

Kubernetes version 1.20
Platform version eks.1
kubectl client v1.16.8
kubectl server v1.20.4-eks-6b7464
helm v3.6.2
appmesh-controller v1.4.0
I have the following for creating the VGW and GatewayRoute and getting failed to find matching virtualGateway for gatewayRoute error.

VGW gets created successfully but somehow GatewayRoute cannot locate the VGW within the same namespace. I tried different combinations but wasn't able to create the GatewayRoute using the manifest. I can create one in the console without any issue.

I found some help from this link but still couldn't get past the error.

I found some help from this link https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/master/docs/reference/vgw.md but still couldn't get past the error.

Error Message

Error from server (failed to find matching virtualGateway for gatewayRoute: gateway-route, expecting 1 but found 0): error when creating "appmesh/9_virtualgateway.yaml": admission webhook "mgatewayroute.appmesh.k8s.aws" denied the request: failed to find matching virtualGateway for gatewayRoute: gateway-route, expecting 1 but found 0

Manifests

apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualGateway
metadata:
  name: ingress-gw
  namespace: my-apps
spec:
  namespaceSelector:
    matchLabels:
      gateway: ingress-gw
  gatewayRouteSelector:
    matchLabels:
      gateway: ingress-gw
  podSelector:
    matchLabels:
      app: ingress-gw
  listeners:
    - portMapping:
        port: 8088
        protocol: http
  logging:
    accessLog:
      file:
        path: /dev/stdout
---
apiVersion: appmesh.k8s.aws/v1beta2
kind: GatewayRoute
metadata:
  name: gateway-route
  namespace: my-apps
  labels:
    gateway: ingress-gw
spec:
  httpRoute:
    match:
      prefix: "/"
    action:
      target:
        virtualService:
          virtualServiceRef:
            name: my-service-a
praseedasathaye commented 2 years ago

@seanlee10 This github project is for the App Mesh workshop https://www.eksworkshop.com/advanced/330_servicemesh_using_appmesh/. Did you use the steps in this workshop?