Unable to create ingress and load balancer in k8s

12/16/2019

I have created one load balancer service using the following configuration:-

  apiVersion: v1
  kind: Service
  metadata:
    name: dealer-service-elb
    namespace: staging
    labels:
      service: dealer-service-elb
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-type: nlb
      service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
  spec:
    type: LoadBalancer
    selector:
      service: dealer-service
    ports:
      - name: 'http'
        port: 80
        targetPort: 3000
        protocol: 'TCP'

and my aws alb looks like this:-

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dealer-service-ingress
  labels:
    app: dealer-service
  namespace: staging
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internal
    alb.ingress.kubernetes.io/healthcheck-path: /dealers-service/v1/health
    alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
spec:
  rules:
  - http:
      paths:
      - path: /*
        backend:
          serviceName: dealer-service
          servicePort: 80

But when I checked my ingress using kubectl command:-

I did not find my ingress url:-

NAME                     HOSTS   ADDRESS   PORTS   AGE
dealer-service-ingress   *                 80      34m
-- Atul Agrawal
amazon-web-services
aws-eks
kubernetes

0 Answers