🌇 Sunset Kubernetes deployments
This page covers our PostHog Kubernetes deployment, which we sunset and no longer support. We will continue to provide security updates for Kubernetes deployments until at least May 31, 2024.
For existing customers
We highly recommend migrating to PostHog Cloud (US or EU). Take a look at this guide for more information on the migration process.Looking to continue self-hosting?
We still maintain our Open-source Docker Compose deployment. Instructions for deploying can be found here.
This document outlines how to deploy PostHog using Altinity Cloud ClickHouse clusters.
Prerequisites
- Altinity.Cloud ClickHouse cluster:
- Minimum ClickHouse version: 21.8.13
- Single shard and no data replication
- No dashes (
-
) in cluster name
- PostHog helm chart version >= 16.1.1
- PostHog version >= 1.33.0
Deployment instructions
PostHog uses Kafka to send data from the app to ClickHouse. For that reason, Kafka needs to be accessible to ClickHouse during deployment.
Deploying using external Kafka
env:- name: CLICKHOUSE_DISABLE_EXTERNAL_SCHEMASvalue: '1'kafka:enabled: falseexternalKafka:brokers:- 'broker-1.posthog.kafka.us-east-1.amazonaws.com:9094'- 'broker-2.posthog.kafka.us-east-1.amazonaws.com:9094'- 'broker-3.posthog.kafka.us-east-1.amazonaws.com:9094'clickhouse:enabled: falseexternalClickhouse:host: 'somecluster.demo.altinity.cloud'user: 'admin'password: 'password'cluster: 'clustername'secure: true
Read more about how to configure external Kafka in the chart in our deployment documentation.
Using internal Kafka
To deploy using a version of Kafka managed by the PostHog Helm chart, follow these three steps:
- Deploy your Helm chart initially with the following values.yaml:
kafka:enabled: trueexternalAccess:enabled: trueservice:type: LoadBalancerports:external: 9094autoDiscovery:enabled: trueserviceAccount:create: truerbac:create: trueclickhouse:enabled: falseredis:enabled: falsepostgresql:enabled: falsepgbouncer:enabled: falseplugins:enabled: falseworker:enabled: falseweb:enabled: falseevents:enabled: falsemigrate:enabled: false
Get the external Kafka IP via
kubectl get svc -n posthog | grep kafka-0-external
Deploy PostHog using helm with new values.yaml (fill in placeholder values)
env:- name: KAFKA_URL_FOR_CLICKHOUSEvalue: 'kafka://KAFKA_IP:9094'- name: CLICKHOUSE_DISABLE_EXTERNAL_SCHEMASvalue: '1'clickhouse:enabled: falseexternalClickhouse:host: 'somecluster.demo.altinity.cloud'user: 'admin'password: 'password'cluster: 'clustername'secure: truekafka:enabled: trueexternalAccess:enabled: trueservice:type: LoadBalancerports:external: 9094autoDiscovery:enabled: trueserviceAccount:create: truerbac:create: true