[Kubernetes (K8S)] Helm install PostHog to provide product analytics stack within Kubernetes (K8S)
PostHog
PostHog provides open-source product analytics, built for developers. Automate the collection of every event on your website or app, with no need to send data to 3rd parties. With just 1 click you can deploy on your own infrastructure, having full API/SQL access to the underlying data.
This article is about how to use Helm to install PostHog on Kubernetes (K8S).
Prerequisites
-
Kubernetes (K8S)
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.For more information about installing and using Kubernetes (K8s), see the Kubernetes (K8s) Docs.
-
Helm
Helm is the best way to find, share, and use software built for Kubernetes.For more information about installing and using Helm, see the Helm Docs.
How to Install
Helm install posthog into posthog namespace.
1 | crate namespace: |
See Helm release about posthog
1 | helm list --namespace posthog |
See pods about posthog.
1 | kubectl get pods -n posthog |
Custom values.yaml
Remember to replace content within {{ }}
with your prefer value.
1 | # values.yaml |
Web UI
Then, you can visit https://{{ .Values.ingress.hostname }}
to access PostHog Web UI.
FAQS
502 Bad Gateway
PostHog may fail to initialize or upgrade database since it will take too long. You can do it yoursef.
First, enter into Pod posthog-web bash.
1 | kubectl exec -n posthog `kubectl get pods -n posthog | grep posthog-web | awk '{print $2}'` -it -- bash |
Then, run posthog upgrade
within container to run all migrations and create an admin account.
1 | python manage.py migrate |
Finally, you can visit Web UI without any error.
References
[3] PostHog - Open-Source Product Analytics - https://posthog.com/