config

package
v0.0.0-...-82207cb Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

TODO: describe package here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaults

func SetDefaults(config *OperatorConfig)

func SetExampleStatefulServiceConfigMap

func SetExampleStatefulServiceConfigMap(configMap *corev1.ConfigMap)

Initializes a ConfigMap with the example configuration comment.

Types

type CassandraConfig

type CassandraConfig struct {
	Image string   `yaml:"image" env:"CASSANDRA_IMAGE"`
	Args  []string `yaml:"args"`
}

type GCPConfig

type GCPConfig struct {
	Project string `yaml:"project" env:"GCP_PROJECT"`
	Network string `yaml:"network" env:"GCP_NETWORK"`
}

type InMemoryConfig

type InMemoryConfig struct {
	Image string   `yaml:"image" env:"IN_MEMORY_IMAGE"`
	Args  []string `yaml:"args"`
}

type NoStoreConfig

type NoStoreConfig struct {
	Image string   `yaml:"image" env:"NO_STORE_IMAGE"`
	Args  []string `yaml:"args"`
}

type OperatorConfig

type OperatorConfig struct {
	Configs        map[string]*yaml.Node `yaml:",inline"`
	NoStore        NoStoreConfig         `yaml:"noStore"`
	InMemory       InMemoryConfig        `yaml:"inMemory"`
	Cassandra      CassandraConfig       `yaml:"cassandra"`
	Postgres       PostgresConfig        `yaml:"postgres"`
	Spanner        SpannerConfig         `yaml:"spanner"`
	GCP            GCPConfig             `yaml:"gcp"`
	SidecarMetrics SidecarMetricsConfig  `yaml:"sidecarMetrics"`
}

func ReadConfig

func ReadConfig(path string) (*OperatorConfig, error)

func (*OperatorConfig) Get

func (c *OperatorConfig) Get(key string, obj interface{}) error

type PostgresConfig

type PostgresConfig struct {
	Image string   `yaml:"image" env:"POSTGRES_IMAGE"`
	Args  []string `yaml:"args"`

	GoogleCloudSQL PostgresGoogleCloudSQLConfig `yaml:"googleCloudSql"`
}

type PostgresGoogleCloudSQLConfig

type PostgresGoogleCloudSQLConfig struct {
	Enabled bool `yaml:"enabled" env:"POSTGRES_GOOGLE_CLOUD_SQL_ENABLED"`

	// This is the DB type and version as used by GCP.  Must start with "POSTGRES_" to ensure we get a Postgres DB.
	TypeVersion   string `yaml:"typeVersion" env:"POSTGRES_GOOGLE_CLOUD_SQL_TYPE_VERSION" env-description:"DB descriptor for GCP"`
	Region        string `yaml:"region" env:"POSTGRES_GOOGLE_CLOUD_SQL_REGION" env-description:"GCP region for instances/databases"`
	DefaultCores  int32  `` /* 133-byte string literal not displayed */
	DefaultMemory string `` /* 143-byte string literal not displayed */
}

type SidecarMetricsConfig

type SidecarMetricsConfig struct {
	Port int32 `yaml:"port" env:"SIDECAR_METRICS_PORT"`
}

type SpannerConfig

type SpannerConfig struct {
	Image string   `yaml:"image" env:"SPANNER_IMAGE"`
	Args  []string `yaml:"args"`
}

type StatefulServiceAutoscalerConfig

type StatefulServiceAutoscalerConfig struct {
	Enabled                 bool  `yaml:"enabled"`
	MinReplicas             int32 `yaml:"minReplicas"`
	MaxReplicas             int32 `yaml:"maxReplicas"`
	CPUUtilizationThreshold int32 `yaml:"cpuUtilizationThreshold"`
}

type StatefulServiceConfig

type StatefulServiceConfig struct {
	Autoscaler   StatefulServiceAutoscalerConfig   `yaml:"autoscaler"`
	Proxy        StatefulServiceProxyConfig        `yaml:"proxy"`
	UserFunction StatefulServiceUserFunctionConfig `yaml:"userFunction"`
}

StatefulServiceConfig is defined per service in a ConfigMap.

func NewStatefulServiceConfigWithDefaults

func NewStatefulServiceConfigWithDefaults() *StatefulServiceConfig

func ParseStatefulServiceFromConfigMapWithDefaults

func ParseStatefulServiceFromConfigMapWithDefaults(configMap *corev1.ConfigMap) (*StatefulServiceConfig, error)

TODO REVIEW: this is a very long function name.

type StatefulServiceProxyConfig

type StatefulServiceProxyConfig struct {
	// Pointer so that it can be left unset.
	Image           *string                       `yaml:"image"`
	ImagePullPolicy corev1.PullPolicy             `yaml:"imagePullPolicy"`
	Resources       StatefulServiceResourceConfig `yaml:"resources"`
	InitialHeapSize string                        `yaml:"initialHeapSize"`
	MaxHeapSize     string                        `yaml:"maxHeapSize"`
}

type StatefulServiceResourceConfig

type StatefulServiceResourceConfig struct {
	CPURequest string `yaml:"cpuRequest"`
	// Pointer so that it can be left unset.
	CPULimit      *string `yaml:"cpuLimit"`
	MemoryRequest string  `yaml:"memoryRequest"`
	MemoryLimit   string  `yaml:"memoryLimit"`
}

func (*StatefulServiceResourceConfig) ToResourceRequirements

func (rc *StatefulServiceResourceConfig) ToResourceRequirements() (*corev1.ResourceRequirements, error)

type StatefulServiceUserFunctionConfig

type StatefulServiceUserFunctionConfig struct {
	Resources StatefulServiceResourceConfig `yaml:"resources"`
}

Jump to

Keyboard shortcuts

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