简体   繁体   中英

How to expose nginx ingress to the public url in EKS

I have ingress in my AWS EKS:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: example.com
    http:
      paths:
        - path: /
          backend:
            serviceName: my-service-example
            servicePort: 80 

Ingress will redirect all trafic on domain example.com to my-service-example

The problem is, that ingress is without public url, how can I expose this ingress to the public inte.net?

You need a load balancer controller in your cluster for make a connection to you kube.netes service (nginx, istio, aws load balancer controller).

In this case you don't say what kind of ingress do you have install in your cluster, so i recommend use the official ingress controller of aws for eks, for the installation of this controller please follow this doc , later you need change your ingress object adding these lines in your annotations block:

  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip

With that the AWS Load Balancer Controller interact with the AWS API for create a Application Load Balancer in your Public Su.nets because in the annotations the scheme is inte.net-facing

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