Aws-load-balancer-controller: Ingress controller listen ports ValidationError

Created on 2 Aug 2018  路  7Comments  路  Source: kubernetes-sigs/aws-load-balancer-controller

Still see listen port error with beta.5,
image: quay.io/coreos/alb-ingress-controller:1.0-beta.5

error: error validating "abc-ingress.yaml": error validating data: ValidationError(Ingress.metadata.annotations.alb.ingress.kubernetes.io/listen-ports): invalid type for io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.annotations: got "array", expected "string"; if you choose to ignore these errors, turn validation off with --validate=false

alb.ingress.kubernetes.io/listen-ports: [{"HTTP": 9001}]

Most helpful comment

You can pass the array as text like this too

annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/listen-ports: |
      [{"HTTP": 80}, {"HTTPS": 443}, {"HTTP": 8080}, {"HTTPS": 8443}]

All 7 comments

The value of the annotation must be in quotes. Try putting it inside of ``'s

Cool, thanks.

I'm currently using the image version v1.1.1, I'm deploying via helm chart and I'm always getting validation error for annotation parameter "alb.ingress.kubernetes.io/listen-ports":
kubebuilder/controller "msg"="Reconciler error" "error"="listen-ports JSON structure was invalid: invalid character 'm' looking for beginning of value" "controller"="alb-ingress-controller"

If I don't insert any value I have the above error, otherwise passing custom values I still have formatting issue, some examples:
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/listen-ports: '{0: {"HTTP": 80}}'
I have already tried different formatting but can't figured out how to workaround the problem.

@etessari
Hi, the alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]' should worked out well. (I just tested it).

You can find examples on how to specify multiple ports: https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/#listen-ports

@M00nF1sh thanks for the reply.
For me assigning service type "nodePort" seems to solve the issue, but with type "LoadBalancer" I still get the formatting issue.

umm, the type on service shouldn't matter in this case(i.e. shouldn't cause the formatting error).

The default controller yaml config don't output success information(which might confuse you with out-dated error message), would you help adding an "-v=1" argument to the controller yaml(similar to --ingress-class=alb but with single -). So that whenever the controller sucessfully provision & configured ALB for you, you'll see an "successfully reconciled" message.

You can pass the array as text like this too

annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/listen-ports: |
      [{"HTTP": 80}, {"HTTPS": 443}, {"HTTP": 8080}, {"HTTPS": 8443}]
Was this page helpful?
0 / 5 - 0 ratings