Deploying to Google Cloud Platform

Last updated:

First, we need to set up a Kubernetes Cluster. See Google Cloud Kubernetes Engine (GKE).

Here's the minimal required values.yaml that we'll be using later. You can find an overview of the parameters that can be configured during installation under configuration.

cloud: "gcp"
ingress:
hostname: <your-hostname>
nginx:
enabled: false
certManager:
enabled: false

Installing the chart

To install the chart with the release name posthog in posthog namespace, run the following:

helm repo add posthog https://posthog.github.io/charts-clickhouse/
helm repo update
helm install -f values.yaml --timeout 20m --create-namespace --namespace posthog posthog posthog/posthog

Set up a static IP

  1. Open the Google Cloud Console
  2. Go to VPC Networks > External IP addresses
  3. Add a new global static IP with the name posthog

Setting up DNS

Create a record from your desired hostname to the external IP.

I cannot connect to my PostHog instance after creation

If DNS has been updated properly, check whether the SSL certificate was created successfully.

This can be done via the following command:

gcloud beta --project yourproject compute ssl-certificates list

If running the command shows the SSL cert as PROVISIONING, that means that the certificate is still being created. Read more on how to troubleshoot Google SSL certificates here.

As a troubleshooting tool, you can allow HTTP access by setting ingress.gcp.forceHttps and web.secureCookies both to false, but we recommend always accessing PostHog via https.

Upgrading the chart

To upgrade the chart using Helm >= v3 with the release name posthog in posthog namespace, run the following:

helm repo update
helm upgrade -f values.yaml --timeout 20m --namespace posthog posthog posthog/posthog --atomic

When upgrading major versions, see Upgrade notes.

See the Helm docs for documentation on the helm upgrade command.

Uninstalling the chart

To uninstall the chart using Helm >= v3 with the release name posthog in posthog namespace, run the following:

$ helm uninstall posthog --namespace posthog

See the Helm docs for documentation on the helm uninstall command.

The command above removes all the Kubernetes components associated with the chart and deletes the release. Sometimes everything doesn't get properly removed. If that happens try deleting the namespace

kubectl delete namespace posthog