sourcegraph/cmd/executor/internal/config
Peter Guy f8cc07220a
chore/executors: Native Kubernetes Executors default to use single job pod (#64088)
For Executors on Native Kubernetes deployments, the option to run jobs
in a single pod has been available since Native Kubernetes has been
around.

The purpose of running jobs in a single pod is:
1. Efficiency. Jobs require three steps at least, and without specifying
a single pod, that requires spinning up three pods.
2. Security. For Batch Changes, when jobs are run across several pods,
`git`'s `safe.directory` must be set to avoid untrusted users or
processes injecting code or an attack. Running the job in one pod
removes the need for `safe.directory`.
3. Usability. Because of the need to set `safe.directory`, `root` access
to write to `git`'s global config is required, which means that many
times special configurations and sign-offs from security teams must be
used for Batch Change setups.

This PR takes a step toward using single pod jobs only in enabling them
by default instead of requiring an environment variable to enable them.

The same environment variable that was used to enable them -
`KUBERNETES_SINGLE_JOB_POD` - is still available to disable them by
setting it to `false`.

## Test plan

Bazel and CI for now

## Changelog
2024-07-31 08:07:06 -07:00
..
BUILD.bazel bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
config_test.go chore/executors: Native Kubernetes Executors default to use single job pod (#64088) 2024-07-31 08:07:06 -07:00
config.go chore/executors: Native Kubernetes Executors default to use single job pod (#64088) 2024-07-31 08:07:06 -07:00
consts.go Move executor to cmd/executor (#55700) 2023-08-10 02:06:12 +02:00
kubernetes_test.go Move executor to cmd/executor (#55700) 2023-08-10 02:06:12 +02:00
kubernetes.go Move executor to cmd/executor (#55700) 2023-08-10 02:06:12 +02:00