Note: Sourcegraph sends performance and usage data to Sourcegraph to help us make our product better for you. The data sent does NOT include any source code or file data (including URLs that might implicitly contain this information). You can view traces and disable telemetry in the site admin area on the server.
- Kubernetes v1.9 or later with an SSD storage class
- kubectl v1.9.7 or later
- Access to server infrastructure on which you can create a Kubernetes cluster (see resource allocation guidelines).
- Sourcegraph Enterprise license. You can run through these instructions without one, but you must obtain a license for instances of more than 10 users.
- A valid domain name for your Sourcegraph instance (to enable SSL/TLS)
- A valid TLS certificate (whether from a trusted certificate authority such as Comodo, RapidSSL, or others, a self-signed certificate that can be distributed and installed across all users' machines, or the ability to use an existing reverse proxy that provides SSL termination for the connection)
- Access tokens or other credentials to connect to your code hosts of choice
- Administrative access to your single sign-on (SSO) provider of choice
-
Provision a Kubernetes cluster on the infrastructure of your choice.
-
Make sure you have configured
kubectl
to access your cluster.-
If you are using GCP, you'll need to give your user the ability to create roles in Kubernetes (see GCP's documentation):
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value account)
-
-
Clone this repository and check out the version tag you wish to deploy.
# Go to https://github.com/sourcegraph/deploy-sourcegraph/tags and select the latest version tag git clone https://github.com/sourcegraph/deploy-sourcegraph && cd deploy-sourcegraph && git checkout ${VERSION}
-
Configure the
sourcegraph
storage class for the cluster by reading through "Configure a storage class". -
If you want to add a large number of repositories to your instance, you should configure the number of gitserver replicas and the number of indexed-search replicas before you continue with the next step. (See "Tuning replica counts for horizontal scalability" for guidelines.)
-
Deploy the desired version of Sourcegraph to your cluster:
./kubectl-apply-all.sh
-
Monitor the status of the deployment.
watch kubectl get pods -o wide
-
Once the deployment completes, verify Sourcegraph is running by temporarily making the frontend port accessible:
kubectl 1.9.x:
kubectl port-forward $(kubectl get pod -l app=sourcegraph-frontend -o template --template="{{(index .items 0).metadata.name}}") 3080
kubectl 1.10.0 or later:
kubectl port-forward svc/sourcegraph-frontend 3080:30080
Open http://localhost:3080 in your browser and you will see a setup page. Congrats, you have Sourcegraph up and running!
See the Troubleshooting docs.