<p>I have a simple node api service, mongo service and load balancer.</p>

<p>I am trying to deploy my application using kubernetes I get the following error when i run the command.</p>

<pre><code>- kubectl describe ing -n my-service
</code></pre>

<blockquote>
  <p>Warning  ERROR   5s (x2 over 8s)  aws-alb-ingress-controller  error
  instantiating load balancer: my-service-api service is not of type
  NodePort and target-type is instance</p>
</blockquote>

<pre><code>kind: Namespace
apiVersion: v1
metadata:
  name: my-service
  labels:
    name: my-service
---
#MongoDB
apiVersion: v1
kind: Service
metadata:
  name: mongo
  namespace: my-service
  labels:
    run: mongo
spec:
  ports:
  - port: 27017
    targetPort: 27017
    protocol: TCP
  selector:
    run: mongo
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mongo
  namespace: my-service
spec:
  template:
    metadata:
      labels:
        run: mongo
    spec:
      containers:
      - name: mongo
        image: mongo
        ports:
        - containerPort: 27017
---
apiVersion: v1
kind: Service
metadata:
  name: my-service-api
  namespace: my-service
  labels:
    app: my-service-api
spec:
  selector:
    app: my-service-api
  ports:
  - port: 3002
    protocol: TCP
    nodePort: 30002
  type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-service-api-deployment
  namespace: my-service
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: my-service-api
    spec:
      containers:
      - name: my-service-api
        image: &lt;removed&gt;
        imagePullPolicy: Always
        env: &lt;removed&gt;
        ports:
        - containerPort: 3002
      imagePullSecrets:
      - name: regcred
---
#LoadBalancer
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-service-api
  namespace: my-service
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/tags: Name=my-service-api,Owner=devops,Project=my-service,Stage=development
spec:
  rules:
    - host: &lt;removed&gt;
      http:
        paths:
          - path: /
            backend:
              serviceName: my-service-api
              servicePort: 3002
</code></pre>

<p>Can someone tell me what i am doing wrong here, thank you.</p>

<p>It seems that your <code>my-service-api</code> service type is "LoadBalancer", and you need to use <strong>"NodePort"</strong> in order to use <code>instance</code> for <code>alb.ingress.kubernetes.io/target-type:</code></p>

<p>May be this closed <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/458" rel="nofollow noreferrer">github issue</a> can be useful for you</p>
