Executors
An executor is responsible for executing jobs, i.e. plans and applies. There are two types of executor:
forkkubernetes
The executor is set with the --executor flag. The flag is applicable to both otfd and otf-agent, which determines how jobs scheduled to that process are executed. For example, you could set otfd to use fork but if a job is scheduled to run on an otf-agent then the job will use whatever executor it has set.
Fork
Fork is the default executor. It forks terraform (or tofu) processes as children of the otfd or otf-agent process.
The maximum number of forked processes is set with the --concurrency flag.
Note
If you want to scale processes beyond a single host with the fork executor then you can either run otfd on other hosts to form an OTF cluster, or run otf-agent on other hosts. See runners for more details on agents.
Kubernetes
The kubernetes executor executes jobs on kubernetes. Each job is run as a kubernetes job.
This executor is only functional when otfd or otf-agent is deployed via the helm charts to a kubernetes cluster.
There are a number of flags that customise the jobs:
It's advisable to provide a persistent volume for the cache. Otherwise the terraform or tofu binary is downloaded at the beginning of every job. See the helm chart settings to enable the persistent volume claim. You will need to make available a persistent volume that supports the ReadWriteMany access mode.