githubEdit

Disruption Budgets Example

Prerequisites

  • A kubernetes cluster with kubectl configured

  • pygmentize

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

Create model with Pod Disruption Budget

To create a model with a Pod Disruption Budget, it is first important to understand how you would like your application to respond to voluntary disruptionsarrow-up-right. Depending on the type of disruption budgeting your application needs, you will either define either of the following:

  • minAvailable which is a description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. minAvailable can be either an absolute number or a percentage.

  • maxUnavailable which is a description of the number of pods from that set that can be unavailable after the eviction. It can be either an absolute number or a percentage.

The full SeldonDeployment spec is shown below.

!pygmentize model_with_pdb.yaml
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
  name: seldon-model
spec:
  name: test-deployment
  replicas: 2
  predictors:
  - componentSpecs:
    - pdbSpec:
        maxUnavailable: 2
      spec:
        containers:
        - image: seldonio/mock_classifier_rest:1.3
          imagePullPolicy: IfNotPresent
          name: classifier
          resources:
            requests:
              cpu: '0.5'
        terminationGracePeriodSeconds: 1
    graph:
      children: []
      endpoint:
        type: REST
      name: classifier
      type: MODEL
    name: example

Validate Disruption Budget Configuration

Update Disruption Budget and Validate Change

Next, we'll update the maximum number of unavailable pods and check that the PDB is properly updated to match.

Clean Up

Last updated

Was this helpful?