config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EnvEtcdSecretName     = "ETCD_SECRET_NAME"
	DefaultEtcdSecretName = "model-serving-etcd"

	ConfigType        = "yaml"
	MountLocation     = "/etc/model-serving/config/default"
	ViperKeyDelimiter = "::"
)

Variables

This section is empty.

Functions

func ConfigWatchHandler

func ConfigWatchHandler(configMapName types.NamespacedName, f func() []reconcile.Request,
	cp *ConfigProvider, kclient *client.Client) handler.EventHandler

Handler used by controllers which depend on the user configuration

func SetConfigForTest

func SetConfigForTest(cp *ConfigProvider, cfg *Config)

SetConfigForTest is only for tests

Types

type Config

type Config struct {
	// System config
	EtcdSecretName    string // DEPRECATED - should be removed in the future
	ModelMeshEndpoint string // For dev use only
	AllowAnyPVC       bool

	// Service config
	InferenceServiceName    string
	InferenceServicePort    uint16
	TLS                     TLSConfig
	HeadlessService         bool
	GrpcMaxMessageSizeBytes int

	// Runtimes config
	ModelMeshImage         ImageConfig
	ModelMeshResources     ResourceRequirements
	RESTProxy              RESTProxyConfig
	StorageHelperImage     ImageConfig
	StorageHelperResources ResourceRequirements
	PodsPerRuntime         uint16
	StorageSecretName      string
	EnableAccessLogging    bool
	BuiltInServerTypes     []string
	PayloadProcessors      []string

	ServiceAccountName string

	Metrics     PrometheusConfig
	ScaleToZero ScaleToZeroConfig

	RuntimePodLabels      map[string]string
	RuntimePodAnnotations map[string]string

	ImagePullSecrets []corev1.LocalObjectReference

	// For internal use only
	InternalModelMeshEnvVars EnvVarList
}

Config holds process global configuration information

func NewMergedConfigFromConfigMap

func NewMergedConfigFromConfigMap(m corev1.ConfigMap) (*Config, error)

func NewMergedConfigFromString

func NewMergedConfigFromString(configYaml string) (*Config, error)

func (*Config) GetEtcdSecretName

func (c *Config) GetEtcdSecretName() string

type ConfigProvider

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

ConfigProvider provides immutable snapshots of current config

func NewConfigProvider

func NewConfigProvider(ctx context.Context, cl client.Client, name types.NamespacedName) (*ConfigProvider, error)

func NewConfigProviderForTest

func NewConfigProviderForTest() *ConfigProvider

NewConfigProviderForTest is only for tests

func (*ConfigProvider) AwaitReload

func (cp *ConfigProvider) AwaitReload()

func (*ConfigProvider) GetConfig

func (cp *ConfigProvider) GetConfig() *Config

func (*ConfigProvider) IsReloading

func (cp *ConfigProvider) IsReloading() bool

func (*ConfigProvider) ReloadConfigMap

func (cp *ConfigProvider) ReloadConfigMap(ctx context.Context, c client.Client, name types.NamespacedName) error

type EnvVar

type EnvVar struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type EnvVarList

type EnvVarList []EnvVar

func (EnvVarList) ToKubernetesType

func (evl EnvVarList) ToKubernetesType() []corev1.EnvVar

type ImageConfig

type ImageConfig struct {
	Name    string
	Tag     string
	Digest  string
	Command []string
}

func (ImageConfig) TaggedImage

func (m ImageConfig) TaggedImage() string

type PrometheusConfig

type PrometheusConfig struct {
	Enabled                          bool
	Port                             uint16
	Scheme                           string
	DisablePrometheusOperatorSupport bool
}

type RESTProxyConfig

type RESTProxyConfig struct {
	Enabled   bool
	Port      uint16
	Image     ImageConfig
	Resources ResourceRequirements
}

type ResourceQuantities

type ResourceQuantities struct {
	CPU    string
	Memory string
}

type ResourceRequirements

type ResourceRequirements struct {
	Requests ResourceQuantities
	Limits   ResourceQuantities
	// contains filtered or unexported fields
}

func (ResourceRequirements) ToKubernetesType

func (rr ResourceRequirements) ToKubernetesType() *corev1.ResourceRequirements

type ScaleToZeroConfig

type ScaleToZeroConfig struct {
	Enabled bool
	// how long to wait after the last predictor assigned to a runtime is deleted
	// before scaling to zero
	GracePeriodSeconds uint16
}

type TLSConfig

type TLSConfig struct {
	// TLS disabled if omitted
	SecretName string
	// Mutual TLS disabled if omitted
	ClientAuth string
}

Jump to

Keyboard shortcuts

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