skip to Main Content

I’m new to K8s trying to access the app by IP. Below is the situation –

enter image description here

  1. Cluster is ready, 1 master node and 1 worker node, pods are with running status
  2. installed nginx ingress controller with help of this doc
  3. now I’m able to access worker node (pasted worker IP on browser which is currently showing 404 status), I want to access the apps running on port 4200 & 8080
  4. How can I access my applications by path based way like XXX.XXX.XXX.XXX/app1 and XXX.XXX.XXX.XXX/app2, in what files & what changes I have to do? Services are showing status as <pending>? What does that mean 🧐

2

Answers


  1. Why do you need ingress controller on bare metal?

    Try to use simple NodePort service types, it will give you same result. Ingress controller more preferrable when you have it behind cloud load balancer.

    Getting back to your question 4:

    You can do this only if you have cloud load balancer in front of ingress controller, in any other case you’ll have to do something like this: XXX.XXX.XXX.XXX:$INGRESS_CONTROLLER_PORT/$PATH

    which refers to: XXX.XXX.XXX.XXX ($K8S_cluster_IP).

    And it’s almost the same scenario as with NodePort service.

    Login or Signup to reply.
  2. If you are using "LoadBalancer" type as the service, obviously you should install or use a 3rd party LoadBalancer, since you’re using a BARE-METAL environment. For example you can use MetalLB.

    You can find more information regarding MetalLB below:
    https://blog.inkubate.io/install-and-configure-metallb-as-a-load-balancer-for-kubernetes/

    If not, you may have to use "NodePort" type as the service.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search