Assign Dev apps to Dev node and qa apps to qa env in k8s cluster with different ns. but they're accessible using their host name in vice-versa mode

Viewed 49

We deploy some application in different namespaces with node selectors on different node such as Dev & QA in 1 k8s cluster. Now what issue is, the application deploy in dev node is also accessible using qa ip or qa node name. which shouldn't be, because application expose using node port and running only on dev env.

also if i deploy qa app, it also exposed using dev node name or ip.

for example, let's say i have dev.com node & qa.com node, i deploy app.dev.com on 3000, it should open using dev.com:3000 inside or outside of cluster, but it's also opening using qa.com:3000 which is not correct as peer me.

1 Answers

Use ingress & a LoadBalancer service instead of NodePort, that should fix your issue.

Related