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
asked 8 months ago1204 views
1 Answer
2
Accepted Answer

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
answered 8 months ago
profile picture
EXPERT
reviewed 8 months ago
  • Thanks, now it is working, perfectly.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions