This page was generated from notebooks/multiple_operators.ipynb.

Multiple Seldon Core Operators

This notebook illustrate how multiple Seldon Core Operators can share the same cluster. In particular:

  • A Namespaced Operator that only manages Seldon Deployments inside its namespace. Only needs Role RBAC and Namespace labeled with seldon.io/controller-id

  • A Clusterwide Operator that manges SeldonDeployment with a matching seldon.io/controller-id label.

  • A Clusterwide Operator that manages Seldon Deployments not handled by the above.

Setup Seldon Core

Use the setup notebook to Setup Cluster with Ambassador Ingress and Install Seldon Core. Instructions also online.

Namespaced Seldon Core Operator

[ ]:
!kubectl create namespace seldon-ns1
[ ]:
!kubectl label namespace seldon-ns1 seldon.io/controller-id=seldon-ns1
[ ]:
!helm install seldon-namespaced  ../helm-charts/seldon-core-operator  \
    --set singleNamespace=true \
    --set image.pullPolicy=IfNotPresent \
    --set usageMetrics.enabled=false \
    --set crd.create=false \
    --namespace seldon-ns1 \
    --wait
[ ]:
!kubectl rollout status deployment/seldon-controller-manager -n seldon-ns1
[ ]:
!kubectl create -f resources/model.yaml -n seldon-ns1
[ ]:
!kubectl rollout status deployment/seldon-model-example-0-classifier -n seldon-ns1
[ ]:
!kubectl get sdep -n seldon-ns1
[ ]:
NAME=!kubectl get sdep -n seldon-ns1 -o jsonpath='{.items[0].metadata.name}'
assert(NAME[0] == "seldon-model")
[ ]:
!kubectl config set-context $(kubectl config current-context) --namespace=seldon-ns1
[ ]:
!kubectl delete -f resources/model.yaml -n seldon-ns1
[ ]:
!helm delete seldon-namespaced

Label Focused Seldon Core Operator

  • We set crd.create=false as the CRD already exists in the cluster.

  • We set controllerId=seldon-id1. SeldonDeployments with this label will be managed.

[ ]:
!kubectl create namespace seldon-id1
[ ]:
!helm install seldon-controllerid  ../helm-charts/seldon-core-operator  \
    --set singleNamespace=false \
    --set image.pullPolicy=IfNotPresent \
    --set usageMetrics.enabled=false \
    --set crd.create=false \
    --set controllerId=seldon-id1 \
    --namespace seldon-id1 \
    --wait
[ ]:
!kubectl rollout status deployment/seldon-controller-manager -n seldon-id1
[ ]:
!pygmentize resources/model_controller_id.yaml
[ ]:
!kubectl create -f resources/model_controller_id.yaml -n default
[ ]:
!kubectl rollout status deployment/test-c1-example-0-classifier -n default
[ ]:
!kubectl get sdep -n default
[ ]:
NAME=!kubectl get sdep -n default -o jsonpath='{.items[0].metadata.name}'
assert(NAME[0] == "test-c1")
[ ]:
!kubectl config set-context $(kubectl config current-context) --namespace=seldon-id1
[ ]:
!kubectl delete -f resources/model_controller_id.yaml -n default
[ ]:
!helm delete seldon-controllerid