conf

package
v1.3.0-1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// env vars
	EnvHome       = "HOME"
	EnvKubeConfig = "KUBECONFIG"
	EnvNamespace  = "NAMESPACE"

	// prefixes
	PrefixService    = "service."
	PrefixLog        = "log."
	PrefixKubernetes = "kubernetes."

	// service
	CMSvcClusterID                    = PrefixService + "clusterId"
	CMSvcPolicyGroup                  = PrefixService + "policyGroup"
	CMSvcSchedulingInterval           = PrefixService + "schedulingInterval"
	CMSvcVolumeBindTimeout            = PrefixService + "volumeBindTimeout"
	CMSvcEventChannelCapacity         = PrefixService + "eventChannelCapacity"
	CMSvcDispatchTimeout              = PrefixService + "dispatchTimeout"
	CMSvcOperatorPlugins              = PrefixService + "operatorPlugins"
	CMSvcDisableGangScheduling        = PrefixService + "disableGangScheduling"
	CMSvcEnableConfigHotRefresh       = PrefixService + "enableConfigHotRefresh"
	CMSvcPlaceholderImage             = PrefixService + "placeholderImage"
	CMSvcNodeInstanceTypeNodeLabelKey = PrefixService + "nodeInstanceTypeNodeLabelKey"

	// log
	CMLogLevel = PrefixLog + "level"

	// kubernetes
	CMKubeQPS   = PrefixKubernetes + "qps"
	CMKubeBurst = PrefixKubernetes + "burst"

	// defaults
	DefaultNamespace              = "default"
	DefaultClusterID              = "mycluster"
	DefaultPolicyGroup            = "queues"
	DefaultSchedulingInterval     = time.Second
	DefaultVolumeBindTimeout      = 10 * time.Second
	DefaultEventChannelCapacity   = 1024 * 1024
	DefaultDispatchTimeout        = 300 * time.Second
	DefaultOperatorPlugins        = "general"
	DefaultDisableGangScheduling  = false
	DefaultEnableConfigHotRefresh = true
	DefaultLoggingLevel           = 0
	DefaultLogEncoding            = "console"
	DefaultKubeQPS                = 1000
	DefaultKubeBurst              = 1000
)

Variables

View Source
var (
	BuildVersion    string
	BuildDate       string
	IsPluginVersion bool
	GoVersion       string
	Arch            string
	CoreSHA         string
	SiSHA           string
	ShimSHA         string
)

Functions

func DumpConfiguration added in v1.2.0

func DumpConfiguration()

func FlattenConfigMaps added in v1.2.0

func FlattenConfigMaps(configMaps []*v1.ConfigMap) map[string]string

func GetDefaultKubeConfigPath added in v1.2.0

func GetDefaultKubeConfigPath() string

func GetSchedulerNamespace added in v1.2.0

func GetSchedulerNamespace() string

func SetSchedulerConf added in v1.2.0

func SetSchedulerConf(conf *SchedulerConf)

func UpdateConfigMaps added in v1.2.0

func UpdateConfigMaps(configMaps []*v1.ConfigMap, initial bool) error

Types

type SchedulerConf

type SchedulerConf struct {
	SchedulerName            string        `json:"schedulerName"`
	ClusterID                string        `json:"clusterId"`
	ClusterVersion           string        `json:"clusterVersion"`
	PolicyGroup              string        `json:"policyGroup"`
	Interval                 time.Duration `json:"schedulingIntervalSecond"`
	KubeConfig               string        `json:"absoluteKubeConfigFilePath"`
	LoggingLevel             int           `json:"loggingLevel"`
	VolumeBindTimeout        time.Duration `json:"volumeBindTimeout"`
	TestMode                 bool          `json:"testMode"`
	EventChannelCapacity     int           `json:"eventChannelCapacity"`
	DispatchTimeout          time.Duration `json:"dispatchTimeout"`
	KubeQPS                  int           `json:"kubeQPS"`
	KubeBurst                int           `json:"kubeBurst"`
	OperatorPlugins          string        `json:"operatorPlugins"`
	EnableConfigHotRefresh   bool          `json:"enableConfigHotRefresh"`
	DisableGangScheduling    bool          `json:"disableGangScheduling"`
	UserLabelKey             string        `json:"userLabelKey"`
	PlaceHolderImage         string        `json:"placeHolderImage"`
	InstanceTypeNodeLabelKey string        `json:"instanceTypeNodeLabelKey"`
	Namespace                string        `json:"namespace"`
	sync.RWMutex
}

func CreateDefaultConfig added in v1.2.0

func CreateDefaultConfig() *SchedulerConf

CreateDefaultConfig creates and returns a configuration representing all default values

func GetSchedulerConf

func GetSchedulerConf() *SchedulerConf

func (*SchedulerConf) Clone added in v1.2.0

func (conf *SchedulerConf) Clone() *SchedulerConf

func (*SchedulerConf) GetKubeConfigPath

func (conf *SchedulerConf) GetKubeConfigPath() string

func (*SchedulerConf) GetSchedulingInterval

func (conf *SchedulerConf) GetSchedulingInterval() time.Duration

func (*SchedulerConf) IsOperatorPluginEnabled

func (conf *SchedulerConf) IsOperatorPluginEnabled(name string) bool

func (*SchedulerConf) IsTestMode

func (conf *SchedulerConf) IsTestMode() bool

func (*SchedulerConf) SetTestMode

func (conf *SchedulerConf) SetTestMode(testMode bool)

type SchedulerConfFactory

type SchedulerConfFactory = func() *SchedulerConf

Jump to

Keyboard shortcuts

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