dynamic

package
v0.0.0-...-73e42e7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigFetcher

func NewConfigFetcher(options ConfigFetcherOptions, kubeClient kube_client.Interface, recorder kube_record.EventRecorder) *configFetcherImpl

NewConfigFetcher builds a config fetcher from the parameters and dependencies

Types

type Config

type Config struct {
	Settings
	// contains filtered or unexported fields
}

Config which represents not static but dynamic configuration of cluster-autorepair which would be updated periodically at runtime

func ConfigFromConfigMap

func ConfigFromConfigMap(configmap *v1.ConfigMap) (*Config, error)

ConfigFromConfigMap returns the configuration read from a configmap

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig builds a new config object

func (Config) NodeGroupSpecStrings

func (c Config) NodeGroupSpecStrings() []string

NodeGroupSpecStrings returns node group specs represented in the form of `<minSize>:<maxSize>:<name>` to be passed to cloudprovider impls.

func (Config) VersionMismatchesAgainst

func (c Config) VersionMismatchesAgainst(other Config) bool

VersionMismatchesAgainst returns true if versions between two configs don't match i.e. the config should be updated.

type ConfigFetcher

type ConfigFetcher interface {
	FetchConfigIfUpdated() (*Config, error)
}

ConfigFetcher fetches the up-to-date dynamic configuration from the apiserver

type ConfigFetcherOptions

type ConfigFetcherOptions struct {
	ConfigMapName string
	Namespace     string
}

ConfigFetcherOptions contains the various options to customize ConfigFetcher

type NodeGroupSpec

type NodeGroupSpec struct {
	// The name of the autoscaling target
	Name string `json:"name"`
	// Min size of the autoscaling target
	MinSize int `json:"minSize"`
	// Max size of the autoscaling target
	MaxSize int `json:"maxSize"`
	// contains filtered or unexported fields
}

NodeGroupSpec represents a specification of a node group to be auto-scaled

func SpecFromString

func SpecFromString(value string, supportScaleToZero bool) (*NodeGroupSpec, error)

SpecFromString parses a node group spec represented in the form of `<minSize>:<maxSize>:<name>` and produces a node group spec object

func (NodeGroupSpec) String

func (s NodeGroupSpec) String() string

Represents the node group spec in the form of `<minSize>:<maxSize>:<name>`

func (NodeGroupSpec) Validate

func (s NodeGroupSpec) Validate() error

Validate produces an error if there's an invalid field in the node group spec

type Settings

type Settings struct {
	NodeGroups []NodeGroupSpec `json:"nodeGroups"`
}

Settings of cluster-autorepair contained in the latest config, which should be consumed by cluster-autorepair

Jump to

Keyboard shortcuts

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