githubEdit

Ambassador Headers

This notebook shows how you can deploy Seldon Deployments which can have custom routing via Ambassador's custom header routing.

Setup Seldon Core

Use the setup notebook to Setup Clusterarrow-up-right with Ambassador Ingressarrow-up-right.

!kubectl create namespace seldon
Error from server (AlreadyExists): namespaces "seldon" already exists
from IPython.core.magic import register_line_cell_magic


@register_line_cell_magic
def writetemplate(line, cell):
    with open(line, "w") as f:
        f.write(cell.format(**globals()))
VERSION = !cat ../../../version.txt
VERSION = VERSION[0]
VERSION
'1.19.0-dev'

Launch main model

We will create a very simple Seldon Deployment with a dummy model image seldonio/mock_classifier. This deployment is named example.

Get predictions

REST Request

Launch Model with Custom Routing

To make it a canary of the original example deployment we add two annotations

The first annotation says we want to route traffic that has the header location:london. The second says we want to use example as our service endpoint rather than the default which would be our deployment name - in this case example-canary. This will ensure that this Ambassador setting will apply to the same prefix as the previous one.

Check a request without a header goes to the existing model.

Check a REST request with the required header gets routed to the new model.

Last updated

Was this helpful?