config

package
v3.1.0-rc11 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 23 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyConfigFunc = func() interface{} { return &Config{} }

Functions

This section is empty.

Types

type ArtifactRepository

type ArtifactRepository struct {
	// ArchiveLogs enables log archiving
	ArchiveLogs *bool `json:"archiveLogs,omitempty"`
	// S3 stores artifact in a S3-compliant object store
	S3 *S3ArtifactRepository `json:"s3,omitempty"`
	// Artifactory stores artifacts to JFrog Artifactory
	Artifactory *ArtifactoryArtifactRepository `json:"artifactory,omitempty"`
	// HDFS stores artifacts in HDFS
	HDFS *HDFSArtifactRepository `json:"hdfs,omitempty"`
	// OSS stores artifact in a OSS-compliant object store
	OSS *OSSArtifactRepository `json:"oss,omitempty"`
	// GCS stores artifact in a GCS object store
	GCS *GCSArtifactRepository `json:"gcs,omitempty"`
}

ArtifactRepository represents an artifact repository in which a controller will store its artifacts

func (*ArtifactRepository) Get

func (*ArtifactRepository) IsArchiveLogs

func (a *ArtifactRepository) IsArchiveLogs() bool

func (*ArtifactRepository) ToArtifactLocation

func (a *ArtifactRepository) ToArtifactLocation() *wfv1.ArtifactLocation

ToArtifactLocation returns the artifact location set with default template key: key = `{{workflow.name}}/{{pod.name}}`

type ArtifactRepositoryType

type ArtifactRepositoryType interface {
	IntoArtifactLocation(l *wfv1.ArtifactLocation)
}

type ArtifactoryArtifactRepository

type ArtifactoryArtifactRepository struct {
	wfv1.ArtifactoryAuth `json:",inline"`
	// RepoURL is the url for artifactory repo.
	RepoURL string `json:"repoURL,omitempty"`
}

ArtifactoryArtifactRepository defines the controller configuration for an artifactory artifact repository

func (*ArtifactoryArtifactRepository) IntoArtifactLocation

func (r *ArtifactoryArtifactRepository) IntoArtifactLocation(l *wfv1.ArtifactLocation)

type Config

type Config struct {

	// NodeEvents configures how node events are omitted
	NodeEvents NodeEvents `json:"nodeEvents,omitempty"`

	// ExecutorImage is the image name of the executor to use when running pods
	// DEPRECATED: use --executor-image flag to workflow-controller instead
	ExecutorImage string `json:"executorImage,omitempty"`

	// ExecutorImagePullPolicy is the imagePullPolicy of the executor to use when running pods
	// DEPRECATED: use `executor.imagePullPolicy` in configmap instead
	ExecutorImagePullPolicy string `json:"executorImagePullPolicy,omitempty"`

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

	// ExecutorResources specifies the resource requirements that will be used for the executor sidecar
	// DEPRECATED: use `executor.resources` in configmap instead
	ExecutorResources *apiv1.ResourceRequirements `json:"executorResources,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"`

	// ContainerRuntimeExecutor specifies the container runtime interface to use, default is docker
	ContainerRuntimeExecutor string `json:"containerRuntimeExecutor,omitempty"`

	ContainerRuntimeExecutors ContainerRuntimeExecutors `json:"containerRuntimeExecutors,omitempty"`

	// KubeletPort is needed when using the kubelet containerRuntimeExecutor, default to 10250
	KubeletPort int `json:"kubeletPort,omitempty"`

	// KubeletInsecure disable the TLS verification of the kubelet containerRuntimeExecutor, default to false
	KubeletInsecure bool `json:"kubeletInsecure,omitempty"`

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

	// Namespace is a label selector filter to limit the controller's watch to a specific namespace
	// DEPRECATED: support will be remove in a future release
	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.
	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"`

	// Config customized Docker Sock path
	DockerSockPath string `json:"dockerSockPath,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 the pods in the GC queue get deleted.
	// Value must be non-negative integer. A zero value indicates that the pods will be deleted immediately
	// as soon as they arrived in the pod GC queue.
	// Defaults to 30 seconds.
	PodGCGracePeriodSeconds *int64 `json:"podGCGracePeriodSeconds,omitempty"`

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

	// Adding 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://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary
	Images map[string]Image `json:"images,omitempty"`
}

Config contain the configuration settings for the workflow controller

func (Config) GetContainerRuntimeExecutor

func (c Config) GetContainerRuntimeExecutor(labels labels.Labels) (string, error)

func (Config) GetResourceRateLimit added in v3.1.0

func (c Config) GetResourceRateLimit() ResourceRateLimit

type ConnectionPool

type ConnectionPool struct {
	MaxIdleConns    int `json:"maxIdleConns,omitempty"`
	MaxOpenConns    int `json:"maxOpenConns,omitempty"`
	ConnMaxLifetime TTL `json:"connMaxLifetime,omitempty"`
}

type ContainerRuntimeExecutor

type ContainerRuntimeExecutor struct {
	Name     string               `json:"name"`
	Selector metav1.LabelSelector `json:"selector"`
}

func (ContainerRuntimeExecutor) Matches

func (e ContainerRuntimeExecutor) Matches(labels labels.Labels) (bool, error)

type ContainerRuntimeExecutors

type ContainerRuntimeExecutors []ContainerRuntimeExecutor

func (ContainerRuntimeExecutors) Select

func (e ContainerRuntimeExecutors) Select(labels labels.Labels) (string, error)

select the correct executor to use this may return an empty string of there is not executor found

type Controller

type Controller interface {
	Run(stopCh <-chan struct{}, onChange func(config interface{}) error)
	Get(context.Context) (interface{}, error)
}

func NewController

func NewController(namespace, name string, kubeclientset kubernetes.Interface, emptyConfigFunc func() interface{}) Controller

type DatabaseConfig

type DatabaseConfig struct {
	Host           string                  `json:"host"`
	Port           int                     `json:"port,omitempty"`
	Database       string                  `json:"database"`
	TableName      string                  `json:"tableName,omitempty"`
	UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret,omitempty"`
	PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret,omitempty"`
}

