Documentation
¶
Index ¶
- Constants
- func AutoScaleMetricsModeIsValid(autoScaleMode AutoScaleMetricsMode) bool
- type AutoScale
- type AutoScaleMetricsMode
- type Config
- func (c *Config) DisableSensitiveFieldMasking()
- func (c *Config) EnableSensitiveFieldMasking()
- func (c *Config) EnrichFunctionContainerResources(ctx context.Context, logger logger.Logger, resources *v1.ResourceRequirements)
- func (c *Config) EnrichSupplementaryContainerResources(ctx context.Context, logger logger.Logger, resources *v1.ResourceRequirements)
- func (c *Config) GetDefaultFunctionInvocationTimeout() time.Duration
- func (c *Config) GetDefaultFunctionReadinessTimeout() time.Duration
- func (c *Config) GetDefaultSupportedAutoScaleMetrics() []functionconfig.AutoScaleMetric
- func (c *Config) GetDefaultWindowSizePresets() []string
- func (c *Config) GetFunctionLoggerSinks(functionConfig *functionconfig.Config) (map[string]LoggerSinkWithLevel, error)
- func (c *Config) GetFunctionMetricSinks() (map[string]MetricSink, error)
- func (c *Config) GetFunctionReadinessTimeoutOrDefault(functionReadinessTimeoutSeconds int) int
- func (c *Config) GetSystemLoggerSinks() (map[string]LoggerSinkWithLevel, error)
- func (c *Config) GetSystemMetricSinks() (map[string]MetricSink, error)
- type CronTriggerCreationMode
- type ImageRegistryOverridesConfig
- type IngressConfig
- type Kubernetes
- type LabelSelectorAndConfig
- type Logger
- type LoggerSink
- type LoggerSinkBinding
- type LoggerSinkKind
- type LoggerSinkWithLevel
- type MetricSink
- type Metrics
- type PlatformKubeConfig
- type PlatformLocalConfig
- type PodResourceRequirements
- type PreemptibleNodes
- func (p *PreemptibleNodes) CompileAffinityByLabelSelector(operation corev1.NodeSelectorOperator) []corev1.NodeSelectorRequirement
- func (p *PreemptibleNodes) CompileAffinityByLabelSelectorScheduleOnOneOfMatchingNodes() []corev1.NodeSelectorTerm
- func (p *PreemptibleNodes) CompileAntiAffinityByLabelSelectorNoScheduleOnMatchingNodes() []corev1.NodeSelectorTerm
- type ProjectsLeader
- type ProjectsLeaderKind
- type Reader
- type ResourceRequirements
- type ScaleToZero
- type ScaleToZeroMode
- type SensitiveFieldPath
- type SensitiveFieldsConfig
- type StreamMonitoringConfig
- type WebServer
Constants ¶
const ( DefaultFunctionReadinessTimeoutSeconds = 120 DefaultFunctionInvocationTimeoutSeconds = 60 )
const ( DefaultStreamMonitoringWebapiURL = "http://v3io-webapi:8081" DefaultV3ioRequestConcurrency = 64 DefaultHTTPIngressClassName = "nginx" )
Variables ¶
This section is empty.
Functions ¶
func AutoScaleMetricsModeIsValid ¶
func AutoScaleMetricsModeIsValid(autoScaleMode AutoScaleMetricsMode) bool
Types ¶
type AutoScaleMetricsMode ¶
type AutoScaleMetricsMode string
const ( // AutoScaleMetricsModeLegacy is the legacy mode, where CPU usage is used for scaling AutoScaleMetricsModeLegacy AutoScaleMetricsMode = "legacy" // AutoScaleMetricsModeCustom uses custom metrics for scaling AutoScaleMetricsModeCustom AutoScaleMetricsMode = "custom" )
type Config ¶
type Config struct {
Kind string `json:"kind,omitempty"`
WebAdmin WebServer `json:"webAdmin,omitempty"`
HealthCheck WebServer `json:"healthCheck,omitempty"`
Logger Logger `json:"logger,omitempty"`
Metrics Metrics `json:"metrics,omitempty"`
ScaleToZero ScaleToZero `json:"scaleToZero,omitempty"`
AutoScale AutoScale `json:"autoScale,omitempty"`
SupportedAutoScaleMetrics []functionconfig.AutoScaleMetric `json:"supportedAutoScaleMetrics,omitempty"`
AutoScaleMetricsMode AutoScaleMetricsMode `json:"autoScaleMetricsMode,omitempty"`
CronTriggerCreationMode CronTriggerCreationMode `json:"cronTriggerCreationMode,omitempty"`
FunctionAugmentedConfigs []LabelSelectorAndConfig `json:"functionAugmentedConfigs,omitempty"`
FunctionReadinessTimeout *string `json:"functionReadinessTimeout,omitempty"`
FunctionInvocationTimeout *string `json:"functionInvocationTimeout,omitempty"`
IngressConfig IngressConfig `json:"ingressConfig,omitempty"`
Kube PlatformKubeConfig `json:"kube,omitempty"`
Local PlatformLocalConfig `json:"local,omitempty"`
ImageRegistryOverrides ImageRegistryOverridesConfig `json:"imageRegistryOverrides,omitempty"`
Runtime *runtimeconfig.Config `json:"runtime,omitempty"`
ProjectsLeader *ProjectsLeader `json:"projectsLeader,omitempty"`
ManagedNamespaces []string `json:"managedNamespaces,omitempty"`
IguazioSessionCookie string `json:"iguazioSessionCookie,omitempty"`
Opa opa.Config `json:"opa,omitempty"`
StreamMonitoring StreamMonitoringConfig `json:"streamMonitoring,omitempty"`
SensitiveFields SensitiveFieldsConfig `json:"sensitiveFields,omitempty"`
DisableDefaultHTTPTrigger bool `json:"disableDefaultHTTPTrigger,omitempty"`
ContainerBuilderConfiguration *containerimagebuilderpusher.ContainerBuilderConfiguration `json:"containerBuilderConfiguration,omitempty"`
// contains filtered or unexported fields
}
func NewPlatformConfig ¶
func (*Config) DisableSensitiveFieldMasking ¶
func (c *Config) DisableSensitiveFieldMasking()
func (*Config) EnableSensitiveFieldMasking ¶
func (c *Config) EnableSensitiveFieldMasking()
func (*Config) EnrichFunctionContainerResources ¶
func (c *Config) EnrichFunctionContainerResources(ctx context.Context, logger logger.Logger, resources *v1.ResourceRequirements)
EnrichFunctionContainerResources enriches the function container's requests and limits with the default resources defined in the platform config, only if they are not already configured
func (*Config) EnrichSupplementaryContainerResources ¶
func (c *Config) EnrichSupplementaryContainerResources(ctx context.Context, logger logger.Logger, resources *v1.ResourceRequirements)
EnrichSupplementaryContainerResources enriches the sidecar/init container's requests and limits with the default resources defined in the platform config, only if they are not already configured
func (*Config) GetDefaultFunctionInvocationTimeout ¶
func (*Config) GetDefaultFunctionReadinessTimeout ¶
func (*Config) GetDefaultSupportedAutoScaleMetrics ¶
func (c *Config) GetDefaultSupportedAutoScaleMetrics() []functionconfig.AutoScaleMetric
func (*Config) GetDefaultWindowSizePresets ¶
func (*Config) GetFunctionLoggerSinks ¶
func (c *Config) GetFunctionLoggerSinks(functionConfig *functionconfig.Config) (map[string]LoggerSinkWithLevel, error)
func (*Config) GetFunctionMetricSinks ¶
func (c *Config) GetFunctionMetricSinks() (map[string]MetricSink, error)
func (*Config) GetFunctionReadinessTimeoutOrDefault ¶
func (*Config) GetSystemLoggerSinks ¶
func (c *Config) GetSystemLoggerSinks() (map[string]LoggerSinkWithLevel, error)
func (*Config) GetSystemMetricSinks ¶
func (c *Config) GetSystemMetricSinks() (map[string]MetricSink, error)
type CronTriggerCreationMode ¶
type CronTriggerCreationMode string
const ( ProcessorCronTriggerCreationMode CronTriggerCreationMode = "processor" KubeCronTriggerCreationMode CronTriggerCreationMode = "kube" DefaultServiceType = corev1.ServiceTypeClusterIP )
type IngressConfig ¶
type IngressConfig struct {
EnableSSLRedirect bool `json:"enableSSLRedirect,omitempty"`
TLSSecret string `json:"tlsSecret,omitempty"`
IguazioAuthURL string `json:"iguazioAuthURL,omitempty"`
IguazioSignInURL string `json:"iguazioSignInURL,omitempty"`
AllowedAuthenticationModes []string `json:"allowedAuthenticationModes,omitempty"`
Oauth2ProxyURL string `json:"oauth2ProxyURL,omitempty"`
}
IngressConfig holds the default values for created ingresses
type Kubernetes ¶
type Kubernetes struct {
Deployment *appsv1.Deployment `json:"deployment,omitempty"`
}
type LabelSelectorAndConfig ¶
type LabelSelectorAndConfig struct {
LabelSelector machinarymetav1.LabelSelector `json:"labelSelector,omitempty"`
FunctionConfig functionconfig.Config `json:"functionConfig,omitempty"`
Kubernetes Kubernetes `json:"kubernetes,omitempty"`
}
type Logger ¶
type Logger struct {
Sinks map[string]LoggerSink `json:"sinks,omitempty"`
System []LoggerSinkBinding `json:"system,omitempty"`
Functions []LoggerSinkBinding `json:"functions,omitempty"`
}
type LoggerSink ¶
type LoggerSink struct {
Kind LoggerSinkKind `json:"kind,omitempty"`
URL string `json:"url,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
}
type LoggerSinkBinding ¶
type LoggerSinkKind ¶
type LoggerSinkKind string
const ( LoggerSinkKindStdout LoggerSinkKind = "stdout" LoggerSinkKindAppInsights LoggerSinkKind = "appinsights" // LoggerSinkKindElasticsearch is not supported LoggerSinkKindElasticsearch LoggerSinkKind = "elasticsearch" )
type LoggerSinkWithLevel ¶
type LoggerSinkWithLevel struct {
Level string
Sink LoggerSink
// contains filtered or unexported fields
}
func (*LoggerSinkWithLevel) GetRedactingLogger ¶
func (l *LoggerSinkWithLevel) GetRedactingLogger() *nucliozap.Redactor
type MetricSink ¶
type Metrics ¶
type Metrics struct {
Sinks map[string]MetricSink `json:"sinks,omitempty"`
System []string `json:"system,omitempty"`
Functions []string `json:"functions,omitempty"`
}
type PlatformKubeConfig ¶
type PlatformKubeConfig struct {
KubeConfigPath string `json:"kubeConfigPath,omitempty"`
// TODO: Move IngressConfig here
DefaultServiceType corev1.ServiceType `json:"defaultServiceType,omitempty"`
DefaultFunctionNodeSelector map[string]string `json:"defaultFunctionNodeSelector,omitempty"`
DefaultHTTPIngressHostTemplate string `json:"defaultHTTPIngressHostTemplate,omitempty"`
DefaultHTTPIngressAnnotations map[string]string `json:"defaultHTTPIngressAnnotations,omitempty"`
DefaultHTTPIngressClassName string `json:"defaultHTTPIngressClassName,omitempty"`
DefaultFunctionPriorityClassName string `json:"defaultFunctionPriorityClassName,omitempty"`
DefaultFunctionServiceAccount string `json:"defaultFunctionServiceAccount,omitempty"`
ValidFunctionPriorityClassNames []string `json:"validFunctionPriorityClassNames,omitempty"`
DefaultFunctionPodResources PodResourceRequirements `json:"defaultFunctionPodResources,omitempty"`
DefaultSidecarResources PodResourceRequirements `json:"defaultSidecarResources,omitempty"`
DefaultFunctionTolerations []corev1.Toleration `json:"defaultFunctionTolerations,omitempty"`
PreemptibleNodes *PreemptibleNodes `json:"preemptibleNodes,omitempty"`
}
type PlatformLocalConfig ¶
type PlatformLocalConfig struct {
FunctionContainersHealthinessEnabled bool `json:"functionContainersHealthinessEnabled"`
FunctionContainersHealthinessTimeout time.Duration `json:"functionContainersHealthinessTimeout,omitempty"`
FunctionContainersHealthinessInterval time.Duration `json:"functionContainersHealthinessInterval,omitempty"`
DefaultFunctionContainerNetworkName string `json:"defaultFunctionContainerNetworkName,omitempty"`
DefaultFunctionRestartPolicy *dockerclient.RestartPolicy `json:"defaultFunctionRestartPolicy,omitempty"`
DefaultFunctionVolumes []functionconfig.Volume `json:"defaultFunctionVolumes,omitempty"`
}
type PodResourceRequirements ¶
type PodResourceRequirements struct {
Requests ResourceRequirements `json:"requests,omitempty"`
Limits ResourceRequirements `json:"limits,omitempty"`
}
type PreemptibleNodes ¶
type PreemptibleNodes struct {
DefaultMode functionconfig.RunOnPreemptibleNodeMode `json:"defaultMode,omitempty"`
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
GPUTolerations []corev1.Toleration `json:"gpuTolerations,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}
PreemptibleNodes Holds data needed when user decided to run his function pods on a preemptible node (aka Spot node)
func (*PreemptibleNodes) CompileAffinityByLabelSelector ¶
func (p *PreemptibleNodes) CompileAffinityByLabelSelector( operation corev1.NodeSelectorOperator) []corev1.NodeSelectorRequirement
CompileAffinityByLabelSelector compiles affinity spec based on pre-configured node selector
func (*PreemptibleNodes) CompileAffinityByLabelSelectorScheduleOnOneOfMatchingNodes ¶
func (p *PreemptibleNodes) CompileAffinityByLabelSelectorScheduleOnOneOfMatchingNodes() []corev1.NodeSelectorTerm
CompileAffinityByLabelSelectorScheduleOnOneOfMatchingNodes schedule on a node having at least one of the node selectors (ORed)
func (*PreemptibleNodes) CompileAntiAffinityByLabelSelectorNoScheduleOnMatchingNodes ¶
func (p *PreemptibleNodes) CompileAntiAffinityByLabelSelectorNoScheduleOnMatchingNodes() []corev1.NodeSelectorTerm
type ProjectsLeader ¶
type ProjectsLeader struct {
Kind ProjectsLeaderKind `json:"kind,omitempty"`
APIAddress string `json:"apiAddress,omitempty"`
SynchronizationInterval string `json:"synchronizationInterval,omitempty"`
}
type ProjectsLeaderKind ¶
type ProjectsLeaderKind string
const ( ProjectsLeaderKindIguazio ProjectsLeaderKind = "iguazio" ProjectsLeaderKindMlrun ProjectsLeaderKind = "mlrun" ProjectsLeaderKindMock ProjectsLeaderKind = "mock" )
type ResourceRequirements ¶
type ScaleToZero ¶
type ScaleToZero struct {
Mode ScaleToZeroMode `json:"mode,omitempty"`
ScalerInterval string `json:"scalerInterval,omitempty"`
ResourceReadinessTimeout string `json:"resourceReadinessTimeout,omitempty"`
ScaleResources []functionconfig.ScaleResource `json:"scaleResources,omitempty"`
InactivityWindowPresets []string `json:"inactivityWindowPresets,omitempty"`
// Used to enrich special scale-to-zero ingress annotations
HTTPTriggerIngressAnnotations map[string]string `json:"httpTriggerIngressAnnotations,omitempty"`
// Used for DLX options, selects in which way to send invocation when multiple targets are given:
// random, primary or canary.
MultiTargetStrategy scalertypes.MultiTargetStrategy `json:"multiTargetStrategy,omitempty"`
}
type ScaleToZeroMode ¶
type ScaleToZeroMode string
const ( EnabledScaleToZeroMode ScaleToZeroMode = "enabled" DisabledScaleToZeroMode ScaleToZeroMode = "disabled" )
type SensitiveFieldPath ¶
type SensitiveFieldPath string
type SensitiveFieldsConfig ¶
type SensitiveFieldsConfig struct {
// CustomSensitiveFields is a list of fields that should be masked in logs and function config
MaskSensitiveFields bool `json:"maskSensitiveFields,omitempty"`
CustomSensitiveFields []string `json:"customSensitiveFields,omitempty"`
SensitiveFieldsRegex []*regexp.Regexp `json:"sensitiveFieldsRegex,omitempty"`
}
func (*SensitiveFieldsConfig) CompileSensitiveFieldsRegex ¶
func (sfc *SensitiveFieldsConfig) CompileSensitiveFieldsRegex() []*regexp.Regexp
func (*SensitiveFieldsConfig) GetDefaultSensitiveFields ¶
func (sfc *SensitiveFieldsConfig) GetDefaultSensitiveFields() []string
func (*SensitiveFieldsConfig) GetSensitiveFields ¶
func (sfc *SensitiveFieldsConfig) GetSensitiveFields() []string