How to enable Postgres SSL access for a sourcegraph helm deployment

Enabling SSL access for Postgres in a Sourcegraph Helm deployment is a straightforward process that involves modifying the Sourcegraph deployment configuration once you have configured SSL on the Postgres server side. This article will guide you through the steps to configure SSL access to your Postgres server in a Sourcegraph deployment.

Prerequisites:

  • A Sourcegraph deployment using Helm
  • A Postgres server with SSL configured

Step 1: Modify the override file

In the override file for your Sourcegraph deployment used for the values arg of the helm install/upgrade commands define the environment variable PGSSLMODE for the frontend deployment. The environment variable can be set to either "disable" or "require" depending on your Postgres server configuration.

frontend:
env:
PGSSLMODE:
value: 'require'


Step 2: Install/upgrade Sourcegraph with the override file

Install or upgrade your Sourcegraph deployment with the override file using the following command:

helm install --values ./override.yaml --version <sourcegraph-version> sourcegraph sourcegraph/sourcegraph


Replace <sourcegraph-version> with the version of Sourcegraph, you want to install or upgrade to.

That's it! You have successfully enabled SSL access for Postgres in your Sourcegraph deployment.

Note: If you have Code Insights or Code Intelligence enabled, you will also need to set the CODEINTELPGSSLMODE and CODEINSIGHTSPGSSLMODE environment variables in the override file to ensure SSL access is enabled for those components.

 
frontend:
  env:
    PGSSLMODE:
      value: 'require'
    CODEINTELPGSSLMODE:
      value: 'require'
    CODEINSIGHTSPGSSLMODE:
      value: 'require'
Was this article helpful?
0 out of 0 found this helpful

Articles in this section