serverless

package
v0.0.0-...-cc7cbc4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Progressing:
	// NewRSAvailableReason is added in a deployment when its newest replica set is made available
	// ie. the number of new pods that have passed readiness checks and run for at least minReadySeconds
	// is at least the minimum available pods that need to run for the deployment.
	NewRSAvailableReason = "NewReplicaSetAvailable"

	// Available:
	// MinimumReplicasAvailable is added in a deployment when it has its minimum replicas required available.
	MinimumReplicasAvailable   = "MinimumReplicasAvailable"
	MinimumReplicasUnavailable = "MinimumReplicasUnavailable"
)
View Source
const (
	FunctionSourceKey = "source"
	FunctionDepsKey   = "dependencies"
)
View Source
const HealthEvent = "" /* 324-byte string literal not displayed */

This const should be longer than 253 characters to avoid collisions with real k8s objects. https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names This event is artificial and it's only used to check if reconciliation loop didn't stop reconciling The event is not fully validated, that's why we can use invalid name.

Variables

This section is empty.

Functions

func IsHealthCheckRequest

func IsHealthCheckRequest(req ctrl.Request) bool

func NextRequeue

func NextRequeue(err error) (res ctrl.Result, errMsg string)

Types

type BuildConfig

type BuildConfig struct {
	ExecutorArgs        []string `envconfig:"default=--insecure;--skip-tls-verify;--skip-unused-stages;--log-format=text;--cache=true"`
	ExecutorImage       string   `envconfig:"default=gcr.io/kaniko-project/executor:v0.22.0"`
	RepoFetcherImage    string   `envconfig:"default=eu.gcr.io/kyma-project/function-build-init:305bee60"`
	MaxSimultaneousJobs int      `envconfig:"default=5"`
}

type DockerConfig

type DockerConfig struct {
	ActiveRegistryConfigSecretName string
	PushAddress                    string
	PullAddress                    string
}

type FunctionConfig

type FunctionConfig struct {
	PublisherProxyAddress                       string        `envconfig:"default=http://eventing-publisher-proxy.kyma-system.svc.cluster.local/publish"`
	ImageRegistryDefaultDockerConfigSecretName  string        `envconfig:"default=serverless-registry-config-default"`
	ImageRegistryExternalDockerConfigSecretName string        `envconfig:"default=serverless-registry-config"`
	PackageRegistryConfigSecretName             string        `envconfig:"default=serverless-package-registry-config"`
	ImagePullAccountName                        string        `envconfig:"default=serverless-function"`
	BuildServiceAccountName                     string        `envconfig:"default=serverless-build"`
	TargetCPUUtilizationPercentage              int32         `envconfig:"default=50"`
	RequeueDuration                             time.Duration `envconfig:"default=1m"`
	FunctionReadyRequeueDuration                time.Duration `envconfig:"default=5m"`
	GitFetchRequeueDuration                     time.Duration `envconfig:"default=30s"`
	Build                                       BuildConfig
}

type FunctionReconciler

type FunctionReconciler struct {
	Log logr.Logger
	// contains filtered or unexported fields
}

func NewFunction

func NewFunction(client resource.Client, log logr.Logger, config FunctionConfig, gitOperator GitOperator, recorder record.EventRecorder, healthCh chan bool) *FunctionReconciler

func (*FunctionReconciler) Reconcile

func (r *FunctionReconciler) Reconcile(request ctrl.Request) (ctrl.Result, error)

func (*FunctionReconciler) SetupWithManager

func (r *FunctionReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)

type GitOperator

type GitOperator interface {
	LastCommit(options git.Options) (string, error)
}

type HealthChecker

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

func NewHealthChecker

func NewHealthChecker(checkCh chan event.GenericEvent, returnCh chan bool, timeout time.Duration, logger *zap.Logger) HealthChecker

func (HealthChecker) Checker

func (h HealthChecker) Checker(req *http.Request) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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