poolmgr

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Overview

Copyright 2021 The Fission 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.

Index

Constants

View Source
const (
	GET_POOL requestType = iota
	CLEANUP_POOL
)

Variables

This section is empty.

Functions

func FunctionEventHandlers added in v1.15.0

func FunctionEventHandlers(logger *zap.Logger, kubernetesClient kubernetes.Interface, fissionfnNamespace string, istioEnabled bool) k8sCache.ResourceEventHandlerFuncs

FunctionEventHandlers provides handlers for function resource events. Based on function create/update/delete event, we create role binding for the secret/configmap access which is used by fetcher component. If istio is enabled, we create a service for the function.

func IsIPv6

func IsIPv6(podIP string) bool

IsIPv6 validates if the podIP follows to IPv6 protocol

func IsPodActive added in v1.15.0

func IsPodActive(p *v1.Pod) bool

func MakeGenericPoolManager

func MakeGenericPoolManager(
	logger *zap.Logger,
	fissionClient versioned.Interface,
	kubernetesClient kubernetes.Interface,
	metricsClient metricsclient.Interface,
	functionNamespace string,
	fetcherConfig *fetcherConfig.Config,
	instanceID string,
	funcInformer finformerv1.FunctionInformer,
	pkgInformer finformerv1.PackageInformer,
	envInformer finformerv1.EnvironmentInformer,
	podInformer coreinformers.PodInformer,
	rsInformer appsinformers.ReplicaSetInformer,
	podSpecPatch *apiv1.PodSpec,
) (executortype.ExecutorType, error)

func PackageEventHandlers added in v1.15.0

func PackageEventHandlers(logger *zap.Logger, kubernetesClient kubernetes.Interface, fissionfnNamespace string) k8sCache.ResourceEventHandlerFuncs

PackageEventHandlers provides handlers for package events. Based on package create/update event, we create role binding for the package which is used by fetcher component.

Types

type GenericPool

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

GenericPool represents a generic environment pool

func MakeGenericPool

func MakeGenericPool(
	logger *zap.Logger,
	fissionClient versioned.Interface,
	kubernetesClient kubernetes.Interface,
	metricsClient metricsclient.Interface,
	env *fv1.Environment,
	namespace string,
	functionNamespace string,
	fsCache *fscache.FunctionServiceCache,
	fetcherConfig *fetcherConfig.Config,
	instanceID string,
	enableIstio bool,
	podSpecPatch *apiv1.PodSpec) *GenericPool

MakeGenericPool returns an instance of GenericPool

type GenericPoolManager

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

func (*GenericPoolManager) AdoptExistingResources

func (gpm *GenericPoolManager) AdoptExistingResources(ctx context.Context)

func (*GenericPoolManager) CleanupOldExecutorObjects

func (gpm *GenericPoolManager) CleanupOldExecutorObjects(ctx context.Context)

func (*GenericPoolManager) DeleteFuncSvcFromCache

func (gpm *GenericPoolManager) DeleteFuncSvcFromCache(ctx context.Context, fsvc *fscache.FuncSvc)

func (*GenericPoolManager) GetFuncSvc

func (gpm *GenericPoolManager) GetFuncSvc(ctx context.Context, fn *fv1.Function) (*fscache.FuncSvc, error)

func (*GenericPoolManager) GetFuncSvcFromCache

func (gpm *GenericPoolManager) GetFuncSvcFromCache(ctx context.Context, fn *fv1.Function) (*fscache.FuncSvc, error)

func (*GenericPoolManager) GetFuncSvcFromPoolCache added in v1.13.0

func (gpm *GenericPoolManager) GetFuncSvcFromPoolCache(ctx context.Context, fn *fv1.Function, requestsPerPod int) (*fscache.FuncSvc, int, error)

func (*GenericPoolManager) GetTypeName

func (gpm *GenericPoolManager) GetTypeName(ctx context.Context) fv1.ExecutorType

func (*GenericPoolManager) IsValid

func (gpm *GenericPoolManager) IsValid(ctx context.Context, fsvc *fscache.FuncSvc) bool

IsValid checks if pod is not deleted and that it has the address passed as the argument. Also checks that all the containers in it are reporting a ready status for the healthCheck.

func (*GenericPoolManager) NoActiveConnectionEventChecker added in v1.13.0

func (gpm *GenericPoolManager) NoActiveConnectionEventChecker(kubeClient kubernetes.Interface)

NoActiveConnectionEventChecker checks if the pod has emitted an inactive event

func (*GenericPoolManager) RefreshFuncPods

func (gpm *GenericPoolManager) RefreshFuncPods(ctx context.Context, logger *zap.Logger, f fv1.Function) error

func (*GenericPoolManager) Run

func (gpm *GenericPoolManager) Run(ctx context.Context)

func (*GenericPoolManager) TapService

func (gpm *GenericPoolManager) TapService(ctx context.Context, svcHost string) error

func (*GenericPoolManager) UnTapService added in v1.11.0

func (gpm *GenericPoolManager) UnTapService(ctx context.Context, key string, svcHost string)

func (*GenericPoolManager) WebsocketStartEventChecker added in v1.13.0

func (gpm *GenericPoolManager) WebsocketStartEventChecker(kubeClient kubernetes.Interface)

WebsocketStartEventChecker checks if the pod has emitted a websocket connection start event

type PoolPodController added in v1.15.0

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

func NewPoolPodController added in v1.15.0

func NewPoolPodController(logger *zap.Logger,
	kubernetesClient kubernetes.Interface,
	namespace string,
	enableIstio bool,
	funcInformer finformerv1.FunctionInformer,
	pkgInformer finformerv1.PackageInformer,
	envInformer finformerv1.EnvironmentInformer,
	rsInformer appsinformers.ReplicaSetInformer,
	podInformer coreinformers.PodInformer) *PoolPodController

func (*PoolPodController) InjectGpm added in v1.15.0

func (p *PoolPodController) InjectGpm(gpm *GenericPoolManager)

func (*PoolPodController) Run added in v1.15.0

func (p *PoolPodController) Run(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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