https://www.growthbook.io/ logo
b

boundless-football-50785

04/24/2023, 8:11 AM
Does anyone have any experience connecting GrowthBook to OpenReplay as a data source? I am not sure how to get Kubernetes to expose the postgresql port so that Growthbook can query it.
w

white-fireman-22476

04/25/2023, 7:17 AM
Hi Steve. I haven't had any experience with OpenReplay, but I am happy to try an help. So you have a postgres instance running in Kubernetes that you want growthbook cloud to call, or do you have self hosted growthbook server?
If it is a growthbook cloud account, I think you will need to 1. add a NodePort Service to your postgres.yaml file 2. restrict access to the port you choose to growthbook's ip address (52.70.79.40) by creating a NetworkPolicy in a postgres-policy.yaml file. 3. create a postgres readonly user with read permissions only on the appropriate tables. Let me know if you need more help, or ask ChatGPT, as I think it is fairly accurate with its suggestions on how to do those things.
b

boundless-football-50785

04/25/2023, 7:54 AM
I have a self-hosted growthbook server. We want to query postgres which stores the OpenReplay data structure with Growthbook to add metadata to Growthbook. OpenReplay runs on kubernetes but I'm not familiar with the syntax and I think I need to add a new nginx-ingress server to the config to allow access to the postgresql port.
w

white-fireman-22476

04/25/2023, 2:02 PM
I haven't really used kubernetes before but I think you need to add a network policy yaml file to allow it along the lines of:
Copy code
apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: NetworkPolicy
metadata:
  name: allow-postgresql-access
spec:
  podSelector:
    matchLabels:
      app: postgresql
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: growthbook
Assuming the growthbook pod has such a label.
b

boundless-football-50785

04/26/2023, 7:20 AM
Thanks James, in the end we edited the pod and changed from ClusterIp to Loadbalancer and restricted access to the port from a specific IP.
3 Views