controller

package
v0.0.0-...-82e8bd7 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelMinReplicas = "com.openfaas.scale.min"
	// SuccessSynced is used as part of the Event 'reason' when a Function is synced
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a Function fails
	// to sync due to a Deployment of the same name already existing.
	ErrResourceExists = "ErrResourceExists"

	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a Deployment already existing
	MessageResourceExists = "Resource %q already exists and is not managed by OpenFaaS"
	// MessageResourceSynced is the message used for an Event fired when a Function
	// is synced successfully
	MessageResourceSynced = "Function synced successfully"
)

Variables

This section is empty.

Functions

func UpdateSecrets

func UpdateSecrets(function *faasv1.Function, deployment *appsv1.Deployment, existingSecrets map[string]*corev1.Secret) error

UpdateSecrets will update the Deployment spec to include secrets that have been deployed in the kubernetes cluster. For each requested secret, we inspect the type and add it to the deployment spec as appropriate: secrets with type `SecretTypeDockercfg` are added as ImagePullSecrets all other secrets are mounted as files in the deployments containers.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the controller implementation for Function resources

func NewController

func NewController(
	kubeclientset kubernetes.Interface,
	faasclientset clientset.Interface,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
	faasInformerFactory informers.SharedInformerFactory,
	factory FunctionFactory) *Controller

NewController returns a new OpenFaaS controller

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 FunctionFactory

type FunctionFactory struct {
	Factory k8s.FunctionFactory
}

FunctionFactory wraps faas-netes factory

func NewFunctionFactory

func NewFunctionFactory(clientset kubernetes.Interface, config k8s.DeploymentConfig) FunctionFactory

func (*FunctionFactory) ApplyProfile

func (f *FunctionFactory) ApplyProfile(profile k8s.Profile, deployment *appsv1.Deployment)

func (*FunctionFactory) ConfigureContainerUserID

func (f *FunctionFactory) ConfigureContainerUserID(deployment *appsv1.Deployment)

func (*FunctionFactory) ConfigureReadOnlyRootFilesystem

func (f *FunctionFactory) ConfigureReadOnlyRootFilesystem(function *faasv1.Function, deployment *appsv1.Deployment)

func (*FunctionFactory) GetProfiles

func (f *FunctionFactory) GetProfiles(ctx context.Context, namespace string, annotations map[string]string) ([]k8s.Profile, error)

func (*FunctionFactory) GetProfilesToRemove

func (f *FunctionFactory) GetProfilesToRemove(ctx context.Context, namespace string, annotations, currentAnnotations map[string]string) ([]k8s.Profile, error)

func (*FunctionFactory) MakeProbes

func (f *FunctionFactory) MakeProbes(function *faasv1.Function) (*k8s.FunctionProbes, error)

func (*FunctionFactory) RemoveProfile

func (f *FunctionFactory) RemoveProfile(profile k8s.Profile, deployment *appsv1.Deployment)

Jump to

Keyboard shortcuts

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