config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvHostname hostname env variable
	EnvHostname = "HOSTNAME"
	// EnvConfigMapName configmap name env variable
	EnvConfigMapName = "CONFIG_MAP_NAME"
	// 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"
)

Variables

This section is empty.

Functions

This section is empty.

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"`
	Metrics               Metrics                `json:"metrics"`
	Custom                map[string]interface{} `json:"custom"`
	CallbackServiceName   string                 `json:"callbackServiceName"`
	CallbackServicePort   int                    `json:"callbackServicePort"`

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

Config struct

func Get

func Get(namespace string, cl client.Reader) (*Config, error)

Get read the config from the configmap

func (*Config) PodName added in v1.0.0

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

PodName get the name of the pod

type Metric

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

Metric config

type Metrics

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

Metrics config

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