config

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactDriver

type ArtifactDriver struct {
	// Name is the name of the artifact driver plugin
	Name wfv1.ArtifactPluginName `json:"name"`
	// Image is the docker image of the artifact driver
	Image string `json:"image"`
	// ConnectionTimeoutSeconds is the timeout for the artifact driver connection, 5 seconds if not set
	ConnectionTimeoutSeconds int32 `json:"connectionTimeoutSeconds,omitempty" protobuf:"varint,3,opt,name=connectionTimeoutSeconds"`
}

ArtifactDriver is a plugin for an artifact driver

func (ArtifactDriver) ConnectionTimeout

func (a ArtifactDriver) ConnectionTimeout() time.Duration

type Config

type Config struct {
	// NodeEvents configures how node events are emitted
	NodeEvents NodeEvents `json:"nodeEvents,omitempty"`

	// WorkflowEvents configures how workflow events are emitted
	WorkflowEvents WorkflowEvents `json:"workflowEvents,omitempty"`

	// Executor holds container customizations for the executor to use when running pods
	Executor *apiv1.Container `json:"executor,omitempty"`

	// MainContainer holds container customization for the main container
	MainContainer *apiv1.Container `json:"mainContainer,omitempty"`

	// KubeConfig specifies a kube config file for the wait & init containers
	KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`

	// ArtifactRepository contains the default location of an artifact repository for container artifacts
	ArtifactRepository wfv1.ArtifactRepository `json:"artifactRepository,omitempty"`

	// Namespace is a label selector filter to limit the controller's watch to a specific namespace
	Namespace string `json:"namespace,omitempty"`

	// InstanceID is a label selector to limit the controller's watch to a specific instance. It
	// contains an arbitrary value that is carried forward into its pod labels, under the key
	// workflows.argoproj.io/controller-instanceid, for the purposes of workflow segregation. This
	// enables a controller to only receive workflow and pod events that it is interested about,
	// in order to support multiple controllers in a single cluster, and ultimately allows the
	// controller itself to be bundled as part of a higher level application. If omitted, the
	// controller watches workflows and pods that *are not* labeled with an instance id.
	// See [Scaling - Instance ID](https://argo-workflows.readthedocs.io/en/latest/scaling/#instance-id) for more details.
	InstanceID string `json:"instanceID,omitempty"`

	// MetricsConfig specifies configuration for metrics emission. Metrics are enabled and emitted on localhost:9090/metrics
	// by default.
	MetricsConfig MetricsConfig `json:"metricsConfig,omitempty"`

	// TelemetryConfig specifies configuration for telemetry emission. Telemetry is enabled and emitted in the same endpoint
	// as metrics by default, but can be overridden using this config.
	TelemetryConfig MetricsConfig `json:"telemetryConfig,omitempty"`

	// Parallelism limits the max total parallel workflows that can execute at the same time
	Parallelism int `json:"parallelism,omitempty"`

	// NamespaceParallelism limits the max workflows that can execute at the same time in a namespace
	NamespaceParallelism int `json:"namespaceParallelism,omitempty"`

	// ResourceRateLimit limits the rate at which pods are created
	ResourceRateLimit *ResourceRateLimit `json:"resourceRateLimit,omitempty"`

	// Persistence contains the workflow persistence DB configuration
	Persistence *PersistConfig `json:"persistence,omitempty"`

	// Links to related apps.
	Links []*wfv1.Link `json:"links,omitempty"`

	// Columns are custom columns that will be exposed in the Workflow List View.
	Columns []*wfv1.Column `json:"columns,omitempty"`

	// WorkflowDefaults are values that will apply to all Workflows from this controller, unless overridden on the Workflow-level
	WorkflowDefaults *wfv1.Workflow `json:"workflowDefaults,omitempty"`

	// PodSpecLogStrategy enables the logging of podspec on controller log.
	PodSpecLogStrategy PodSpecLogStrategy `json:"podSpecLogStrategy,omitempty"`

	// PodGCGracePeriodSeconds specifies the duration in seconds before a terminating pod is forcefully killed.
	// Value must be non-negative integer. A zero value indicates that the pod will be forcefully terminated immediately.
	// Defaults to the Kubernetes default of 30 seconds.
	PodGCGracePeriodSeconds *int64 `json:"podGCGracePeriodSeconds,omitempty"`

	// PodGCDeleteDelayDuration specifies the duration before pods in the GC queue get deleted.
	// Value must be non-negative. A zero value indicates that the pods will be deleted immediately.
	// Defaults to 5 seconds.
	PodGCDeleteDelayDuration *metav1.Duration `json:"podGCDeleteDelayDuration,omitempty"`

	// WorkflowRestrictions restricts the controller to executing Workflows that meet certain restrictions
	WorkflowRestrictions *WorkflowRestrictions `json:"workflowRestrictions,omitempty"`

	// Adds configurable initial delay (for K8S clusters with mutating webhooks) to prevent workflow getting modified by MWC.
	InitialDelay metav1.Duration `json:"initialDelay,omitempty"`

	// The command/args for each image, needed when the command is not specified and the emissary executor is used.
	// https://argo-workflows.readthedocs.io/en/latest/workflow-executors/#emissary-emissary
	Images map[string]Image `json:"images,omitempty"`

	// Workflow retention by number of workflows
	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`

	// NavColor is an ui navigation bar background color
	NavColor string `json:"navColor,omitempty"`

	// SSO in settings for single-sign on
	SSO SSOConfig `json:"sso,omitempty"`

	// Synchronization via databases config
	Synchronization *SyncConfig `json:"synchronization,omitempty"`

	// ArtifactDrivers lists artifact driver plugins we can use
	ArtifactDrivers []ArtifactDriver `json:"artifactDrivers,omitempty"`

	// FailedPodRestart configures automatic restart of pods that fail before entering Running state
	// (e.g., due to Eviction, DiskPressure, Preemption). This allows recovery from transient
	// infrastructure issues without requiring a retryStrategy on templates.
	FailedPodRestart *FailedPodRestartConfig `json:"failedPodRestart,omitempty"`
}

Config contains the root of the configuration settings for the workflow controller as read from the ConfigMap called workflow-controller-configmap

func (Config) GetArtifactDriver

func (c Config) GetArtifactDriver(name wfv1.ArtifactPluginName) (ArtifactDriver, error)

func (Config) GetArtifactDrivers

func (c Config) GetArtifactDrivers(plugins []wfv1.ArtifactPluginName) ([]ArtifactDriver, error)

func (Config) GetExecutor

func (c Config) GetExecutor() *apiv1.Container

func (Config) GetPodGCDeleteDelayDuration

func (c Config) GetPodGCDeleteDelayDuration() time.Duration

func (Config) GetResourceRateLimit

func (c Config) GetResourceRateLimit() ResourceRateLimit

func (*Config) Sanitize

func (c *Config) Sanitize(allowedProtocol []string) error

func (Config) ValidateProtocol

func (c Config) ValidateProtocol(inputProtocol string, allowedProtocol []string) error

type ConnectionPool

type ConnectionPool struct {
	// MaxIdleConns sets the maximum number of idle connections in the pool
	MaxIdleConns int `json:"maxIdleConns,omitempty"`
	// MaxOpenConns sets the maximum number of open connections to the database
	MaxOpenConns int `json:"maxOpenConns,omitempty"`
	// ConnMaxLifetime sets the maximum amount of time a connection may be reused
	ConnMaxLifetime TTL `json:"connMaxLifetime,omitempty"`
}

ConnectionPool contains database connection pool settings

type Controller

type Controller interface {
	Get(context.Context) (*Config, error)
	GetNamespace() string
	GetName() string
}

func NewController

func NewController(namespace, name string, kubeclientset kubernetes.Interface) Controller

type DBConfig

type DBConfig struct {
	// PostgreSQL configuration for PostgreSQL database, don't use MySQL at the same time
	PostgreSQL *PostgreSQLConfig `json:"postgresql,omitempty"`
	// MySQL configuration for MySQL database, don't use PostgreSQL at the same time
	MySQL *MySQLConfig `json:"mysql,omitempty"`
	// Pooled connection settings for all types of database connections
	ConnectionPool *ConnectionPool `json:"connectionPool,omitempty"`
}

DBConfig contains database configuration settings

type DatabaseConfig

type DatabaseConfig struct {
	// Host is the database server hostname
	Host string `json:"host"`
	// Port is the database server port
	Port int `json:"port,omitempty"`
	// Database is the name of the database to connect to
	Database string `json:"database"`
	// TableName is the name of the table to use, must be set
	TableName string `json:"tableName,omitempty"`
	// UsernameSecret references a secret containing the database username
	UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret,omitempty"`
	// PasswordSecret references a secret containing the database password
	PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret,omitempty"`
}

DatabaseConfig contains common database connection settings

func (DatabaseConfig) GetHostname

func (c DatabaseConfig) GetHostname() string

type FailedPodRestartConfig

