devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.22k stars 353 forks source link

Component chart can't create an ingress #2402

Open withinboredom opened 1 year ago

withinboredom commented 1 year ago

What happened?

I tried to deploy a simple component chart pointing to an existing service:

    helm:
      chart:
        name: component-chart
        repo: https://charts.devspace.sh
      values:
        ingress:
          ingressClassName: nginx
          annotations:
            cert-manager.io/issue-temporary-certificate: 'true'
          rules:
            - host: db-admin.internal.${DOMAIN}
              path: /
              pathType: Prefix
              backend:
                service:
                  name: db-admin-${DEVSPACE_NAMESPACE}
                  port:
                    number: 8080
          tls: true
          tlsClusterIssuer: letsencrypt

Instead of a successful deployment, I receive the error:

error executing 'helm upgrade ingress --values /tmp/3388380188 --install --namespace withinboredom /home/withinboredom/.devspace/component-chart/component-chart-0.8.5.tgz --kube-context loft_withinboredom_loft-cluster': Error: UPGRADE FAILED: template: component-chart/templates/ingress.yaml:87:18: executing "component-chart/templates/ingress.yaml" at <index $.Values.service.ports 0>: error calling index: reflect: slice index out of range

When putting in a dummy service, the service name in my ingress is changed to reflect the name of that service instead of the one I set.

What did you expect to happen instead?

To be able to create an ingress to an arbitrary service.

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: v2beta1
name: test
deployments:
  ingress:
    .... # see above

Local Environment:

Anything else we need to know?

FabianKramm commented 1 year ago

@withinboredom thanks for the issue! Not sure that is actually inteded use for the DevSpace chart, but we'll take a look at this.