Seldon Core Installation on Kubernetes (OpenShift)

  • Kubernetes cluster ≥ 1.12. For Openshift it requires version 4.2 or higher
  • Installer method: Helm ≥ 3.0
  • Ingress: Istio & Ambassador

Installation Steps

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
  1. Download the Istio release
curl -L https://istio.io/downloadIstio | sh -
cd istio-1.10.2
export PATH=$PWD/bin:$PATH
ls
$ oc adm policy add-scc-to-group anyuid system:serviceaccounts:istio-system
$ istioctl install --set profile=openshift
  1. Create namespaces for Seldon
$ kubectl create namespace seldon
$ kubectl create namespace seldon-system
$ oc adm policy add-scc-to-group anyuid system:serviceaccounts:seldon-system$ oc adm policy add-scc-to-group anyuid system:serviceaccounts:seldon
kubectl config set-context $(kubectl config current-context) --namespace=seldon
helm install seldon-core seldon-core-operator \
--repo https://storage.googleapis.com/seldon-charts \
--set ambassador.enabled=true \
--set istio.enabled=true \
--set usageMetrics.enabled=true \
--namespace seldon-system
kubectl get deployment -n seldon-system
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: seldon-gateway
namespace: istio-system
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
kubectl create -f seldon-gateway.yaml
kubectl rollout status deploy/seldon-controller-manager -n seldon-system
  1. Add HELM repo for Ambassador
helm repo add datawire https://www.getambassador.io
helm repo update
helm install ambassador datawire/ambassador \
--set image.repository=quay.io/datawire/ambassador \
--set enableAES=false \
--set crds.keep=false \
--namespace seldon
kubectl rollout status deployment.apps/ambassador -n seldon
kubectl get deployments -n seldon
kubectl get deployments -n seldon-system
kubectl get pods -n seldon-system
kubectl get pods -n seldon
kubectl get pods -n istio-system
kubectl port-forward $(kubectl get pods -n seldon -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n seldon 8003:8080
  1. Define the configuration of the SeldonDeployment, which will orchestrate the serving of your model. Here, we are taking an example of “Scikitlearn IRIS” ML model deployment.
apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
name: seldon-deployment-example
spec:
name: sklearn-iris-deployment
predictors:
- componentSpecs:
- spec:
containers:
- image: seldonio/sklearn-iris:0.1
imagePullPolicy: IfNotPresent
name: sklearn-iris-classifier
graph:
children: []
endpoint:
type: REST
name: sklearn-iris-classifier
type: MODEL
name: sklearn-iris-predictor
replicas: 1
kubectl create -f sklearn_iris_deployment.yaml
  • End-to-end deployment of Seldon Core
  • Deployment of Ingress like Istio and Ambassador
  • Deployment of ScikitLearn ML model in Seldon Core
  • Finally, testing the model

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store