type FailedPodRestartConfig struct {
	// Enabled enables automatic restart of pods that fail before entering Running state.
	// When enabled, pods that fail due to infrastructure issues (like eviction) without ever
	// running their main container will be automatically recreated.
	// Default is false.
	Enabled bool `json:"enabled,omitempty"`

	// MaxRestarts is the maximum number of automatic restarts per node before giving up.
	// This prevents infinite restart loops. Default is 3.
	MaxRestarts *int32 `json:"maxRestarts,omitempty"`
}

FailedPodRestartConfig configures automatic restart of pods that fail before entering Running state. This is useful for recovering from transient infrastructure issues like node eviction due to DiskPressure or MemoryPressure without requiring a retryStrategy on every template.

func (*FailedPodRestartConfig) GetMaxRestarts

func (c *FailedPodRestartConfig) GetMaxRestarts() int32

GetMaxRestarts returns the configured max restarts or the default value of 3.

func (*FailedPodRestartConfig) IsEnabled

func (c *FailedPodRestartConfig) IsEnabled() bool

IsEnabled returns true if the feature is enabled.

type Image

type Image struct {
	// Entrypoint overrides the container entrypoint
	Entrypoint []string `json:"entrypoint,omitempty"`
	// Cmd overrides the container command
	Cmd []string `json:"cmd,omitempty"`
}

Image contains command and entrypoint configuration for container images

type KubeConfig

type KubeConfig struct {
	// SecretName of the kubeconfig secret
	// may not be empty if kuebConfig specified
	SecretName string `json:"secretName"`
	// SecretKey of the kubeconfig in the secret
	// may not be empty if kubeConfig specified
	SecretKey string `json:"secretKey"`
	// VolumeName of kubeconfig, default to 'kubeconfig'
	VolumeName string `json:"volumeName,omitempty"`
	// MountPath of the kubeconfig secret, default to '/kube/config'
	MountPath string `json:"mountPath,omitempty"`
}

KubeConfig is used for wait & init sidecar containers to communicate with a k8s apiserver by an out-of-cluster method; it is used when the workflow controller is in a different cluster from the workflow workloads

type MetricModifier

type MetricModifier struct {
	// Disabled disables the emission of this metric completely
	Disabled bool `json:"disabled,omitempty"`
	// DisabledAttributes lists labels for this metric to remove that attributes to save on cardinality
	DisabledAttributes []string `json:"disabledAttributes"`
	// HistogramBuckets allow configuring of the buckets used in a histogram
	// Has no effect on non-histogram buckets
	HistogramBuckets []float64 `json:"histogramBuckets,omitempty"`
}

MetricModifier are modifiers for an individual named metric to change their behaviour

type MetricsConfig

type MetricsConfig struct {
	// Enabled controls metric emission. Default is true, set "enabled: false" to turn off
	Enabled *bool `json:"enabled,omitempty"`
	// DisableLegacy turns off legacy metrics
	// DEPRECATED: Legacy metrics are now removed, this field is ignored
	DisableLegacy bool `json:"disableLegacy,omitempty"`
	// MetricsTTL sets how often custom metrics are cleared from memory
	MetricsTTL TTL `json:"metricsTTL,omitempty"`
	// Path is the path where metrics are emitted. Must start with a "/". Default is "/metrics"
	Path string `json:"path,omitempty"`
	// Port is the port where metrics are emitted. Default is "9090"
	Port int `json:"port,omitempty"`
	// IgnoreErrors is a flag that instructs prometheus to ignore metric emission errors
	IgnoreErrors bool `json:"ignoreErrors,omitempty"`
	// Secure is a flag that starts the metrics servers using TLS, defaults to true
	Secure *bool `json:"secure,omitempty"`
	// Modifiers configure metrics by name
	Modifiers map[string]MetricModifier `json:"modifiers,omitempty"`
	// Temporality of the OpenTelemetry metrics.
	// Enum of Cumulative or Delta, defaulting to Cumulative.
	// No effect on Prometheus metrics, which are always Cumulative.
	Temporality MetricsTemporality `json:"temporality,omitempty"`
}

MetricsConfig defines a config for a metrics server

func (*MetricsConfig) GetSecure

func (mc *MetricsConfig) GetSecure(defaultValue bool) bool

func (*MetricsConfig) GetTemporality

func (mc *MetricsConfig) GetTemporality() metricsdk.TemporalitySelector

type MetricsTemporality

type MetricsTemporality string

MetricsTemporality defines the temporality of OpenTelemetry metrics

const (
	// MetricsTemporalityCumulative indicates cumulative temporality
	MetricsTemporalityCumulative MetricsTemporality = "Cumulative"
	// MetricsTemporalityDelta indicates delta temporality
	MetricsTemporalityDelta MetricsTemporality = "Delta"
)

type MySQLConfig

type MySQLConfig struct {
	DatabaseConfig
	// Options contains additional MySQL connection options
	Options map[string]string `json:"options,omitempty"`
}

MySQLConfig contains MySQL-specific database configuration

type NodeEvents

type NodeEvents struct {
	// Enabled controls whether node events are emitted
	Enabled *bool `json:"enabled,omitempty"`
	// SendAsPod emits events as if from the Pod instead of the Workflow with annotations linking the event to the Workflow
	SendAsPod bool `json:"sendAsPod,omitempty"`
}

NodeEvents configures how node events are emitted

func (NodeEvents) IsEnabled

func (e NodeEvents) IsEnabled() bool

type PersistConfig

type PersistConfig struct {
	DBConfig
	// NodeStatusOffload saves node status only to the persistence DB to avoid the 1MB limit in etcd
	NodeStatusOffload bool `json:"nodeStatusOffLoad,omitempty"`
	// Archive completed and Workflows to persistence so you can access them after they're
	// removed from kubernetes
	Archive bool `json:"archive,omitempty"`
	// ArchiveLabelSelector holds LabelSelector to determine which Workflows to archive
	ArchiveLabelSelector *metav1.LabelSelector `json:"archiveLabelSelector,omitempty"`
	// ArchiveTTL is the time to live for archived Workflows
	ArchiveTTL TTL `json:"archiveTTL,omitempty"`
	// ClusterName is the name of the cluster (or technically controller) for the persistence database
	ClusterName string `json:"clusterName,omitempty"`
	// SkipMigration skips database migration even if needed
	SkipMigration bool `json:"skipMigration,omitempty"`
}

PersistConfig contains workflow persistence configuration

func (PersistConfig) GetArchiveLabelSelector

func (c PersistConfig) GetArchiveLabelSelector() (labels.Selector, error)

func (PersistConfig) GetClusterName

func (c PersistConfig) GetClusterName() string

type PodSpecLogStrategy

type PodSpecLogStrategy struct {
	FailedPod bool `json:"failedPod,omitempty"`
	AllPods   bool `json:"allPods,omitempty"`
}

PodSpecLogStrategy contains the configuration for logging the pod spec in controller log for debugging purpose

type PostgreSQLConfig

type PostgreSQLConfig struct {
	DatabaseConfig
	// SSL enables SSL connection to the database
	SSL bool `json:"ssl,omitempty"`
	// SSLMode specifies the SSL mode (disable, require, verify-ca, verify-full)
	SSLMode string `json:"sslMode,omitempty"`
}

PostgreSQLConfig contains PostgreSQL-specific database configuration

type RBACConfig

type RBACConfig struct {
	// Enabled controls whether RBAC is enabled
	Enabled bool `json:"enabled,omitempty"`
}

RBACConfig contains role-based access control configuration

func (*RBACConfig) IsEnabled

func (c *RBACConfig) IsEnabled() bool

type ResourceRateLimit

type ResourceRateLimit struct {
	// Limit is the maximum rate at which pods can be created
	Limit float64 `json:"limit"`
	// Burst allows temporary spikes above the limit
	Burst int `json:"burst"`
}

type RetentionPolicy

type RetentionPolicy struct {
	// Completed is the number of completed Workflows to retain
	Completed int `json:"completed,omitempty"`
	// Failed is the number of failed Workflows to retain
	Failed int `json:"failed,omitempty"`
	// Errored is the number of errored Workflows to retain
	Errored int `json:"errored,omitempty"`
}

Workflow retention by number of workflows

type SSOConfig

type SSOConfig struct {
	// Issuer is the OIDC issuer URL
	Issuer string `json:"issuer"`
	// IssuerAlias is an optional alias for the issuer
	IssuerAlias string `json:"issuerAlias,omitempty"`
	// ClientID references a secret containing the OIDC client ID
	ClientID apiv1.SecretKeySelector `json:"clientId"`
	// ClientSecret references a secret containing the OIDC client secret
	ClientSecret apiv1.SecretKeySelector `json:"clientSecret"`
	// RedirectURL is the OIDC redirect URL
	RedirectURL string `json:"redirectUrl"`
	// RBAC contains role-based access control settings
	RBAC *RBACConfig `json:"rbac,omitempty"`
	// additional scopes (on top of "openid")
	Scopes []string `json:"scopes,omitempty"`
	// SessionExpiry specifies how long user sessions last
	SessionExpiry metav1.Duration `json:"sessionExpiry,omitempty"`
	// CustomGroupClaimName will override the groups claim name
	CustomGroupClaimName string `json:"customGroupClaimName,omitempty"`
	// UserInfoPath specifies the path to user info endpoint
	UserInfoPath string `json:"userInfoPath,omitempty"`
	// InsecureSkipVerify skips TLS certificate verification
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
	// FilterGroupsRegex filters groups using regular expressions
	FilterGroupsRegex []string `json:"filterGroupsRegex,omitempty"`
	// custom PEM encoded CA certificate file contents
	RootCA string `json:"rootCA,omitempty"`
}

