简体   繁体   中英

How to assign Public IP to Kubernetes's Ingress

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM