Skip to content

Commit

Permalink
Add KEDA support for seldon-core
Browse files Browse the repository at this point in the history
  • Loading branch information
anggao committed Oct 14, 2020
1 parent 645958e commit 980ebf2
Show file tree
Hide file tree
Showing 23 changed files with 13,648 additions and 5,190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ rules:
- get
- patch
- update
- apiGroups:
- keda.sh/v1alpha1
resources:
- ScaledObject
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- keda.sh/v1alpha1
resources:
- ScaledObject/status
verbs:
- get
- patch
- update
- apiGroups:
- machinelearning.seldon.io
resources:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ spec:
value: '{{ .Values.executor.requestLogger.defaultEndpoint }}'
- name: DEFAULT_USER_ID
value: '{{ .Values.defaultUserID }}'
- name: KEDA_ENABLED
value: '{{ .Values.keda.enabled }}'
image: '{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}'
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
name: manager
Expand Down
4 changes: 3 additions & 1 deletion helm-charts/seldon-core-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ istio:
enabled: false
gateway: istio-system/seldon-gateway
tlsMode: ""

# If you have KEDA installed you can use it for autoscaling
keda:
enabled: false
# ## Install with Cert Manager
# See installation page in documentation for more information
certManager:
Expand Down
2 changes: 1 addition & 1 deletion operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.13.2 as builder
FROM golang:1.14.9 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/hex"
"strconv"

kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1"
"github.com/seldonio/seldon-core/operator/constants"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta1"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -285,10 +286,26 @@ type Explainer struct {
}

type SeldonPodSpec struct {
Metadata metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Spec v1.PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
HpaSpec *SeldonHpaSpec `json:"hpaSpec,omitempty" protobuf:"bytes,3,opt,name=hpaSpec"`
Replicas *int32 `json:"replicas,omitempty" protobuf:"bytes,4,opt,name=replicas"`
Metadata metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Spec v1.PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
HpaSpec *SeldonHpaSpec `json:"hpaSpec,omitempty" protobuf:"bytes,3,opt,name=hpaSpec"`
Replicas *int32 `json:"replicas,omitempty" protobuf:"bytes,4,opt,name=replicas"`
KedaSpec *SeldonScaledObjectSpec `json:"kedaSpec,omitempty" protobuf:"bytes,5,opt,name=kedaSpec"`
}

// SeldonScaledObjectSpec is the spec for a KEDA ScaledObject resource
type SeldonScaledObjectSpec struct {
// +optional
PollingInterval *int32 `json:"pollingInterval,omitempty" protobuf:"int,1,opt,name=pollingInterval"`
// +optional
CooldownPeriod *int32 `json:"cooldownPeriod,omitempty" protobuf:"int,2,opt,name=cooldownPeriod"`
// +optional
MinReplicaCount *int32 `json:"minReplicaCount,omitempty" protobuf:"int,3,opt,name=minReplicaCount"`
// +optional
MaxReplicaCount *int32 `json:"maxReplicaCount,omitempty" protobuf:"int,4,opt,name=maxReplicaCount"`
// +optional
Advanced *kedav1alpha1.AdvancedConfig `json:"advanced,omitempty" protobuf:"bytes,5,opt,name=advanced"`
Triggers []kedav1alpha1.ScaleTriggers `json:"triggers" protobuf:"bytes,6,opt,name=triggers"`
}

type SeldonHpaSpec struct {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 980ebf2

Please sign in to comment.