config

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFileKey is key of config file in ConfigMap
	ConfigFileKey = "cyclone-server.json"

	// EnvWebhookURLPrefix is the key of Environment variable to define webhook callback url prefix
	EnvWebhookURLPrefix = "WEBHOOK_URL_PREFIX"
)

Variables

This section is empty.

Functions

func GetWebhookURLPrefix added in v0.9.6

func GetWebhookURLPrefix() string

GetWebhookURLPrefix returns webhook callback url prefix. It tries to get the url from "WEBHOOK_URL_PREFIX" environment variable, if the value is empty, then get it from configmap.

func LoadConfig added in v0.9.3

func LoadConfig(cm *core_v1.ConfigMap) error

LoadConfig loads configuration from ConfigMap

Types

type ClientSetConfig added in v0.9.8

type ClientSetConfig struct {
	// QPS indicates the maximum QPS to the master from this client.
	// If it's zero, the created RESTClient will use DefaultQPS: 5
	QPS float32 `json:"qps"`

	// Maximum burst for throttle.
	// If it's zero, the created RESTClient will use DefaultBurst: 10.
	Burst int `json:"burst"`
}

ClientSetConfig defines rate limit config for a Kubernetes client

type CycloneServerConfig added in v0.9.3

type CycloneServerConfig struct {
	// Logging configuration, such as log level.
	Logging LoggingConfig `json:"logging"`

	// CycloneServerHost represents the host for cyclone server to serve on
	CycloneServerHost string `json:"cyclone_server_host"`
	// CycloneServerPort represents the port for cyclone server to serve on
	CycloneServerPort uint16 `json:"cyclone_server_port"`

	// DefaultPVCConfig represents the config of pvc for default tenant
	DefaultPVCConfig PVCConfig `json:"default_pvc_config"`

	// WorkerNamespaceQuota describes the resource quota of the namespace which will be used to run workflows,
	// eg map[core_v1.ResourceName]string{"cpu": "2", "memory": "4Gi"}
	WorkerNamespaceQuota map[core_v1.ResourceName]string `json:"worker_namespace_quota"`

	// WebhookURLPrefix represents the Cyclone server path to receive webhook requests.
	// If Cyclone server can be accessed by external systems, it would like be `https://{cyclone-server}/apis/v1alpha1`.
	WebhookURLPrefix string `json:"webhook_url_prefix"`

	// StorageUsageWatcher configures PVC storage usage watchers.
	StorageUsageWatcher StorageUsageWatcher `json:"storage_usage_watcher"`

	// CreateBuiltinTemplates configures whether to create builtin stage templates while cyclone server start up.
	CreateBuiltinTemplates bool `json:"create_builtin_templates"`

	// InitDefaultTenant configures whether to create cyclone default tenant while cyclone server start up.
	InitDefaultTenant bool `json:"init_default_tenant"`

	// OpenControlCluster indicates whether to open control cluster for workflow execution when tenant created
	OpenControlCluster bool `json:"open_control_cluster"`

	// Images that used in cyclone, such as GC image.
	Images map[string]string `json:"images"`

	// Notifications represents the config to send notifications after workflowruns finish.
	Notifications []NotificationEndpoint `json:"notifications"`

	// RecordWebURLTemplate represents the URL template to generate web URLs for workflowruns.
	RecordWebURLTemplate string `json:"record_web_url_template"`

	// ClientSet holds the common attributes that can be passed to a Kubernetes client on cyclone server handlers
	// initialization.
	ClientSet ClientSetConfig `json:"client_set"`
}

CycloneServerConfig configures Cyclone Server

var Config CycloneServerConfig

Config is Workflow Controller config instance

type LoggingConfig added in v0.9.3

type LoggingConfig struct {
	Level string `json:"level"`
}

LoggingConfig configures logging

type NotificationEndpoint added in v0.9.6

type NotificationEndpoint struct {
	// Name represents the name of notification endpoint.
	Name string `json:"name"`

	// URL represents the URL to send the notification.
	URL string `json:"url"`
}

NotificationEndpoint represents the config of notification endpoint. Server will send notifications about finished workflowruns if notification endpoints are configured.

type PVCConfig added in v0.9.3

type PVCConfig struct {
	// StorageClass represents the strorageclass used to create pvc
	StorageClass string `json:"storage_class"`

	// Size represents the capacity of the pvc, unit supports 'Gi' or 'Mi'
	// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
	Size string `json:"size"`
}

PVCConfig contains the PVC information

type StorageUsageWatcher added in v0.9.3

type StorageUsageWatcher struct {
	// Image is image for the storage usage watcher, for example 'busybox:1.30.0'
	Image string `json:"image"`
	// ReportURL is url where to report the usage
	ReportURL string `json:"report_url"`
	// IntervalSeconds is intervals to report storage usage
	IntervalSeconds string `json:"interval_seconds"`
	// ResourceRequirements specifies resource requirements of the watcher container.
	ResourceRequirements map[core_v1.ResourceName]string `json:"resource_requirements"`
}

StorageUsageWatcher configures PVC storage usage watchers.

Jump to

Keyboard shortcuts

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