-1

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
old_timer
  • 69,149
  • 8
  • 89
  • 168
neekheel
  • 98
  • 2
  • 18
  • 1
    Pending most probably means that LoadBalancer services are expecting something to handle them and assign them an external IP Address, which can then be used to access them. On baremetal, you may want to take a look at MetalLB to add LoadBalancing powers to your cluster. If you aren't uninterested into Load Balancing, you can always use NodePorts services to access your apps from the cluster nodes' urls – AndD Jul 11 '21 at 13:35
  • Please keep in mind that there are 3 types of Nginx. Open Source Nginx Ingress Controller, Nginx Incorporaton (nginx inc) and Nginx Incorporaton Plus. Try to use open source nginx. [Here](https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal) is the example for bare metal. You can also find [considerations](https://kubernetes.github.io/ingress-nginx/deploy/baremetal/). – Mikołaj Głodziak Jul 13 '21 at 08:44

2 Answers2

0

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.

Dusty
  • 231
  • 1
  • 3
  • 16
-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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
vi7a
  • 719
  • 5
  • 10