func (DatabaseConfig) GetHostname

func (c DatabaseConfig) GetHostname() string

type GCSArtifactRepository

type GCSArtifactRepository struct {
	wfv1.GCSBucket `json:",inline"`

	// KeyFormat is defines the format of how to store keys. Can reference workflow variables
	KeyFormat string `json:"keyFormat,omitempty"`
}

GCSArtifactRepository defines the controller configuration for a GCS artifact repository

func (*GCSArtifactRepository) IntoArtifactLocation

func (r *GCSArtifactRepository) IntoArtifactLocation(l *wfv1.ArtifactLocation)

type HDFSArtifactRepository

type HDFSArtifactRepository struct {
	wfv1.HDFSConfig `json:",inline"`

	// PathFormat is defines the format of path to store a file. Can reference workflow variables
	PathFormat string `json:"pathFormat,omitempty"`

	// Force copies a file forcibly even if it exists (default: false)
	Force bool `json:"force,omitempty"`
}

HDFSArtifactRepository defines the controller configuration for an HDFS artifact repository

func (*HDFSArtifactRepository) IntoArtifactLocation

func (r *HDFSArtifactRepository) IntoArtifactLocation(l *wfv1.ArtifactLocation)

type Image added in v3.1.0

type Image struct {
	Command []string `json:"command"`
	Args    []string `json:"args,omitempty"`
}

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 a outofcluster method, it is used when the workflow controller is in a different cluster with the workflow workloads

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"`
}

MetricsConfig defines a config for a metrics server

type MySQLConfig

type MySQLConfig struct {
	DatabaseConfig
	Options map[string]string `json:"options,omitempty"`
}

type NodeEvents

type NodeEvents struct {
	Enabled *bool `json:"enabled,omitempty"`
}

func (NodeEvents) IsEnabled

func (e NodeEvents) IsEnabled() bool

type OSSArtifactRepository

type OSSArtifactRepository struct {
	wfv1.OSSBucket `json:",inline"`

	// KeyFormat is defines the format of how to store keys. Can reference workflow variables
	KeyFormat string `json:"keyFormat,omitempty"`
}

OSSArtifactRepository defines the controller configuration for an OSS artifact repository

func (*OSSArtifactRepository) IntoArtifactLocation

func (r *OSSArtifactRepository) IntoArtifactLocation(l *wfv1.ArtifactLocation)

type PersistConfig

type PersistConfig struct {
	NodeStatusOffload bool `json:"nodeStatusOffLoad,omitempty"`
	// Archive workflows to persistence.
	Archive bool `json:"archive,omitempty"`
	// ArchivelabelSelector holds LabelSelector to determine workflow persistence.
	ArchiveLabelSelector *metav1.LabelSelector `json:"archiveLabelSelector,omitempty"`
	// in days
	ArchiveTTL     TTL               `json:"archiveTTL,omitempty"`
	ClusterName    string            `json:"clusterName,omitempty"`
	ConnectionPool *ConnectionPool   `json:"connectionPool,omitempty"`
	PostgreSQL     *PostgreSQLConfig `json:"postgresql,omitempty"`
	MySQL          *MySQLConfig      `json:"mysql,omitempty"`
	SkipMigration  bool              `json:"skipMigration,omitempty"`
}

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     bool   `json:"ssl,omitempty"`
	SSLMode string `json:"sslMode,omitempty"`
}

type ResourceRateLimit added in v3.1.0

type ResourceRateLimit struct {
	Limit float64 `json:"limit"`
	Burst int     `json:"burst"`
}

type S3ArtifactRepository

type S3ArtifactRepository struct {
	wfv1.S3Bucket `json:",inline"`

	// KeyFormat is defines the format of how to store keys. Can reference workflow variables
	KeyFormat string `json:"keyFormat,omitempty"`

	// KeyPrefix is prefix used as part of the bucket key in which the controller will store artifacts.
	// DEPRECATED. Use KeyFormat instead
	KeyPrefix string `json:"keyPrefix,omitempty"`
}

S3ArtifactRepository defines the controller configuration for an S3 artifact repository

func (*S3ArtifactRepository) IntoArtifactLocation

func (r *S3ArtifactRepository) IntoArtifactLocation(l *wfv1.ArtifactLocation)

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
const (
	TemplateReferencingStrict TemplateReferencing = "Strict"
	TemplateReferencingSecure TemplateReferencing = "Secure"
)

type WorkflowRestrictions

type WorkflowRestrictions struct {
	TemplateReferencing TemplateReferencing `json:"templateReferencing,omitempty"`
}

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