Back to Pipeline

Tekton Controllers flags

docs/tekton-controller-flags.md

1.12.06.6 KB
Original Source
<!-- --- linkTitle: "Tekton Controllers flags" weight: 105 --- -->

Tekton Controllers flags

The different controllers tektoncd/pipeline ships come with a set of flags that can be changed (in the yaml payloads) for advanced use cases. This page documents them.

Flag availability overview

Not all flags are available on every controller. The table below shows which flags and environment variables are supported by each controller binary.

Flags from knative/pkg (available on all controllers)

These flags are registered by injection.ParseAndGetRESTConfigOrDie() and klog, and are available on all controllers (controller, webhook, events, resolvers):

FlagDescription
-clusterDefaults to the current cluster in kubeconfig.
-serverThe address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
-kubeconfigPath to a kubeconfig. Only required if out-of-cluster.
-kube-api-burstMaximum burst for throttle.
-kube-api-qpsMaximum QPS to the server from the client.
-vNumber for the log level verbosity.
-vmoduleComma-separated list of pattern=N settings for file-filtered logging.
-add_dir_headerIf true, adds the file directory to the header of the log messages.
-alsologtostderrLog to standard error as well as files (no effect when -logtostderr=true).
-log_backtrace_atWhen logging hits line file:N, emit a stack trace.
-log_dirIf non-empty, write log files in this directory (no effect when -logtostderr=true).
-log_fileIf non-empty, use this log file (no effect when -logtostderr=true).
-log_file_max_sizeMaximum size a log file can grow to in megabytes (default 1800, 0 = unlimited; no effect when -logtostderr=true).
-logtostderrLog to standard error instead of files (default true).
-one_outputIf true, only write logs to their native severity level (no effect when -logtostderr=true).
-skip_headersIf true, avoid header prefixes in the log messages.
-skip_log_headersIf true, avoid headers when opening log files (no effect when -logtostderr=true).
-stderrthresholdLogs at or above this threshold go to stderr (default 2; no effect when -logtostderr=true or -alsologtostderr=false).

Flags and environment variables that vary by controller

The following flags and environment variables are not available on all controllers. Their availability depends on whether the controller calls sharedmain.MainWithContext() (which registers --disable-ha and reads K_THREADS_PER_CONTROLLER) or registers flags directly in its own main().

Flag / Environment VariableSourcecontrollerwebhookeventsresolvers
--disable-hasharedmain / TektonYesYesYesNo
--threads-per-controllerTektonYesNoNoYes
--namespaceTektonYesNoNoNo
--resync-periodTektonYesNoNoNo
THREADS_PER_CONTROLLER env varTektonYesNoNoYes
K_THREADS_PER_CONTROLLER env varsharedmainNoYesYesNo

Note: controller and resolvers read the THREADS_PER_CONTROLLER environment variable (without the K_ prefix) in their own code before parsing flags, while webhook and events read K_THREADS_PER_CONTROLLER (with the K_ prefix) via sharedmain.MainWithContext(). Both environment variables set the same underlying controller.DefaultThreadsPerController value; the difference is only in the variable name.

controller

The main controller binary (cmd/controller/main.go) has additional flags to configure its behavior.

  -disable-ha
        Whether to disable high-availability functionality for this component.
        This flag will be deprecated and removed when we have promoted this
        feature to stable, so do not pass it without filing an issue upstream!
  -entrypoint-image string
        The container image containing our entrypoint binary.
  -namespace string
        Namespace to restrict informer to. Optional, defaults to all namespaces.
  -nop-image string
        The container image used to stop sidecars
  -resync-period duration
        The period between two resync run (going through all objects) (default 10h0m0s)
  -shell-image string
        The container image containing a shell
  -shell-image-win string
        The container image containing a windows shell
  -sidecarlogresults-image string
        The container image containing the binary for accessing results.
  -threads-per-controller int
        Threads (goroutines) to create per controller (default 2)
  -workingdirinit-image string
        The container image containing our working dir init binary.

Environment variables: THREADS_PER_CONTROLLER

webhook

The webhook binary (cmd/webhook/main.go) calls sharedmain.MainWithContext(), which provides:

  -disable-ha
        Whether to disable high-availability functionality for this component.
        This flag will be deprecated and removed when we have promoted this
        feature to stable, so do not pass it without filing an issue upstream!

Environment variables: K_THREADS_PER_CONTROLLER

events

The events controller binary (cmd/events/main.go) calls sharedmain.Main(), which provides:

  -disable-ha
        Whether to disable high-availability functionality for this component.
        This flag will be deprecated and removed when we have promoted this
        feature to stable, so do not pass it without filing an issue upstream!

Environment variables: K_THREADS_PER_CONTROLLER

resolvers

The resolvers binary (cmd/resolvers/main.go) has the following additional flag:

  -threads-per-controller int
        Threads (goroutines) to create per controller (default 2)

Environment variables: THREADS_PER_CONTROLLER

Note: The resolvers binary does not support --disable-ha. It calls injection.ParseAndGetRESTConfigOrDie() followed by sharedmain.MainWithConfig(), which does not register the --disable-ha flag.