Make sure that you have been granted access to our Google Cloud project: https://console.developers.google.com/project/sourcegraph-dev?authuser=0. You may need to change
authuserto the index of your sourcegraph.com Google account.
gcloudcommand (CLI for interacting with the Google Cloud):
curl https://sdk.cloud.google.com | bash
Get authorization for your
gcloud auth login
kubectlcommand (CLI for interacting with Kubernetes):
gcloud components install kubectl
kubectlto point to the desired cluster using the appropriate
gcloud container clusters get-credentialscommand listed in “Instances”.
Verify that you have access to kubernetes:
kubectl get pods --all-namespaces
If you see the following when running
Unable to connect to the server: x509: certificate signed by unknown authority
Just run the appropriate
gcloud container clusters get-credentials command listed at the top of this document again to reauthenticate.
Cluster scale should be managed via terraform. Please reference
google_container_node_pool.primary_containerd_nodes.node_count this line in cloud’s terraform configuration to see where the number of nodes is configured for the cluster, and
gke_num_nodes in the tfvars file to see the current number of nodes. For more details, see the terraform provider documentation.
Any changes to the cluster scale made via kubectl will eventually be overwritten by the values set in terraform.
Snapshots of all Kubernetes resources are taken periodically and pushed to kube-backup.
These example commands are for the
dot-com cluster where the Sourcegraph application is deployed to the
|List all pods||
|Describe the properties of a pod.||
|Get an interactive shell in a running pod container||
|Edit a “deployment” (such as changing environment variables).||
Note that the deployment name is not the pod name, and affects all pods running that deployment.
|SSH into the VM running a pod.||Find the node ID from the NODE column of
|Kill a pod. All of our pods are part of a deployment, so the deployment will spin up a replacement pod automatically.||
|Get a PostgreSQL client on the prod database.||
|List versions in production.||
|Get access to Jaeger locally.||
|Get access to debug server locally.||