This directory provides overlays that are ready to use for installing a pre-configured Sourcegraph instance in different environments for demonstration purposes. By using these overlays, you can easily deploy a Sourcegraph instance to your cluster, without the need for manually configuring all the necessary resources.
Warning Please do not modify any files in this directory for deployment purposes. Create your overlays in the overlays directory instead.
IMPORTANT: Always refer to the Sourcegraph Kustomize docs for the latest instructions.
Before you begin, make sure you have kubectl and kustomize installed on your system.
Step 1: Build manifests Step 2: Review manifests Step 3: Apply manifests
NOTE: All commands in this guide should be run from the root of this repository.
To build the manifests using an overlay without applying them to your cluster, run the following command:
kubectl kustomize /examples/$OVERLAY_NAME -o cluster.yamlThis command will create a file named cluster.yaml in the root directory, which contains all the resources defined in the overlay you specified.
Before applying the manifests, it is important to review them to ensure they meet your requirements and do not include any unwanted changes.
You can review the manifests by running the following command:
less cluster.yamlOnce you have reviewed the manifests, you can apply them to your cluster using the following command:
kubectl apply --prune -l deploy=sourcegraph -f cluster.yamlThis command will apply all the resources defined in the cluster.yaml file to your cluster, and also remove any resources that are no longer defined in the file.
NOTE: By default, the kubectl apply command does not remove resources that are no longer defined in the manifests. By adding the --prune flag, you are telling kubectl to remove any resources that are no longer present in the manifests.