{ambassador ingress} Not able to use canary and add_request_headers in the same Mapping

3/6/2019

I want to pass a few custom headers to a canary service. On adding both the mappings to the template, it is disregarding the weight and adding the header to 100% of the traffic and routing them to the canary service.

Below is my ambassador service config

    getambassador.io/config: |
      ---
      apiVersion: ambassador/v1
      kind:  Mapping
      name:  flag_off_mapping
      prefix: /web-app/
      service: web-service-flag
      weight: 99
      ---
      apiVersion: ambassador/v1
      kind:  Mapping
      name:  flag_on_mapping
      prefix: /web-app/
      add_request_headers:
        x-halfbakedfeature: enabled
      service: web-service-flag
      weight: 1

I expect 99% of the traffic to hit the service without any additional headers and 1% of the traffic to hit the service with x-halfbakedfeature: enabled header added to the request object.

  • Ambassador: 0.50.3
  • Kubernetes environment [AWS L7 ELB]
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-04T04:48:03Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
$

Apologies for X-posting in Github and SO.

-- Smruti Mandal
envoyproxy
kubernetes
kubernetes-ingress

1 Answer

4/19/2019

Please take a look here:
As workaround could you consider:

"Make another service pointing to the same canary instances with an ambassador annotation containing the same prefix and headers required."

-- Hanx
Source: StackOverflow