/area API
/kind feature
Currently Service object has two fields runLatest and pinned [1]. They control how service manages associated Route object:
runLatest: service will make sure route points to the latest ready revision
pinned: service will make sure route points to a particular revision
As a side effect, if a user is using Service object to manage Configuration and Route objects, there is no way to do traffic splitting, because if route is reconfigured, service controller will just reconcile it based on two above configurations. (To do traffic splitting, user would actually have to stop using service object and managed configuration and route objects directly.)
Proposed change:
type Service struct {
Spec ServiceSpec
}
type ServiceSpec struct {
Configuration ConfigurationSpec
}
^ removes runLatest and pinned types from Service.Spec
// part of Route spec
type TrafficTarget struct {
Name string
RevisionName string
ConfigurationName string
Percent int
}
^ TrafficTarget (and Route) does not change, as it already supports running latest ready revision of particular Configuration object (via ConfigurationName) or pointing to particular revision (via RevisionName) (pins traffic to particular revision).
Few cases:
- user wants service to point to latest ready revision (everything stays as is since it's the default route configuration created by the service); as new revisions are made route automatically picks up new ready revision
- user wants configure service to route traffic to two revisions; user would create a service, then configure route to point to two revisions with appropriate weights, service controller will not reconfigure it
Benefits:
- moves towards use of Service object, instead of having two ways (via Service and with Configuration+Route)
- removes somewhat confusing fields from Service (
runLatest and pinned) and some ambiguity
- can do traffic splitting with a Service object
- abides by routing configuration on the Route object
[1]
|
// RunLatest defines a simple Service. It will automatically |
|
// configure a route that keeps the latest ready revision |
|
// from the supplied configuration running. |
|
// +optional |
|
RunLatest *RunLatestType `json:"runLatest,omitempty"` |
|
|
|
// Pins this service to a specific revision name. The revision must |
|
// be owned by the configuration provided. |
|
// +optional |
|
Pinned *PinnedType `json:"pinned,omitempty"` |
/area API
/kind feature
Currently Service object has two fields
runLatestandpinned[1]. They control how service manages associated Route object:runLatest: service will make sure route points to the latest ready revisionpinned: service will make sure route points to a particular revisionAs a side effect, if a user is using Service object to manage Configuration and Route objects, there is no way to do traffic splitting, because if route is reconfigured, service controller will just reconcile it based on two above configurations. (To do traffic splitting, user would actually have to stop using service object and managed configuration and route objects directly.)
Proposed change:
^ removes runLatest and pinned types from Service.Spec
^ TrafficTarget (and Route) does not change, as it already supports running latest ready revision of particular Configuration object (via
ConfigurationName) or pointing to particular revision (viaRevisionName) (pins traffic to particular revision).Few cases:
Benefits:
runLatestandpinned) and some ambiguity[1]
serving/pkg/apis/serving/v1alpha1/service_types.go
Lines 72 to 81 in b1d14bd