SSOConfig contains single sign-on configuration settings

func (SSOConfig) GetSessionExpiry

func (c SSOConfig) GetSessionExpiry() time.Duration

type SyncConfig

type SyncConfig struct {
	DBConfig
	// EnableAPI enables the database synchronization API
	EnableAPI bool `json:"enableAPI,omitempty"`
	// ControllerName sets a unique name for this controller instance
	ControllerName string `json:"controllerName"`
	// SkipMigration skips database migration if needed
	SkipMigration bool `json:"skipMigration,omitempty"`
	// LimitTableName customizes the table name for semaphore limits, if not set, the default value is "sync_limit"
	LimitTableName string `json:"limitTableName,omitempty"`
	// StateTableName customizes the table name for current lock state, if not set, the default value is "sync_state"
	StateTableName string `json:"stateTableName,omitempty"`
	// ControllerTableName customizes the table name for controller heartbeats, if not set, the default value is "sync_controller"
	ControllerTableName string `json:"controllerTableName,omitempty"`
	// LockTableName customizes the table name for lock coordination data, if not set, the default value is "sync_lock"
	LockTableName string `json:"lockTableName,omitempty"`
	// PollSeconds specifies how often to check for lock changes, if not set, the default value is 5 seconds
	PollSeconds *int `json:"pollSeconds,omitempty"`
	// HeartbeatSeconds specifies how often to update controller heartbeat, if not set, the default value is 60 seconds
	HeartbeatSeconds *int `json:"heartbeatSeconds,omitempty"`
	// InactiveControllerSeconds specifies when to consider a controller dead, if not set, the default value is 300 seconds
	InactiveControllerSeconds *int `json:"inactiveControllerSeconds,omitempty"`
	// SemaphoreLimitCacheSeconds specifies the duration in seconds before the workflow controller will re-fetch the limit
	// for a semaphore from its associated data source. Defaults to 0 seconds (re-fetch every time the semaphore is checked).
	SemaphoreLimitCacheSeconds *int64 `json:"semaphoreLimitCacheSeconds,omitempty"`
}

SyncConfig contains synchronization configuration for database locks (semaphores and mutexes)

type TTL

type TTL time.Duration

time.Duration forces you to specify in millis, and does not support days see https://stackoverflow.com/questions/48050945/how-to-unmarshal-json-into-durations

func (TTL) MarshalJSON

func (l TTL) MarshalJSON() ([]byte, error)

func (*TTL) UnmarshalJSON

func (l *TTL) UnmarshalJSON(b []byte) error

type TemplateReferencing

type TemplateReferencing string

TemplateReferencing defines how templates can be referenced in workflows

const (
	// TemplateReferencingStrict requires templates to be referenced, not embedded
	TemplateReferencingStrict TemplateReferencing = "Strict"
	// TemplateReferencingSecure requires templates to be referenced and prevents spec changes
	TemplateReferencingSecure TemplateReferencing = "Secure"
)

type WorkflowEvents

type WorkflowEvents struct {
	// Enabled controls whether workflow events are emitted
	Enabled *bool `json:"enabled,omitempty"`
}

WorkflowEvents configures how workflow events are emitted

func (WorkflowEvents) IsEnabled

func (e WorkflowEvents) IsEnabled() bool

type WorkflowRestrictions

type WorkflowRestrictions struct {
	// TemplateReferencing controls how templates can be referenced
	TemplateReferencing TemplateReferencing `json:"templateReferencing,omitempty"`
}

WorkflowRestrictions contains restrictions for workflow execution

func (*WorkflowRestrictions) MustNotChangeSpec

func (req *WorkflowRestrictions) MustNotChangeSpec() bool

func (*WorkflowRestrictions) MustUseReference

func (req *WorkflowRestrictions) MustUseReference() bool

Jump to

Keyboard shortcuts

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