Hi again folks, I've setup a k8s deployment with g...
# ask-questions
w
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
Hi Bhaskar, let me take a look
w
thanks Graham
f
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
checking now
the other thing that happens is
the API service stops working as soon as I load the site on port 2000
f
stops? like it was working then stops?
w
actually the api service just stops on its own
f
huh, can you see if there are any logs?
w
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
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
is there a better way to deploy to a k8s cluster?
f
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
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