Documentation
¶
Overview ¶
Copyright 2021 IBM Corporation
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
- func ConfigWatchHandler(configMapName types.NamespacedName, f func() []reconcile.Request, ...) handler.EventHandler
- func SetConfigForTest(cp *ConfigProvider, cfg *Config)
- type Config
- type ConfigProvider
- type EnvVar
- type EnvVarList
- type ImageConfig
- type PrometheusConfig
- type RESTProxyConfig
- type ResourceQuantities
- type ResourceRequirements
- type ScaleToZeroConfig
- type TLSConfig
Constants ¶
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 (*Config) GetEtcdSecretName ¶
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 EnvVarList ¶
type EnvVarList []EnvVar
func (EnvVarList) ToKubernetesType ¶
func (evl EnvVarList) ToKubernetesType() []corev1.EnvVar
type ImageConfig ¶
func (ImageConfig) TaggedImage ¶
func (m ImageConfig) TaggedImage() string
type PrometheusConfig ¶
type RESTProxyConfig ¶
type RESTProxyConfig struct {
Enabled bool
Port uint16
Image ImageConfig
Resources ResourceRequirements
}
type ResourceQuantities ¶
type ResourceRequirements ¶
type ResourceRequirements struct {
Requests ResourceQuantities
Limits ResourceQuantities
// contains filtered or unexported fields
}
func (ResourceRequirements) ToKubernetesType ¶
func (rr ResourceRequirements) ToKubernetesType() *corev1.ResourceRequirements