Skip to content

authority of route rule rewrite not work  #4320

@aimuke

Description

@aimuke

version:istio: 0.6.0 + Ubuntu 16.04.2 LTS

Hi,

I run bookinfo example in kube by the guide. I did some changes of the example to test the authority of routerule rewrite. But I found it did not work. Can someone give me a hint? Below are what I did:

  1. I changed the detail request url from 'http://details:9080/details/0' to 'http://ratings:9080/v1/details/0' in productpage service,and restart the service.
  2. add a rewrite rule(detail-rewrite) of detail to rewrite "/v1/details" to '/details'
  3. add a redirect rule(rate2detail) of ratings to redirect 'ratings' to 'details'
  4. refresh the demo page. the demo is ok, it can get the detail info. (redirect success)
  5. then I replace rate2detail to rate2detail rewrite.
  6. refresh the demo page and now the the detail request fails. (rewrite not work)

Below are the rules:

detail-rewrite

apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  name: detail-rewrite
spec:
  ## Used by services inside the Kubernetes cluster
  destination:
    name: details
  match:
    request:
      headers:
        uri:
          prefix: /v1/details
  rewrite:
    uri: /details

rate2detail

apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  name: rate2detail
spec:
  ## Used by services inside the Kubernetes cluster
  destination:
    name: ratings
  redirect:
    authority: details:9080

rate2detail rewrite

apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  name: rate2detail
spec:
  ## Used by services inside the Kubernetes cluster
  destination:
    name: ratings
  rewrite:
    authority: details:9080

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions