https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
w

wonderful-xylophone-6904

05/16/2022, 8:55 PM
Hi again folks, I've setup a k8s deployment with gb & mongo containers and a service which with a public IP that will forward requests to ports withihn those containers. Attaching the yaml --
Here's the service that provides a public IP and fwds requests to the container ports 3100 and 3000
But when I connect to the service I get the following error --
Copy code
Error connecting to the GrowthBook API
I've even tried setting the host header to "Host: localhost" but to no avail
anyone know how to resolve this?
f

fresh-football-47124

05/16/2022, 9:36 PM
Hi Bhaskar, let me take a look
w

wonderful-xylophone-6904

05/16/2022, 9:42 PM
thanks Graham
f

fresh-football-47124

05/16/2022, 9:43 PM
I see you're wanting to run the API on port 2100
Copy code
name: API_HOST
          value: <http://localhost:2100>
but that error shows the API host is set to 3100
can you open up localhost:2100? does it work if you visit it directly (if its working, it will show you a json obj)
w

wonderful-xylophone-6904

05/16/2022, 9:59 PM
checking now
the other thing that happens is
the API service stops working as soon as I load the site on port 2000
f

fresh-football-47124

05/16/2022, 10:06 PM
stops? like it was working then stops?
w

wonderful-xylophone-6904

05/16/2022, 10:07 PM
actually the api service just stops on its own
f

fresh-football-47124

05/16/2022, 10:07 PM
huh, can you see if there are any logs?
w

wonderful-xylophone-6904

05/16/2022, 10:09 PM
Copy code
-- % kubectl get pods -o wide                                   
NAME                           READY   STATUS    RESTARTS   AGE   IP          NODE                                                  NOMINATED NODE   READINESS GATES
gb-mongo-app-587bccd58-6tsm4   2/2     Running   0          4s    10.10.0.4   gke-pantheon-gb-sandbox-regional-pool-e72d7900-jh2z   <none>           <none>


-- % kubectl port-forward gb-mongo-app-587bccd58-6tsm4 2100:3100
Forwarding from 127.0.0.1:2100 -> 3100
Forwarding from [::1]:2100 -> 3100
I see this output and then after I refresh a few times
it stops working
f

fresh-football-47124

05/16/2022, 10:11 PM
the api host in the url is not consistent with the api_host variable the API is getting from the env variable - but this should never cause it to just stop working...
w

wonderful-xylophone-6904

05/16/2022, 10:12 PM
is there a better way to deploy to a k8s cluster?
f

fresh-football-47124

05/16/2022, 10:14 PM
sounds like you're very close, just the env variables aren't quite right - but can you use a Helm chart? https://github.com/growthbook/growthbook/pull/103/
w

wonderful-xylophone-6904

05/16/2022, 10:19 PM
haven't used one before
will check now thanks
so when i try to add it --
Copy code
# helm repo add gb <https://github.com/growthbook/growthbook/tree/0db45874357115dee02eee6c87fab38b4532497e/charts>
I get
Copy code
Error: looks like "<https://github.com/growthbook/growthbook/tree/0db45874357115dee02eee6c87fab38b4532497e/charts>" is not a valid chart repository or cannot be reached: failed to fetch <https://github.com/growthbook/growthbook/tree/0db45874357115dee02eee6c87fab38b4532497e/charts/index.yaml> : 404 Not Found
ok finally got helm to work after cloning from the forked repo here -- https://github.com/JaeguKim/growthbook/tree/feature/helm-chart
18 Views