activator

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

The Activator Network Configurations

Traffic configuration overview

An ingress object is created per Route to direct external traffic to reach desired revisions. This ingress object has annotations "istio" so Istio is the ingress controller which fulfills the ingress. The ingress uses domain based routing to map the requests to the placeholder service. The placeholder service is then mapped to Istio routerules which control traffic across revisions and the activator service.

The picture below shows traffic configuration for a route "abc-route".

traffic

Istio Route Rules Configurations

Knative Serving Route objects control traffic split via Istio route rules. When a revision is in Reserve state due to inactivity, instead of letting the revision get traffic assignment directly, Route defines route rules such that the activator gets the portion of traffic for the revision. Below are detailed description for three cases.

All revisions are active

When all revisions are active, the activator service does not get any traffic. Below is an example where the route (my-service) has two traffic targets, Revision a and Revision b, and both revisions are active. Note activator does not serve traffic.

active revision

One revision is in Reserve state

When one revision is in Reserve state, the activator services gets its traffic assignment. Below is an example where Revision a is active and Revision b is in Reserve. In this case, the Activator gets traffic assignment for Revision b. Upon receiving requests, Activator activates Revision b and forwards requests to Revision b after it is ready. After the revision is activated and ready to serve traffic, the Revision b gets assigned portion of traffic directly.

reserve revision

Multiple revisions are in Reserve state

When there are two or more revisions are in Reserve state, the Activator service gets traffic for all Reserve revisions. Among Reserve revisions, Activator activates the revision with the largest traffic weight, and forwards traffic to it. There is room for improvement for this behavior (#882). After the revision is activated and ready to serve traffic, activator gets the portion of traffic for all the rest Reserve revisions.

Documentation

Overview

Copyright 2018 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// The name of the activator service.
	K8sServiceName = "activator-service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activator

type Activator interface {
	ActiveEndpoint(namespace, name string) (Endpoint, Status, error)
	Shutdown()
}

Activator provides an active endpoint for a revision or an error and status code indicating why it could not.

func NewDedupingActivator

func NewDedupingActivator(a Activator) Activator

NewDedupingActivator creates an Activator that deduplicates activations requests for the same revision id and namespace.

func NewRevisionActivator

func NewRevisionActivator(kubeClient kubernetes.Interface, servingClient clientset.Interface, logger *zap.SugaredLogger) Activator

NewRevisionActivator creates an Activator that changes revision serving status to active if necessary, then returns the endpoint once the revision is ready to serve traffic.

type Endpoint

type Endpoint struct {
	FQDN string
	Port int32
}

Endpoint is a fully-qualified domain name / port pair for an active revision.

type Status

type Status int

Status is an HTTP status code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL