Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

[common] Ingress fails to deploy with named service port #165

Open
rlex opened this issue May 26, 2022 · 1 comment
Open

[common] Ingress fails to deploy with named service port #165

rlex opened this issue May 26, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@rlex
Copy link

rlex commented May 26, 2022

Helm chart name

vaultwarden

Helm chart version

4.2.3

Container name

vaultwarden/server

Container tag

1.25.0

Description

When installing with example from values.yaml for ingress, notably paths part: https://github.com/k8s-at-home/charts/blob/master/charts/stable/vaultwarden/values.yaml#L44-L56

Install fails with following error:

  Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend.service.port.number): invalid type for io.k8s.api.networking.v1.ServiceBackendPort.number: got "string", expected "integer", ValidationError(Ingress.spec.rules[0].http.paths[1].backend.service.port.number): invalid type for io.k8s.api.networking.v1.ServiceBackendPort.number: got "string", expected "integer", ValidationError(Ingress.spec.rules[0].http.paths[2].backend.service.port.number): invalid type for io.k8s.api.networking.v1.ServiceBackendPort.number: got "string", expected "integer"]

Replacing port names with numbers fixes issue:

                paths:
                  - path: /
                    pathType: Prefix
                    service:
                      port: 80
                  - path: /notifications/hub/negotiate
                    pathType: Prefix
                    service:
                      port: 80
                  - path: /notifications/hub
                    pathType: Prefix
                    service:
                      port: 3012

Expected result

Ingress should be deployed without errors

Helm values to reproduce

ingress:
  # -- Enable and configure ingress settings for the chart under this key.
  # @default -- See values.yaml
  main:
    enabled: true
    hosts:
      - host: chart-example.local
        paths:
          - path: /
            pathType: Prefix
            service:
              port: http
          - path: /notifications/hub/negotiate
            pathType: Prefix
            service:
              port: http
          - path: /notifications/hub
            pathType: Prefix
            service:
              port: websocket

Additional Information

No response

Repo link

No response

@rlex rlex added the bug Something isn't working label May 26, 2022
@bjw-s
Copy link
Contributor

bjw-s commented May 27, 2022

Thanks for the bug report!
It looks to be caused by https://github.com/k8s-at-home/library-charts/blob/main/charts/stable/common/templates/classes/_ingress.tpl#L75, which always expects there to be a number. I am transferring this issue to the library-charts repo so that we can fix it there.

@bjw-s bjw-s transferred this issue from k8s-at-home/charts May 27, 2022
@bjw-s bjw-s changed the title [vaultwarden] Ingress fails to deploy with example from values.yaml [common] Ingress fails to deploy with named service port May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants