Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: InvalidParameter: 1 validation error(s) found.\n- minimum field value of 1, CreateTargetGroupInput.Port.\n #1695

Closed
bugok opened this issue Nov 30, 2020 · 9 comments

Comments

@bugok
Copy link

bugok commented Nov 30, 2020

Context: Running using helm, chart version 1.0.8, application version 2.0.1.
I've applied the crds (using kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master") and installed alb ingress controller using helm.

When deploying the following ingress (as part of my application packaged in a helm chart), I get the mentioned error:

# Source: myapp/templates/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: myapp
  labels:
    helm.sh/chart: myapp-0.1.6
    app.kubernetes.io/name: myapp
    app.kubernetes.io/instance: myapp
    app.kubernetes.io/version: "1.16.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    kubernetes.io/ingress.class: alb
    external-dns.alpha.kubernetes.io/hostname: "sub.mydomain.com"
spec:
  rules:
    - host: "*.sub.mydomain.com"
      http:
        paths:
          - path: "/"
            backend:
              serviceName: myapp
              servicePort: 80

I'd be happy to supply more information.

@kishorj
Copy link
Collaborator

kishorj commented Nov 30, 2020

@bugok, Is your service type NodePort? This error is similar to #1656.

@bugok
Copy link
Author

bugok commented Nov 30, 2020

@kishorj : no, it's ClusterIP.

Looking at #1644, I also am trying to migrate from nginx ingress controller. Maybe that helps.

@bugok
Copy link
Author

bugok commented Nov 30, 2020

@kishorj : I misinterpreted your previous message. After changing the service type to NodePort, the applying the ingress worked.

Can you please explain why this is happening? Is there any documentation about setting services as NodePort as a requirement for using as-load-balancer-controller which I missed?

@kishorj
Copy link
Collaborator

kishorj commented Nov 30, 2020

Instance mode will require at least NodePort service type. With NodePort service type, kube-proxy will open a port on your worker node instances to which the ALB can route traffic.
Doc references -
https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/spec/
https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/

@bugok
Copy link
Author

bugok commented Nov 30, 2020

Thanks for the clarification and the doc references.

Closing.

@kreempuff
Copy link
Contributor

I just ran into this. Is there a better error message that we can have to illuminate the problem a little better?

The default seems to be instance mode when the annotation is not specified but the error message reads as if a port was not specified.

@denwork
Copy link

denwork commented May 28, 2021

May be try this annotations.
alb.ingress.kubernetes.io/target-type: 'ip'

@domenjesenovec
Copy link

@denwork : Thanks, that worked! To clarify, add the annotation alb.ingress.kubernetes.io/target-type: 'ip' to the service. From the original example in the first post - on service myapp.

@ThangLeQuoc
Copy link

Adding reference to the answer of @denwork about the target-type annotation (@kishorj already posted the link to the annotation above, I just try to make it more precise)
https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.5/guide/ingress/annotations/#target-type

Instance mode:

instance mode will route traffic to all ec2 instances within cluster on NodePort opened for your service.
compare with ip mode

Ip mode:

ip mode will route traffic directly to the pod IP.

Highly recommend you to checkout the two document resources from @kishorj answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants