-
Couldn't load subscription status.
- Fork 67
Description
Unable to deploy 1+ HTTPRoute resources that reference the same backend K8s service. This is a practical use case where one HTTPRoute will be associated with v1 of a backend service and another could be created with weighted target groups for B/G testing, referencing v1 & v2 of the same backend service. When I do this, Lattice attempts to reuse the Target Group that was previously created for the v1 service and fails with the message TargetGroup tg-XXX has been associated with other services
Here is the first HTTPRoute I used:
--- apiVersion: gateway.networking.k8s.io/v1alpha2 kind: HTTPRoute metadata: name: frontend namespace: default spec: parentRefs: - name: eks-store-network sectionName: http namespace: default rules: - backendRefs: - name: frontend-svc kind: Service port: 3000 namespace: default matches: - path: type: PathPrefix value: /summary - path: type: PathPrefix value: /popular This create the following Target Group.
{ "items": [ { "arn": "arn:aws:vpc-lattice:us-west-2:937351930975:targetgroup/tg-07ee612f7751f2293", "createdAt": "2022-12-20T00:50:10.321000+00:00", "id": "tg-07ee612f7751f2293", "lastUpdatedAt": "2022-12-20T00:53:32.702000+00:00", "name": "k8s-frontend-svc-default", "port": 3000, "protocol": "HTTP", "serviceArns": [ "arn:aws:vpc-lattice:us-west-2:937351930975:service/svc-0af88a98b19436982" ], "status": "ACTIVE", "type": "IP", "vpcIdentifier": "vpc-03e33c3a543ddcaee" } ] } Then, I try to deploy another HTTPRoute as follows:
--- apiVersion: gateway.networking.k8s.io/v1alpha2 kind: HTTPRoute metadata: name: frontend-bg namespace: default spec: parentRefs: - name: eks-store-network sectionName: http namespace: default rules: - backendRefs: - name: frontend-svc kind: Service port: 3000 namespace: default weight: 25 - name: frontend-v2-svc kind: Service port: 3000 namespace: default weight: 75 matches: - path: type: PathPrefix value: /popular - path: type: PathPrefix value: /summary Now, Lattice tries to use the same Target Group tg-07ee612f7751f2293 for the K8s service frontend-svc and fails with the message "TargetGroup tg-07ee612f7751f2293 has been associated with other services"