controller

package
v2.3.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDeadlineExceeded indicates the operation exceeded its deadline for execution
	ErrDeadlineExceeded = errors.New(errors.CodeTimeout, "Deadline exceeded")
	// ErrParallelismReached indicates this workflow reached its parallelism limit
	ErrParallelismReached = errors.New(errors.CodeForbidden, "Max parallelism reached")
)

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

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

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

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

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 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

type Throttler

type Throttler interface {
	Add(key interface{}, priority int32, creationTime time.Time)
	// Next returns true if item should be processed by controller now or return false.
	Next(key interface{}) (interface{}, bool)
	// Remove notifies throttler that item processing is done. In responses the throttler triggers processing of previously throttled items.
	Remove(key interface{})
	// SetParallelism update throttler parallelism limit.
	SetParallelism(parallelism int)
}

Throttler allows CRD controller to limit number of items it is processing in parallel.

func NewThrottler

func NewThrottler(parallelism int, queue workqueue.RateLimitingInterface) Throttler

type WorkflowController

type WorkflowController struct {

	// Config is the workflow controller's configuration
	Config WorkflowControllerConfig
	// contains filtered or unexported fields
}

WorkflowController is the controller for workflow resources

func NewWorkflowController

func NewWorkflowController(
	restConfig *rest.Config,
	kubeclientset kubernetes.Interface,
	wfclientset wfclientset.Interface,
	namespace,
	executorImage,
	executorImagePullPolicy,
	configMap string,
) *WorkflowController

NewWorkflowController instantiates a new WorkflowController

func (*WorkflowController) MetricsServer

func (wfc *WorkflowController) MetricsServer(ctx context.Context)

MetricsServer starts a prometheus metrics server if enabled in the configmap

func (*WorkflowController) ResyncConfig

func (wfc *WorkflowController) ResyncConfig() error

ResyncConfig reloads the controller config from the configmap

func (*WorkflowController) Run

func (wfc *WorkflowController) Run(ctx context.Context, wfWorkers, podWorkers int)

Run starts an Workflow resource controller

func (*WorkflowController) RunTTLController

func (wfc *WorkflowController) RunTTLController(ctx context.Context)

RunTTLController runs the workflow TTL controller

func (*WorkflowController) TelemetryServer

func (wfc *WorkflowController) TelemetryServer(ctx context.Context)

TelemetryServer starts a prometheus telemetry server if enabled in the configmap

type WorkflowControllerConfig

type WorkflowControllerConfig struct {
	// 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"`

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

	// 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
	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 metrics.PrometheusConfig `json:"metricsConfig,omitempty"`

	TelemetryConfig metrics.PrometheusConfig `json:"telemetryConfig,omitempty"`

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

WorkflowControllerConfig contain the configuration settings for the workflow controller

Jump to

Keyboard shortcuts

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