pod

package
v0.13.0-rc0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright 2021 The KServe 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 (
	GkeAcceleratorNodeSelector = "cloud.google.com/gke-accelerator"
	NvidiaGPUTaintValue        = "present"
)

These constants are used for detecting and applying GPU selectors

View Source
const (
	LoggerConfigMapKeyName         = "logger"
	LoggerArgumentLogUrl           = "--log-url"
	LoggerArgumentSourceUri        = "--source-uri"
	LoggerArgumentMode             = "--log-mode"
	LoggerArgumentInferenceService = "--inference-service"
	LoggerArgumentNamespace        = "--namespace"
	LoggerArgumentEndpoint         = "--endpoint"
	LoggerArgumentComponent        = "--component"
)
View Source
const (
	BatcherContainerName        = "batcher"
	BatcherConfigMapKeyName     = "batcher"
	BatcherEnableFlag           = "--enable-batcher"
	BatcherArgumentMaxBatchSize = "--max-batchsize"
	BatcherArgumentMaxLatency   = "--max-latency"
)
View Source
const (
	StorageInitializerContainerName         = "storage-initializer"
	StorageInitializerConfigMapKeyName      = "storageInitializer"
	StorageInitializerVolumeName            = "kserve-provision-location"
	StorageInitializerContainerImage        = "kserve/storage-initializer"
	StorageInitializerContainerImageVersion = "latest"
	PvcURIPrefix                            = "pvc://"
	OciURIPrefix                            = "oci://"
	PvcSourceMountName                      = "kserve-pvc-source"
	PvcSourceMountPath                      = "/mnt/pvc"
	CaBundleVolumeName                      = "cabundle-cert"
	ModelcarContainerName                   = "modelcar"
	ModelInitModeEnv                        = "MODEL_INIT_MODE"
	CpuModelcarDefault                      = "10m"
	MemoryModelcarDefault                   = "15Mi"
)
View Source
const (
	MetricsAggregatorConfigMapKeyName = "metricsAggregator"
)

Variables

This section is empty.

Functions

func GetContainerSpecForStorageUri added in v0.11.1

func GetContainerSpecForStorageUri(storageUri string, client client.Client) (*v1.Container, error)

func InjectGKEAcceleratorSelector

func InjectGKEAcceleratorSelector(pod *v1.Pod) error

Types

type AgentConfig added in v0.7.0

type AgentConfig struct {
	Image         string `json:"image"`
	CpuRequest    string `json:"cpuRequest"`
	CpuLimit      string `json:"cpuLimit"`
	MemoryRequest string `json:"memoryRequest"`
	MemoryLimit   string `json:"memoryLimit"`
}

type AgentInjector added in v0.7.0

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

func (*AgentInjector) InjectAgent added in v0.7.0

func (ag *AgentInjector) InjectAgent(pod *v1.Pod) error

type BatcherConfig added in v0.7.0

type BatcherConfig struct {
	Image         string `json:"image"`
	CpuRequest    string `json:"cpuRequest"`
	CpuLimit      string `json:"cpuLimit"`
	MemoryRequest string `json:"memoryRequest"`
	MemoryLimit   string `json:"memoryLimit"`
	MaxBatchSize  string `json:"maxBatchSize"`
	MaxLatency    string `json:"maxLatency"`
}

type BatcherInjector added in v0.7.0

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

func (*BatcherInjector) InjectBatcher added in v0.7.0

func (il *BatcherInjector) InjectBatcher(pod *v1.Pod) error

type LoggerConfig

type LoggerConfig struct {
	Image         string `json:"image"`
	CpuRequest    string `json:"cpuRequest"`
	CpuLimit      string `json:"cpuLimit"`
	MemoryRequest string `json:"memoryRequest"`
	MemoryLimit   string `json:"memoryLimit"`
	DefaultUrl    string `json:"defaultUrl"`
}

type MetricsAggregator added in v0.10.0

type MetricsAggregator struct {
	EnableMetricAggregation  string `json:"enableMetricAggregation"`
	EnablePrometheusScraping string `json:"enablePrometheusScraping"`
}

func (*MetricsAggregator) InjectMetricsAggregator added in v0.10.0

func (ma *MetricsAggregator) InjectMetricsAggregator(pod *v1.Pod) error

InjectMetricsAggregator looks for the annotations to enable aggregate kserve-container and queue-proxy metrics and if specified, sets port-related EnvVars in queue-proxy and the aggregate prometheus annotation.

type Mutator

type Mutator struct {
	Client    client.Client
	Clientset kubernetes.Interface
	Decoder   *admission.Decoder
}

Mutator is a webhook that injects incoming pods

func (*Mutator) Handle

func (mutator *Mutator) Handle(ctx context.Context, req admission.Request) admission.Response

Handle decodes the incoming Pod and executes mutation logic.

type StorageInitializerConfig

type StorageInitializerConfig struct {
	Image                      string `json:"image"`
	CpuRequest                 string `json:"cpuRequest"`
	CpuLimit                   string `json:"cpuLimit"`
	CpuModelcar                string `json:"cpuModelcar"`
	MemoryRequest              string `json:"memoryRequest"`
	MemoryLimit                string `json:"memoryLimit"`
	CaBundleConfigMapName      string `json:"caBundleConfigMapName"`
	CaBundleVolumeMountPath    string `json:"caBundleVolumeMountPath"`
	MemoryModelcar             string `json:"memoryModelcar"`
	EnableDirectPvcVolumeMount bool   `json:"enableDirectPvcVolumeMount"`
	EnableOciImageSource       bool   `json:"enableModelcar"`
	UidModelcar                *int64 `json:"uidModelcar"`
}

type StorageInitializerInjector

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

func (*StorageInitializerInjector) InjectModelcar added in v0.12.0

func (mi *StorageInitializerInjector) InjectModelcar(pod *v1.Pod) error

InjectModelcar injects a sidecar with the full model included to the Pod. This so called "modelcar" is then directly accessed from the user container via the proc filesystem (possible when `shareProcessNamespace` is enabled in the Pod spec). This method is idempotent so can be called multiple times like it happens when the webhook is configured with `reinvocationPolicy: IfNeeded`

func (*StorageInitializerInjector) InjectStorageInitializer

func (mi *StorageInitializerInjector) InjectStorageInitializer(pod *v1.Pod) error

InjectStorageInitializer injects an init container to provision model data for the serving container in a unified way across storage tech by injecting a provisioning INIT container. This is a work around because KNative does not support INIT containers: https://github.com/knative/serving/issues/4307

func (*StorageInitializerInjector) SetIstioCniSecurityContext added in v0.12.0

func (mi *StorageInitializerInjector) SetIstioCniSecurityContext(pod *v1.Pod) error

SetIstioCniSecurityContext determines if Istio is installed in using the CNI plugin. If so, the UserID of the storage initializer is changed to match the UserID of the Istio sidecar. This is to ensure that the storage initializer can access the network.

Jump to

Keyboard shortcuts

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