Deploying Sourcegraph executors on Kubernetes

Kubernetes manifests are provided to deploy Sourcegraph Executors on a running Kubernetes cluster. If you are deploying Sourcegraph with helm, charts are available here.

Deployment

Executors on kubernetes machines require privileged access to a container runtime daemon in order to operate correctly. In order to ensure maximum capability across Kubernetes versions and container runtimes, a Docker in Docker side car is deployed with each executor pod to avoid accessing the host container runtime directly.

Step-by-step Guide

Ensure you have the following tools installed:

  • kubectl
  • Helm if you're installing Sourcegraph with helm.

Deployment via kubectl (Kubernetes manifests)

  1. Clone the deploy-sourcegraph repository to your local machine.
  2. Run cd deploy-sourcegraph/configure/executors.
  3. Configure the Executor environment variables in the executor/executor.deployment.yaml file.
  4. Run kubectl apply -f . --recursive to deploy all components.
  5. Confirm executors are working are working by checking the Executors page under Site admin > Executors > Instances .

Deployment via Helm

  1. Clone the deploy-sourcegraph-helm repository to your local machine.
  2. Run cd deploy-sourcegraph-helm/charts/sourcegraph-executor.
  3. Edit the values.yaml with any other customizations you may require.
  4. Run the following command:
  5. helm upgrade --install -f values.yaml --version 5.0.6 sg-executor sourcegraph/sourcegraph-executor
  6. Confirm executors are working are working by checking the Executors page under Site admin > Executors > Instances .

For more information on the components being deployed see the Executors readme.

Note

Executors deployed in kubernetes do not use Firecracker, meaning they require privileged access to the docker daemon running in a sidecar alongside the executor pod.

If you have security concerns, consider deploying via terraform or installing the binary directly.