--- apiVersion: v1 kind: Service metadata: name: my-bg-svc-active namespace: app spec: ports: - port: 8080 targetPort: http protocol: TCP name: http selector: # This selector will be updated with the pod-template-hash of the canary ReplicaSet. app: demo-app-bg --- apiVersion: v1 kind: Service metadata: name: my-bg-svc-preview namespace: app spec: ports: - port: 8080 targetPort: http protocol: TCP name: http selector: # This selector will be updated with the pod-template-hash of the stable ReplicaSet. app: demo-app-bg --- apiVersion: appmesh.k8s.aws/v1beta2 kind: VirtualNode metadata: name: my-bg-vn-active namespace: app spec: podSelector: matchLabels: app: demo-app-bg role: active listeners: - portMapping: port: 8080 protocol: http serviceDiscovery: dns: hostname: my-bg-svc-active.app.svc.cluster.local --- apiVersion: appmesh.k8s.aws/v1beta2 kind: VirtualNode metadata: name: my-bg-vn-preview namespace: app spec: podSelector: matchLabels: app: demo-app-bg role: preview listeners: - portMapping: port: 8080 protocol: http serviceDiscovery: dns: hostname: my-bg-svc-preview.app.svc.cluster.local --- apiVersion: appmesh.k8s.aws/v1beta2 kind: VirtualRouter metadata: name: my-bg-vrouter namespace: app spec: listeners: - portMapping: port: 8080 protocol: http routes: - name: primary httpRoute: match: prefix: / action: weightedTargets: - virtualNodeRef: name: my-bg-vn-preview weight: 0 - virtualNodeRef: name: my-bg-vn-active weight: 100 --- apiVersion: appmesh.k8s.aws/v1beta2 kind: VirtualService metadata: name: my-bg-vsvc namespace: app spec: provider: virtualRouter: virtualRouterRef: name: my-bg-vrouter --- apiVersion: appmesh.k8s.aws/v1beta2 kind: GatewayRoute metadata: name: gateway-route-paths namespace: app labels: gateway: ingress-gw spec: httpRoute: match: prefix: "/bluegreen" action: target: virtualService: virtualServiceRef: name: my-bg-vsvc