0

I'm running a bare metal k8s cluster so I have to configure ingress-nginx manually. I have applied the mandatory yaml and bare-metal yaml: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml

As described in the doc. I am not sure if I need to apply anything else, like RBAC. This created a deployment, and a pod but no service. I need to create the service, using the NodePort method described here.

The problem is my service is not starting, it stays in pending. Did anyone have any success with this? How does the nginx service need to be configured?

1 Answer 1

0

The problem with pending state on bare metal may be caused:

  • Your service can't receive IP address from external.
  • Your service can't claim the port on system because it is already in use.

In you case, it looks like your service can't claim the port. Could you try to use different ports on the system (for testing at the beginning):

apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  type: NodePort
  ports:
    - name: http
      nodePort: 30080
      port: 80
      protocol: TCP
    - name: https
      port: 443
      nodePort: 30443
      protocol: TCP
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

and then your ingress will available to those nodePorts 30236 -> 80 and 30443 -> 443 from external.

3
  • Will 80 and 443 be the ones accessed from the exterior? Because i am a bit confused on how all this works at the moment. I already have a nodePort service for my app, so i can actually access it on hostname:32448 at the moment. The issue is that i have 2 nodes and i understand that these 30000 ports can change. So i want to be able to access my app from outside on 80. Then if either ingress can take care of the load balancing, that's fine, or i can setup an F5, that's also fine. But if the ports change it should work automatically with the new ports.
    – AdrianD
    Jan 23, 2019 at 14:50
  • In case when you define port in service it will doesn't change until you change it. In same time you need to make some some load balancer (Nginx HAproxy) under your kubernetes cluster. Usually when it is cloud cloud provider make it for you. But when you use bare metal you need to configure all by yourself.
    – Nick Rak
    Jan 24, 2019 at 9:59
  • Well, my service is defined with 32448. If it doesn't change then I can just make an lb farm on my F5 with port translation on the virtual server until I figure out the k8s stuff.
    – AdrianD
    Jan 24, 2019 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.