Documentation ¶
Index ¶
- Constants
- func ConcurrencyFromAnnotations(k8sObj kmeta.Object) (int, int, error)
- func EndpointFromAnnotation(k8sObj kmeta.Object) (string, error)
- func GetContainerNames(containers []*Container) strset.Set
- func IdentifyAPI(filePath string, name string, kind Kind, index int) string
- func KindStrings() []string
- func LogLevelTypes() []string
- func ToZapLogLevel(logLevel LogLevel) zapcore.Level
- func TrafficSplitterTargetsFromAnnotations(k8sObj kmeta.Object) (int32, error)
- type API
- type Autoscaling
- type Compute
- type Container
- type ExecHandler
- type HTTPGetHandler
- type Kind
- type LogLevel
- type Networking
- type Pod
- type PreStop
- type Probe
- type Resource
- type TCPSocketHandler
- type TrafficSplit
- type UpdateStrategy
Constants ¶
View Source
const ( // API NameKey = "name" KindKey = "kind" NetworkingKey = "networking" ComputeKey = "compute" AutoscalingKey = "autoscaling" UpdateStrategyKey = "update_strategy" // TrafficSplitter APIsKey = "apis" WeightKey = "weight" ShadowKey = "shadow" // Pod PodKey = "pod" NodeGroupsKey = "node_groups" PortKey = "port" MaxConcurrencyKey = "max_concurrency" MaxQueueLengthKey = "max_queue_length" ContainersKey = "containers" // Containers ContainerNameKey = "name" ImageKey = "image" EnvKey = "env" CommandKey = "command" ArgsKey = "args" ReadinessProbeKey = "readiness_probe" LivenessProbeKey = "liveness_probe" PreStopKey = "pre_stop" // Probe HTTPGetKey = "http_get" TCPSocketKey = "tcp_socket" ExecKey = "exec" InitialDelaySecondsKey = "initial_delay_seconds" TimeoutSecondsKey = "timeout_seconds" PeriodSecondsKey = "period_seconds" SuccessThresholdKey = "success_threshold" FailureThresholdKey = "failure_threshold" // Probe types PathKey = "path" // Compute CPUKey = "cpu" MemKey = "mem" GPUKey = "gpu" InfKey = "inf" ShmKey = "shm" // Networking EndpointKey = "endpoint" // Autoscaling MinReplicasKey = "min_replicas" MaxReplicasKey = "max_replicas" InitReplicasKey = "init_replicas" TargetInFlightKey = "target_in_flight" WindowKey = "window" DownscaleStabilizationPeriodKey = "downscale_stabilization_period" UpscaleStabilizationPeriodKey = "upscale_stabilization_period" MaxDownscaleFactorKey = "max_downscale_factor" MaxUpscaleFactorKey = "max_upscale_factor" DownscaleToleranceKey = "downscale_tolerance" UpscaleToleranceKey = "upscale_tolerance" // UpdateStrategy MaxSurgeKey = "max_surge" // K8s annotation EndpointAnnotationKey = "networking.cortex.dev/endpoint" MaxConcurrencyAnnotationKey = "pod.cortex.dev/max-concurrency" MaxQueueLengthAnnotationKey = "pod.cortex.dev/max-queue-length" NumTrafficSplitterTargetsAnnotationKey = "apis.cortex.dev/traffic-splitter-targets" MinReplicasAnnotationKey = "autoscaling.cortex.dev/min-replicas" MaxReplicasAnnotationKey = "autoscaling.cortex.dev/max-replicas" TargetInFlightAnnotationKey = "autoscaling.cortex.dev/target-in-flight" WindowAnnotationKey = "autoscaling.cortex.dev/window" DownscaleStabilizationPeriodAnnotationKey = "autoscaling.cortex.dev/downscale-stabilization-period" UpscaleStabilizationPeriodAnnotationKey = "autoscaling.cortex.dev/upscale-stabilization-period" MaxDownscaleFactorAnnotationKey = "autoscaling.cortex.dev/max-downscale-factor" MaxUpscaleFactorAnnotationKey = "autoscaling.cortex.dev/max-upscale-factor" DownscaleToleranceAnnotationKey = "autoscaling.cortex.dev/downscale-tolerance" UpscaleToleranceAnnotationKey = "autoscaling.cortex.dev/upscale-tolerance" )
Variables ¶
This section is empty.
Functions ¶
func ConcurrencyFromAnnotations ¶ added in v0.40.0
func EndpointFromAnnotation ¶ added in v0.40.0
func GetContainerNames ¶ added in v0.36.0
func KindStrings ¶ added in v0.19.0
func KindStrings() []string
func LogLevelTypes ¶ added in v0.26.0
func LogLevelTypes() []string
func ToZapLogLevel ¶ added in v0.27.0
Types ¶
type API ¶
type API struct { Resource Pod *Pod `json:"pod" yaml:"pod"` NodeGroups []string `json:"node_groups" yaml:"node_groups"` APIs []*TrafficSplit `json:"apis" yaml:"apis"` Networking *Networking `json:"networking" yaml:"networking"` Autoscaling *Autoscaling `json:"autoscaling" yaml:"autoscaling"` UpdateStrategy *UpdateStrategy `json:"update_strategy" yaml:"update_strategy"` Index int `json:"index" yaml:"-"` FileName string `json:"file_name" yaml:"-"` SubmittedAPISpec interface{} `json:"submitted_api_spec" yaml:"submitted_api_spec"` }
func (*API) TelemetryEvent ¶ added in v0.23.0
func (*API) ToK8sAnnotations ¶ added in v0.18.0
InitReplicas was left out deliberately
type Autoscaling ¶ added in v0.14.0
type Autoscaling struct { MinReplicas int32 `json:"min_replicas" yaml:"min_replicas"` MaxReplicas int32 `json:"max_replicas" yaml:"max_replicas"` InitReplicas int32 `json:"init_replicas" yaml:"init_replicas"` TargetInFlight *float64 `json:"target_in_flight" yaml:"target_in_flight"` Window time.Duration `json:"window" yaml:"window"` DownscaleStabilizationPeriod time.Duration `json:"downscale_stabilization_period" yaml:"downscale_stabilization_period"` UpscaleStabilizationPeriod time.Duration `json:"upscale_stabilization_period" yaml:"upscale_stabilization_period"` MaxDownscaleFactor float64 `json:"max_downscale_factor" yaml:"max_downscale_factor"` MaxUpscaleFactor float64 `json:"max_upscale_factor" yaml:"max_upscale_factor"` DownscaleTolerance float64 `json:"downscale_tolerance" yaml:"downscale_tolerance"` UpscaleTolerance float64 `json:"upscale_tolerance" yaml:"upscale_tolerance"` }
func AutoscalingFromAnnotations ¶ added in v0.14.0
func AutoscalingFromAnnotations(k8sObj kmeta.Object) (*Autoscaling, error)
func (*Autoscaling) UserStr ¶ added in v0.14.0
func (autoscaling *Autoscaling) UserStr() string
type Compute ¶
type Compute struct { CPU *k8s.Quantity `json:"cpu" yaml:"cpu"` Mem *k8s.Quantity `json:"mem" yaml:"mem"` GPU int64 `json:"gpu" yaml:"gpu"` Inf int64 `json:"inf" yaml:"inf"` Shm *k8s.Quantity `json:"shm" yaml:"shm"` }
func GetPodComputeRequest ¶ added in v0.37.0
func ZeroCompute ¶ added in v0.19.0
func ZeroCompute() Compute
type Container ¶ added in v0.36.0
type Container struct { Name string `json:"name" yaml:"name"` Image string `json:"image" yaml:"image"` Env map[string]string `json:"env" yaml:"env"` Command []string `json:"command" yaml:"command"` Args []string `json:"args" yaml:"args"` ReadinessProbe *Probe `json:"readiness_probe" yaml:"readiness_probe"` LivenessProbe *Probe `json:"liveness_probe" yaml:"liveness_probe"` PreStop *PreStop `json:"pre_stop" yaml:"pre_stop"` Compute *Compute `json:"compute" yaml:"compute"` }
type ExecHandler ¶ added in v0.41.0
type ExecHandler struct {
Command []string `json:"command" yaml:"command"`
}
func (*ExecHandler) UserStr ¶ added in v0.41.0
func (execHandler *ExecHandler) UserStr() string
type HTTPGetHandler ¶ added in v0.41.0
type HTTPGetHandler struct { Path string `json:"path" yaml:"path"` Port int32 `json:"port" yaml:"port"` }
func (*HTTPGetHandler) UserStr ¶ added in v0.41.0
func (httpHandler *HTTPGetHandler) UserStr() string
type Kind ¶ added in v0.19.0
type Kind int
func KindFromString ¶ added in v0.19.0
func (Kind) MarshalBinary ¶ added in v0.19.0
MarshalBinary satisfies BinaryMarshaler
func (Kind) MarshalText ¶ added in v0.19.0
MarshalText satisfies TextMarshaler
func (*Kind) UnmarshalBinary ¶ added in v0.19.0
UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack
func (*Kind) UnmarshalText ¶ added in v0.19.0
UnmarshalText satisfies TextUnmarshaler
type LogLevel ¶ added in v0.26.0
type LogLevel int
func LogLevelFromString ¶ added in v0.26.0
func (LogLevel) MarshalBinary ¶ added in v0.26.0
MarshalBinary satisfies BinaryMarshaler
func (LogLevel) MarshalText ¶ added in v0.26.0
MarshalText satisfies TextMarshaler
func (*LogLevel) UnmarshalBinary ¶ added in v0.26.0
UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack
func (*LogLevel) UnmarshalText ¶ added in v0.26.0
UnmarshalText satisfies TextUnmarshaler
type Networking ¶ added in v0.18.0
type Networking struct {
Endpoint *string `json:"endpoint" yaml:"endpoint"`
}
func (*Networking) UserStr ¶ added in v0.18.0
func (networking *Networking) UserStr() string
type Pod ¶ added in v0.36.0
type PreStop ¶ added in v0.41.0
type PreStop struct { HTTPGet *HTTPGetHandler `json:"http_get" yaml:"http_get"` Exec *ExecHandler `json:"exec" yaml:"exec"` }
type Probe ¶ added in v0.36.0
type Probe struct { HTTPGet *HTTPGetHandler `json:"http_get" yaml:"http_get"` TCPSocket *TCPSocketHandler `json:"tcp_socket" yaml:"tcp_socket"` Exec *ExecHandler `json:"exec" yaml:"exec"` InitialDelaySeconds int32 `json:"initial_delay_seconds" yaml:"initial_delay_seconds"` TimeoutSeconds int32 `json:"timeout_seconds" yaml:"timeout_seconds"` PeriodSeconds int32 `json:"period_seconds" yaml:"period_seconds"` SuccessThreshold int32 `json:"success_threshold" yaml:"success_threshold"` FailureThreshold int32 `json:"failure_threshold" yaml:"failure_threshold"` }
type Resource ¶ added in v0.19.0
func (Resource) UserString ¶ added in v0.19.0
type TCPSocketHandler ¶ added in v0.41.0
type TCPSocketHandler struct {
Port int32 `json:"port" yaml:"port"`
}
func (*TCPSocketHandler) UserStr ¶ added in v0.41.0
func (tcpSocketHandler *TCPSocketHandler) UserStr() string
type TrafficSplit ¶ added in v0.19.0
type TrafficSplit struct { Name string `json:"name" yaml:"name"` Weight int32 `json:"weight" yaml:"weight"` Shadow bool `json:"shadow" yaml:"shadow"` }
func (*TrafficSplit) UserStr ¶ added in v0.19.0
func (trafficSplit *TrafficSplit) UserStr() string
type UpdateStrategy ¶ added in v0.14.0
type UpdateStrategy struct { MaxSurge string `json:"max_surge" yaml:"max_surge"` }
func (*UpdateStrategy) UserStr ¶ added in v0.14.0
func (updateStrategy *UpdateStrategy) UserStr() string
Click to show internal directories.
Click to hide internal directories.