revision

package
v0.0.0-...-ea02baa Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const AutoscalerNamespace = "knative-serving-system"

AutoscalerNamespace needs to match the service account, which needs to be a single, known namespace. This ensures that projects created in non-default namespaces continue to work with autoscaling.

Variables

This section is empty.

Functions

func MakeElaAutoscalerDeployment

func MakeElaAutoscalerDeployment(rev *v1alpha1.Revision, autoscalerImage string) *appsv1.Deployment

MakeElaAutoscalerDeployment creates the deployment of the autoscaler for a particular revision.

func MakeElaAutoscalerService

func MakeElaAutoscalerService(rev *v1alpha1.Revision) *corev1.Service

MakeElaAutoscalerService returns a service for the autoscaler of the given revision.

func MakeElaDeployment

func MakeElaDeployment(u *v1alpha1.Revision, namespace string) *appsv1.Deployment

MakeElaDeployment creates a deployment.

func MakeElaPodSpec

func MakeElaPodSpec(
	rev *v1alpha1.Revision,
	controllerConfig *ControllerConfig) *corev1.PodSpec

MakeElaPodSpec creates a pod spec.

func MakeElaQueueContainer

func MakeElaQueueContainer(rev *v1alpha1.Revision, controllerConfig *ControllerConfig) *corev1.Container

MakeElaQueueContainer creates the container spec for queue sidecar.

func MakeElaResourceAnnotations

func MakeElaResourceAnnotations(revision *v1alpha1.Revision) map[string]string

MakeElaResourceAnnotations creates the annotations we will apply to child resource of the given revision.

func MakeElaResourceLabels

func MakeElaResourceLabels(revision *v1alpha1.Revision) map[string]string

MakeElaResourceLabels constructs the labels we will apply to K8s resources.

func MakeElaResourceSelector

func MakeElaResourceSelector(revision *v1alpha1.Revision) *metav1.LabelSelector

MakeElaResourceSelector constructs the Selector we will apply to K8s resources.

func MakeFluentdConfigMap

func MakeFluentdConfigMap(
	namespace string, fluentdSidecarOutputConfig string) *corev1.ConfigMap

MakeFluentdConfigMap creates a ConfigMap that gets mounted for fluentd container on the pod.

func MakeRevisionK8sService

func MakeRevisionK8sService(u *v1alpha1.Revision, ns string) *corev1.Service

MakeRevisionK8sService creates a Service that targets all pods with the same serving.RevisionLabelKey label. Traffic is routed to queue-proxy port.

func NewController

func NewController(
	kubeClientSet kubernetes.Interface,
	elaClientSet clientset.Interface,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
	elaInformerFactory informers.SharedInformerFactory,
	buildInformerFactory buildinformers.SharedInformerFactory,
	config *rest.Config,
	controllerConfig *ControllerConfig,
	logger *zap.SugaredLogger) controller.Interface

NewController initializes the controller and is called by the generated code Registers eventhandlers to enqueue events config - client configuration for talking to the apiserver si - informer factory shared across all controllers for listening to events and indexing resource properties queue - message queue for handling new events. unique to this controller.

Types

type Controller

type Controller struct {
	*controller.Base
	// contains filtered or unexported fields
}

Controller implements the controller for Revision resources. +controller:group=ela,version=v1alpha1,kind=Revision,resource=revisions

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type ControllerConfig

type ControllerConfig struct {

	// see (config-autoscaler.yaml)
	AutoscaleConcurrencyQuantumOfTime *k8sflag.DurationFlag
	AutoscaleEnableSingleConcurrency  *k8sflag.BoolFlag

	// AutoscalerImage is the name of the image used for the autoscaler pod.
	AutoscalerImage string

	// QueueSidecarImage is the name of the image used for the queue sidecar
	// injected into the revision pod
	QueueSidecarImage string

	// EnableVarLogCollection dedicates whether to set up a fluentd sidecar to
	// collect logs under /var/log/.
	EnableVarLogCollection bool

	// TODO(#818): Use the fluentd deamon set to collect /var/log.
	// FluentdSidecarImage is the name of the image used for the fluentd sidecar
	// injected into the revision pod. It is used only when enableVarLogCollection
	// is true.
	FluentdSidecarImage string
	// FluentdSidecarOutputConfig is the config for fluentd sidecar to specify
	// logging output destination.
	FluentdSidecarOutputConfig string

	// LoggingURLTemplate is a string containing the logging url template where
	// the variable REVISION_UID will be replaced with the created revision's UID.
	LoggingURLTemplate string

	// QueueProxyLoggingConfig is a string containing the logger configuration for queue proxy.
	QueueProxyLoggingConfig string

	// QueueProxyLoggingLevel is a string containing the logger level for queue proxy.
	QueueProxyLoggingLevel string
}

ControllerConfig includes the configurations for the controller.

Jump to

Keyboard shortcuts

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