Superagent request within a kubernetes cluster -
i have 2 kubernetes controllers , services pods running named web
, api
respectively.
in web pod
using superagent try , access api pod
following http://api:3000/api/user
results in error err_name_not_resolved
however if run shell on web pod
, curl http://api:3000/api/user
works should
am missing fundamental how superagent works? or else?
if launch superagent in browser, browser not part of kubernetes cluster, hence neither uses kube dns nor can access cluster ips.
to make work need expose api service external world means of nodeport/loadbalancer service or ingress
Comments
Post a Comment