config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvHostname hostname env variable
	EnvHostname = "HOSTNAME"
	// EnvConfigMapName configmap name env variable
	EnvConfigMapName = "CONFIG_MAP_NAME"
	// EnvPodIP the controller pod's IP
	EnvPodIP = "POD_IP"
	// EnvDevMode enable dev mode
	EnvDevMode = "DEV_MODE"
	// EnvReportDirectory override for report directory
	EnvReportDirectory = "REPORT_DIRECTORY"

	// PodTemplateName key of the pod template in the configmap
	PodTemplateName = "pod-template.yaml"
	// ConfigFileName key of the config yaml file in the configmap
	ConfigFileName = "config.yaml"

	// LabelVersion version label
	LabelVersion = "version"
	// LabelName name label
	LabelName = "name"
	// LabelPoolSize poolSize label
	LabelPoolSize = "poolSize"
	// LabelReportHistory reportHistory label
	LabelReportHistory = "reportHistory"
)

Variables

This section is empty.

Functions

func IsDevMode added in v1.2.0

func IsDevMode() bool

Types

type Config

type Config struct {
	Name                  string            `json:"name"`
	JobServiceAccount     string            `json:"jobServiceAccount"`
	JobNodeSelector       map[string]string `json:"jobNodeSelector"`
	RunOnUnscheduledNodes bool              `json:"runOnUnscheduledNodes"`
	CronExpression        string            `json:"cronExpression"`
	ReportDirectory       string            `json:"reportDirectory"`
	ReportHistory         int               `json:"reportHistory"`
	PodPoolSize           int               `json:"podPoolSize"`
	RunOnStartup          bool              `json:"runOnStartup"`
	StartupDelay          time.Duration     `json:"startupDelay"`
	Metrics               Metrics           `json:"metrics"`
	HealthProbePort       int               `json:"healthProbePort"`
	// LatestMetricsLabel if true, each result metric is also created with executionID=latest
	LatestMetricsLabel bool                   `json:"latestMetricsLabel"`
	Custom             map[string]interface{} `json:"custom"`
	// CallbackServiceName if left blank, the pod IP is used for callback
	CallbackServiceName string `json:"callbackServiceName"`
	CallbackServicePort int    `json:"callbackServicePort"`
	// LeaderElectionResourceLock resource lock type. if empty default (resourcelock.ConfigMapsLeasesResourceLock) is used
	LeaderElectionResourceLock string `json:"leaderElectionResourceLock,omitempty"`
	// SavePodLog if enabled, pod logs are saved along other with other job files
	SavePodLog bool `json:"savePodLog"`

	Namespace      string         `json:"-"`
	JobPodTemplate string         `json:"-"`
	Owner          runtime.Object `json:"-"`
	DevMode        bool           `json:"-"`
}

Config struct

func Get

func Get(namespace string, config *rest.Config, scheme *runtime.Scheme) (*Config, error)

Get read the config from the configmap

func (*Config) HealthProbeBindAddress added in v1.3.0

func (cfg *Config) HealthProbeBindAddress() string

func (Config) MkReportDir added in v1.4.0

func (cfg Config) MkReportDir(executionID string) error

func (*Config) PodName added in v1.0.0

func (cfg *Config) PodName(nodeName string, id string) string

PodName get the name of the pod

func (*Config) ReportDirExistsChecker added in v1.4.0

func (cfg *Config) ReportDirExistsChecker() healthz.Checker

func (Config) ReportFileName added in v1.4.0

func (cfg Config) ReportFileName(executionID string, name string) string

type Metric

type Metric struct {
	Help   string   `json:"help"`
	Labels []string `json:"labels"`
}

Metric config

type Metrics

type Metrics struct {
	Port   int               `json:"port"`
	Prefix string            `json:"prefix"`
	Gauges map[string]Metric `json:"gauges"`
}

Metrics config

func (*Metrics) BindAddress added in v1.3.0

func (m *Metrics) BindAddress() string

func (*Metrics) NameFor

func (m *Metrics) NameFor(name string) string

NameFor get the name of a metric

Jump to

Keyboard shortcuts

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