Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 4.01 KB

install.md

File metadata and controls

75 lines (51 loc) · 4.01 KB

Installing Sourcegraph

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.

Requirements

Steps

  1. Provision a Kubernetes cluster on the infrastructure of your choice.

  2. 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)
  3. 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}
  4. Configure the sourcegraph storage class for the cluster by reading through "Configure a storage class".

  5. 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.)

  6. Deploy the desired version of Sourcegraph to your cluster:

    ./kubectl-apply-all.sh
  7. Monitor the status of the deployment.

    watch kubectl get pods -o wide
  8. 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!

  9. Now configure your deployment.

Troubleshooting

See the Troubleshooting docs.