Documentation ¶
Index ¶
- Constants
- Variables
- func IsHealthCheckRequest(req ctrl.Request) bool
- func IsNotFunctionStatusUpdate(log *zap.SugaredLogger) func(event.UpdateEvent) bool
- func NextRequeue(err error) (res ctrl.Result, errMsg string)
- type BuildConfig
- type BuildJobResourceConfig
- type DockerConfig
- type FunctionConfig
- type FunctionReconciler
- type FunctionResourceConfig
- type GitClient
- type GitClientFactory
- type HealthChecker
- type Preset
- type Quantity
- type Resource
- type ResourceConfig
- type Resources
- type RuntimePresets
- type StatsCollector
- type SystemState
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" )
View Source
const ( FunctionSourceKey = "source" FunctionDepsKey = "dependencies" )
View Source
const DefaultDeploymentReplicas int32 = 1
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 ¶
View Source
var ( // ErrBuildReconcilerFailed is returned if it is impossible to create reconciler build function ErrBuildReconcilerFailed = errors.New("build reconciler failed") )
Functions ¶
func IsHealthCheckRequest ¶
func IsNotFunctionStatusUpdate ¶
func IsNotFunctionStatusUpdate(log *zap.SugaredLogger) func(event.UpdateEvent) bool
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=europe-docker.pkg.dev/kyma-project/prod/function-build-init:v20230426-37b02524"` MaxSimultaneousJobs int `envconfig:"default=5"` }
type BuildJobResourceConfig ¶
type BuildJobResourceConfig struct {
Resources Resources `yaml:"resources"`
}
type DockerConfig ¶
type FunctionConfig ¶
type FunctionConfig struct { PublisherProxyAddress string `envconfig:"optional"` TraceCollectorEndpoint string `envconfig:"optional"` 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"` TargetCPUUtilizationPercentage int32 `envconfig:"default=50"` RequeueDuration time.Duration `envconfig:"default=1m"` FunctionReadyRequeueDuration time.Duration `envconfig:"default=5m"` GitFetchRequeueDuration time.Duration `envconfig:"default=30s"` ResourceConfig ResourceConfig `envconfig:"optional"` Build BuildConfig }
type FunctionReconciler ¶
type FunctionReconciler struct { Log *zap.SugaredLogger // contains filtered or unexported fields }
func NewFunctionReconciler ¶
func NewFunctionReconciler(client resource.Client, log *zap.SugaredLogger, config FunctionConfig, gitFactory GitClientFactory, recorder record.EventRecorder, statsCollector StatsCollector, healthCh chan bool) *FunctionReconciler
func (*FunctionReconciler) SetupWithManager ¶
func (r *FunctionReconciler) SetupWithManager(mgr ctrl.Manager) (controller.Controller, error)
type FunctionResourceConfig ¶
type FunctionResourceConfig struct {
Resources Resources `yaml:"resources"`
}
type GitClientFactory ¶
type GitClientFactory interface {
GetGitClient(logger *zap.SugaredLogger) git.GitClient
}
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
func NewHealthChecker ¶
func NewHealthChecker(timeout time.Duration, logger *zap.SugaredLogger) (HealthChecker, chan event.GenericEvent, chan bool)
type Preset ¶
func (Preset) ToResourceRequirements ¶
func (p Preset) ToResourceRequirements() map[string]v1.ResourceRequirements
type Quantity ¶
func (*Quantity) UnmarshalYAML ¶
type ResourceConfig ¶
type ResourceConfig struct { Function FunctionResourceConfig `yaml:"function"` BuildJob BuildJobResourceConfig `yaml:"buildJob"` }
func (*ResourceConfig) Unmarshal ¶
func (rc *ResourceConfig) Unmarshal(input string) error
type Resources ¶
type Resources struct { Presets Preset `yaml:"presets"` RuntimePresets RuntimePresets `yaml:"runtimePresets"` DefaultPreset string `yaml:"defaultPreset"` MinRequestedCPU Quantity `yaml:"minRequestedCPU"` MinRequestedMemory Quantity `yaml:"minRequestedMemory"` }
type RuntimePresets ¶
type StatsCollector ¶
type StatsCollector interface {
UpdateReconcileStats(f *serverlessv1alpha2.Function, cond serverlessv1alpha2.Condition)
}
type SystemState ¶
type SystemState interface{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.