How to assign Public IP to Kubernetes's Ingress

9/29/2018

I have deployed Kong-Ingress-controller using helm

And I have Kubernetes's Cluster v1.10 On centos 7

I am using dedicated Server From OVH Provider

When I create Ingress

cat ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: jenkins 
spec:
  backend:
    serviceName: jenkins
    servicePort: 8080

kubectl get ing
NAME      HOSTS     ADDRESS   PORTS     AGE
jenkins   *                   80        3s

kubectl get svc
NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
jenkins                ClusterIP   10.254.104.80   <none>        8080/TCP         1d

Now I Can not access this Ingress from Out Side because I am using OVH Server.

Is there a solution?

-- AhmedMItman
kong
kubernetes
kubernetes-helm
kubernetes-ingress

1 Answer

9/29/2018

OVH is not officially supported by Kubernetes. It was supported then generally you would create a Service jenkins of the type LoadBalancer and that would be your externally facing endpoint with a public IP.

Since it's not supported the next best thing is to create a NodePort service. That will create a service that listens on a specific port on all the Kubernetes nodes and forwards the requests to your Pods (only where they are running). So, in this case, you will have to create an OVH Load Balancer with a public IP and point the backend of that load balancer to the NodePort of the service where your Ingress is listening on.

-- Rico
Source: StackOverflow