K8s manual ingress controller config

1/23/2019

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?

-- AdrianD
kubernetes
kubernetes-ingress

1 Answer

1/23/2019

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.

-- Nick Rak
Source: StackOverflow