How do I actually connect to botfront on kubernetes?

1/22/2021

I tried deploying on EKS, and my config.yaml follows this suggested format:

botfront:
   app:
# The complete external host of the Botfront application (eg. botfront.yoursite.com). It must be set even if running on a        private or local DNS (it populates the ROOT_URL).
       host: botfront.yoursite.com
mongodb:
   enabled: true # disable to use an external mongoDB host
# Username of the MongoDB user that will have read-write access to the Botfront database. This is not the root user
    mongodbUsername: username
# Password of the MongoDB user that will have read-write access to the Botfront database. This is not the root user
    mongodbPassword: password
# MongoDB root password
     mongodbRootPassword: rootpassword

And I ran this command:

helm install -f config.yaml -n botfront --namespace botfront botfront/botfront

and the deployment appeared successful with all pods listed as running.

But botfront.yoursite.com goes nowhere. I checked the ingress and it matches, but there are no external ip addresses or anything. I don't know how to actually access my botfront site once deployed on kubernetes.

What am I missing?

EDIT:

With nginx lb installed kubectl get ingresses -n botfront now returns:

NAME                   CLASS    HOSTS                ADDRESS                                                                         PORTS   AGE
botfront-app-ingress   <none>   botfront.cream.com   a182b0b24e4fb4a0f8bd6300b440e5fa-423aebd224ce20ac.elb.us-east-2.amazonaws.com   80      4d1h

and

kubectl get svc -n botfront returns:

NAME                        TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)           AGE
botfront-api-service        NodePort   10.100.207.27   <none>        80:31723/TCP      4d1h
botfront-app-service        NodePort   10.100.26.173   <none>        80:30873/TCP      4d1h
botfront-duckling-service   NodePort   10.100.75.248   <none>        80:31989/TCP      4d1h
botfront-mongodb-service    NodePort   10.100.155.11   <none>        27017:30358/TCP   4d1h
-- Stephan
kubernetes
rasa

1 Answer

1/25/2021

If you run kubectl get svc -n botfront, it will show you all the Services that expose your botfront

$ kubectl get svc -n botfront
NAME                        TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)           AGE
botfront-api-service        NodePort   10.3.252.32    <none>        80:32077/TCP      63s
botfront-app-service        NodePort   10.3.249.247   <none>        80:31201/TCP      63s
botfront-duckling-service   NodePort   10.3.248.75    <none>        80:31209/TCP      63s
botfront-mongodb-service    NodePort   10.3.252.26    <none>        27017:31939/TCP   64s

Each of them is of type NodePort, which means it exposes your app on the external IP address of each of your EKS cluster nodes on a specific port.

So if you your node1 ip happens to be 1.2.3.4 you can acess botfront-api-service on 1.2.3.4:32077. Don't forget to allow access to this port on firewall/security groups. If you have any registered domain e.g. yoursite.com you can configure for it a subdomain botfront.yoursite.com and point it to one of your EKS nodes. Then you'll be able to access it using your domain. This is the simplest way.

To be able to access it in a more effective way than by using specific node's IP and non-standard port, you may want to expose it via Ingress which will create an external load balancer, making your NodePort services available under one external IP adress and standard http port.

Update: I see that this chart already comes with ingress that exposes your app:

$ kubectl get ingresses -n botfront 
NAME                   HOSTS                   ADDRESS   PORTS   AGE
botfront-app-ingress   botfront.yoursite.com             80      70m

If you retrieve its yaml definition by:

$ kubectl get ingresses -n botfront -o yaml

you'll see that it uses the following annotation:

kubernetes.io/ingress.class: nginx

which means you need nginx-ingress controller installed on your EKS cluster. This might be one reason why it fails. As you can see in my example, this ingress doesn't get any external IP. That's because nginx-ingress wasn't installed on my GKE cluster. Not sure about EKS but as far as I know it doesn't come with nginx-ingress preinstalled.

One more thing: I assume that in your config.yaml you put some real domain name that you have registered instead of botfront.yoursite.com. Suppose your domain is yoursite.com and you successfully created subdomain botfront.yoursite.com, you should redirected it to the IP of your load balancer (the one used by your ingress).

If you run kubectl get ingresses -n botfront but the ADDRESS is empty, you probably don't have nginx-ingress installed and the underlying load balancer cannot be created. If you have here some external IP address, then redirect your registered domain to this address.

-- mario
Source: StackOverflow