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:
Deployment via kubectl (Kubernetes manifests)
- Clone the deploy-sourcegraph repository to your local machine.
- Run
cd deploy-sourcegraph/configure/executors
. - Configure the Executor environment variables in the
executor/executor.deployment.yaml
file. - Run
kubectl apply -f . --recursive
to deploy all components. - Confirm executors are working are working by checking the Executors page under Site admin > Executors > Instances .
Deployment via Helm
- Clone the deploy-sourcegraph-helm repository to your local machine.
- Run
cd deploy-sourcegraph-helm/charts/sourcegraph-executor
. - Edit the
values.yaml
with any other customizations you may require. - Run the following command:
helm upgrade --install -f values.yaml --version 5.0.6 sg-executor sourcegraph/sourcegraph-executor
- 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.