Skip to content

Commit

Permalink
Merge pull request #1570 from cliveseldon/1560_surface_errors
Browse files Browse the repository at this point in the history
Add Events and fix State for SeldonDeployments
  • Loading branch information
ukclivecox authored Mar 22, 2020
2 parents 367d234 + 2288189 commit 20ef400
Show file tree
Hide file tree
Showing 12 changed files with 672 additions and 181 deletions.
9 changes: 9 additions & 0 deletions doc/source/workflow/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ For a model with invalid json/yaml an example is shown below:
}
```
## Check all events on the SeldonDeployment
```bash
kubectl describe sdep mysdep
```
This will show each event from the operator including create, update, delete and error events.
## My Seldon Deployment remains in "creating" state
Check if the pods are running successfully.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ metadata:
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-role-{{ .Release.Namespace }}
rules:
- apiGroups:
- ''
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ''
resources:
Expand Down
11 changes: 10 additions & 1 deletion operator/apis/machinelearning/v1/seldondeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,18 @@ type ServiceStatus struct {
ExplainerFor string `json:"explainerFor,omitempty" protobuf:"string,4,opt,name=explainerFor"`
}

type StatusState string

// CRD Status values
const (
StatusStateAvailable StatusState = "Available"
StatusStateCreating StatusState = "Creating"
StatusStateFailed StatusState = "Failed"
)

// SeldonDeploymentStatus defines the observed state of SeldonDeployment
type SeldonDeploymentStatus struct {
State string `json:"state,omitempty" protobuf:"string,1,opt,name=state"`
State StatusState `json:"state,omitempty" protobuf:"string,1,opt,name=state"`
Description string `json:"description,omitempty" protobuf:"string,2,opt,name=description"`
DeploymentStatus map[string]DeploymentStatus `json:"deploymentStatus,omitempty" protobuf:"bytes,3,opt,name=deploymentStatus"`
ServiceStatus map[string]ServiceStatus `json:"serviceStatus,omitempty" protobuf:"bytes,4,opt,name=serviceStatus"`
Expand Down
7 changes: 7 additions & 0 deletions operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
Expand Down
23 changes: 23 additions & 0 deletions operator/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ const (

FirstPortNumber = 9000
)

const (
ControllerName = "seldon-controller-manager"
)

// Event messages
const (
EventsCreateVirtualService = "CreateVirtualService"
EventsUpdateVirtualService = "UpdateVirtualService"
EventsCreateDestinationRule = "CreateDestinationRule"
EventsUpdateDestinationRule = "UpdateDestinationRule"
EventsCreateService = "CreateService"
EventsUpdateService = "UpdateService"
EventsCreateHPA = "CreateHPA"
EventsUpdateHPA = "UpdateHPA"
EventsDeleteHPA = "DeleteHPA"
EventsCreateDeployment = "CreateDeployment"
EventsUpdateDeployment = "UpdateDeployment"
EventsDeleteDeployment = "DeleteDeployment"
EventsInternalError = "InternalError"
EventsUpdated = "Updated"
EventsUpdateFailed = "UpdateFailed"
)
Loading

0 comments on commit 20ef400

Please sign in to comment.