Skip to content

KServe Blue Green Deployment issues with Virtual Service #1654

@satyajitghana

Description

@satyajitghana

Here's the Virtual Service

❯ k describe vs vit-classifier
Name:         vit-classifier
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  networking.istio.io/v1beta1
Kind:         VirtualService
Metadata:
  Creation Timestamp:  2023-11-22T17:09:06Z
  Generation:          3
  Owner References:
    API Version:     v1
    Kind:            configmap
    Name:            vit-classifier-routemap
    UID:             18a2f121-b763-499c-b2f2-8168de4de465
  Resource Version:  72552
  UID:               c77942e2-016d-4fa4-b3a6-5ea00dc957a4
Spec:
  Gateways:
    knative-serving/knative-ingress-gateway
    knative-serving/knative-local-gateway
    mesh
  Hosts:
    vit-classifier.default
    vit-classifier.default.svc
    vit-classifier.default.svc.cluster.local
  Http:
    Match:
      Headers:
        Branch:
          Exact:  vit-classifier-0
    Name:         vit-classifier-0
    Rewrite:
      Uri:  /v2/models/vit-classifier-0/infer
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Remove:
            branch
          Set:
            Host:  vit-classifier-0-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-0
    Match:
      Headers:
        Branch:
          Exact:  vit-classifier-1
    Name:         vit-classifier-1
    Rewrite:
      Uri:  /v2/models/vit-classifier-1/infer
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Remove:
            branch
          Set:
            Host:  vit-classifier-1-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-1
    Name:                   split
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Set:
            Branch:  vit-classifier-0
            Host:    vit-classifier.default
      Weight:        70
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Set:
            Branch:  vit-classifier-1
            Host:    vit-classifier.default
      Weight:        30
Events:              <none>

Which doesn't work

/demo $ curl -H 'Content-Type: application/json'  http://vit-classifier.default/v1/models -s -D -
HTTP/1.1 404 Not Found
content-length: 22
content-type: application/json
date: Wed, 22 Nov 2023 17:33:49 GMT
server: envoy
x-envoy-upstream-service-time: 6
app-version: vit-classifier-1

But if i change

Headers:
        Request:
          Set:
            Branch:  vit-classifier-1
            Host:    vit-classifier.default

to

Headers:
        Request:
          Set:
            Branch:  vit-classifier-1
            Host:    vit-classifier-0-predictor.default.svc.cluster.local

It works!

❯ k describe vs/vit-classifier
Name:         vit-classifier
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  networking.istio.io/v1beta1
Kind:         VirtualService
Metadata:
  Creation Timestamp:  2023-11-22T17:09:06Z
  Generation:          10
  Owner References:
    API Version:     v1
    Kind:            configmap
    Name:            vit-classifier-routemap
    UID:             18a2f121-b763-499c-b2f2-8168de4de465
  Resource Version:  86112
  UID:               c77942e2-016d-4fa4-b3a6-5ea00dc957a4
Spec:
  Gateways:
    knative-serving/knative-ingress-gateway
    knative-serving/knative-local-gateway
    mesh
  Hosts:
    vit-classifier.default
    vit-classifier.default.svc
    vit-classifier.default.svc.cluster.local
  Http:
    Match:
      Headers:
        Branch:
          Exact:  vit-classifier-0
    Name:         vit-classifier-0
    Rewrite:
      Uri:  /v2/models/vit-classifier-0/infer
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Remove:
            branch
          Set:
            Host:  vit-classifier-0-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-0
    Match:
      Headers:
        Branch:
          Exact:  vit-classifier-1
    Name:         vit-classifier-1
    Rewrite:
      Uri:  /v2/models/vit-classifier-1/infer
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Remove:
            branch
          Set:
            Host:  vit-classifier-1-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-1
    Name:                   split
    Route:
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Set:
            Branch:  vit-classifier-0
            Host:    vit-classifier-1-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-0
      Weight:               70
      Destination:
        Host:  knative-local-gateway.istio-system.svc.cluster.local
      Headers:
        Request:
          Set:
            Branch:  vit-classifier-1
            Host:    vit-classifier-0-predictor.default.svc.cluster.local
        Response:
          Add:
            App - Version:  vit-classifier-1
      Weight:               30

/demo $ curl -H 'Content-Type: application/json'  http://vit-classifier.default/v1/models -s -D -
HTTP/1.1 200 OK
content-length: 27
content-type: application/json
date: Wed, 22 Nov 2023 17:40:48 GMT
server: envoy
x-envoy-upstream-service-time: 4
app-version: vit-classifier-0

/demo $ curl -H 'Content-Type: application/json'  http://vit-classifier.default/v1/models -s -D -
HTTP/1.1 200 OK
content-length: 27
content-type: application/json
date: Wed, 22 Nov 2023 17:40:49 GMT
server: envoy
x-envoy-upstream-service-time: 3
app-version: vit-classifier-1

{"models":["imagenet-vit"]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions