conf

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

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

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

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

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

	// admissioncontroller
	PrefixAMFiltering               = PrefixAdmissionController + "filtering."
	AMFilteringGenerateUniqueAppIds = PrefixAMFiltering + "generateUniqueAppId"

	// 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
	DefaultKubeQPS                         = 1000
	DefaultKubeBurst                       = 1000
	DefaultAMFilteringGenerateUniqueAppIds = false
)

Variables

This section is empty.

Functions

func Decompress added in v1.4.0

func Decompress(key string, value []byte) (string, string)

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 GetBuildInfoMap added in v1.4.0

func GetBuildInfoMap() map[string]string

func GetBuildInfoString added in v1.4.0

func GetBuildInfoString() 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"`
	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"`
	EnableConfigHotRefresh   bool          `json:"enableConfigHotRefresh"`
	DisableGangScheduling    bool          `json:"disableGangScheduling"`
	UserLabelKey             string        `json:"userLabelKey"`
	PlaceHolderImage         string        `json:"placeHolderImage"`
	InstanceTypeNodeLabelKey string        `json:"instanceTypeNodeLabelKey"`
	Namespace                string        `json:"namespace"`
	GenerateUniqueAppIds     bool          `json:"generateUniqueAppIds"`
	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) 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