Ingress Cotroller in EKS The Address is empty

0

When I create my apps,

apiVersion: v1
kind: Service
metadata:
  name: svc-shield
spec:
  type: ClusterIP
  ports:
  - port: 8080
    targetPort: 8080
  selector:
    env: shield
---
apiVersion: v1
kind: Service
metadata:
  name: svc-hydra
spec:
  type: ClusterIP
  ports:
  - port: 8080
    targetPort: 8080
  selector:
    env: hydra
---
apiVersion: v1
kind: Pod
metadata:
  name: shield
  labels:
    env: shield
spec:
  containers:
  - image: nigelpoulton/k8sbook:shield-ingress
    name: shield-ctr
    ports:
    - containerPort: 8080
    imagePullPolicy: Always
---
apiVersion: v1
kind: Pod
metadata:
  name: hydra
  labels:
    env: hydra
spec:
  containers:
  - image: nigelpoulton/k8sbook:hydra-ingress
    name: hydra-ctr
    ports:
    - containerPort: 8080
    imagePullPolicy: Always

then create my Ingress,

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: mcu-all
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx
  rules:
  - host: shield.mcu.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: svc-shield
            port:
              number: 8080
  - host: hydra.mcu.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: svc-hydra
            port:
              number: 8080
  - host: mcu.com
    http:
      paths:
      - path: /shield
        pathType: Prefix
        backend:
          service:
            name: svc-shield
            port:
              number: 8080
      - path: /hydra
        pathType: Prefix
        backend:
          service:
            name: svc-hydra
            port:
              number: 8080

But When I describe my ingress, the ADDRESS is empty

kubectl get ingress

NAMECLASSHOSTSADDRESSPORTSAGE
mcu-allnginxhield.mcu.com,hydra.mcu.com,mcu.com807m8s
profile picture
preguntada hace 8 meses1263 visualizaciones
1 Respuesta
2
Respuesta aceptada

Hello,

From you ingress manifest, I see that you are using NGINX Ingress Controller, from this specification ingressClassName: nginx. You can either use the NGINX Ingress Controller or the AWS Load Balancer Controller to manage AWS Elastic Load Balancers for your Kubernetes cluster.

You can troubleshoot the issue by following the steps below:

  1. Ensure you have NGINX Ingress Controller pod in running state. Run the command below:
kubectl get pods -n ingress-nginx

Expected result should look like this:

NAME                                        READY   STATUS    RESTARTS   AGE
ingress-nginx-controller-79d66f886c-sh2tk   1/1     Running   0          18h

If you don't have any output returned, it implies that you do not have NGINX Ingress Controller installed in your cluster. Follow the instruction here to install it or you can install the AWS Load Balancer Controller add-on. If you intend to use the AWS Load Balancer Controller, then you will need to make a simple modification to your ingress manifest. Refer to the example here

  1. If you have the NGINX Ingress Controller installed, view the logs of the NGINX Ingress Controller pod for possible errors
kubectl logs -f ingress-nginx-controller-79d66f886c-sh2tk -n ingress-nginx

We have a comprehensive blog here on Exposing Kubernetes Applications: https://aws.amazon.com/blogs/containers/exposing-kubernetes-applications-part-3-nginx-ingress-controller/

AWS
Olawale
respondido hace 8 meses
profile picture
EXPERTO
revisado hace 8 meses
  • Thanks, now it is working, perfectly.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas