bjw-s / helm-charts

A collection of Helm charts
https://bernd-schorgers.github.io/helm-charts/
Apache License 2.0
566 stars 106 forks source link

Ingress port must be of type Int32 #152

Closed conneryn closed 12 months ago

conneryn commented 1 year ago

Details

What steps did you take and what happened:

I tried to deploy the example app based on the template provided (which specifies the ingress's backend service port as the strings http and websockets, rather than a number).

But I get the error:

cannot unmarshal string into Go struct field ServiceBackendPort.spec.rules.http.paths.backend.service.port.number of type int32

What did you expect to happen:

I expected the example template to work out of the box. Additionally, the examples themselves made me think I would be able to specify the ingress' backend service ports via their service port name, rather than just a numbered port.

Anything else you would like to add:

The Ingress resources' ServiceBackenPort allows for either a number or name property. So, it could be possible to support this usage if we wanted

Side question: I am noticing that there is little-to-no reference/examples in the main Kubernetes documentation to using the service port name as reference... is it's usage really uncommon and/or discouraged for some reason I am unaware of?

Additional Information:

I'd be happy to help with a PR, but would first look for guidance on your preferred solution. Example:

  1. Just update the examples/docs to use the port numbers (or &/* yaml anchors/aliases)
  2. Update the template Chart itself to support allowing port name references (ex: using kindIs or an explicit portName property)
  3. Both
  4. Something else?
bjw-s commented 1 year ago

Hi! Sorry it took a while to get back to you on this. Time has been rather elusive lately :( I do believe this is something that should work, but I'll need to find some time to dig in to what's happening a little bit further

bjw-s commented 12 months ago

I've updated the example and targetPort logic to use numbered port instead of named ports.