Autoscaling Example
Prerequisites
The cluster should have
metric-serverrunning in thekube-systemnamespaceFor Kind install
../../testing/scripts/metrics.yamlSee https://github.com/kubernetes-sigs/kind/issues/398For Minikube run:
minikube addons enable metrics-server
Setup Seldon Core
Use the setup notebook to Setup Cluster with Ambassador Ingress and Install Seldon Core. Instructions also online.
!kubectl create namespace seldonError from server (AlreadyExists): namespaces "seldon" already exists!kubectl config set-context $(kubectl config current-context) --namespace=seldonContext "kind-ansible" modified.Create model with v2beta1 autoscaler
To create a model with an HorizontalPodAutoscaler there are three steps:
Ensure you have a resource request for the metric you want to scale on if it is a standard metric such as cpu or memory, e.g.:
resources:
requests:
cpu: '0.5'
Add an v2beta1 HPA Spec referring to this Deployment, e.g.:
The full SeldonDeployment spec is shown below.
Create Load
We label some nodes for the loadtester. We attempt the first two as for Kind the first node shown will be the master.
After a few mins you should see the deployment my-dep scaled to 3 deployments
Create model with v2 autoscaler
To create a model with an HorizontalPodAutoscaler there are three steps:
Ensure you have a resource request for the metric you want to scale on if it is a standard metric such as cpu or memory, e.g.:
Add an v2beta1 HPA Spec referring to this Deployment, e.g.:
The full SeldonDeployment spec is shown below.
Create Load
We label some nodes for the loadtester. We attempt the first two as for Kind the first node shown will be the master.
After a few mins you should see the deployment my-dep scaled to 3 deployments
Last updated
Was this helpful?