[BUG] Specifying a Custom Ingress hotsname via ingress.hosts[0].host removes all the default Ingress config #674

Open
opened 2024-07-04 02:26:27 +00:00 by adamency · 0 comments
adamency commented 2024-07-04 02:26:27 +00:00 (Migrated from gitea.com)

When trying to specify a custom host for our ingress resource via the chart variable designed for it, this actually removes all the other ingress config, i.e. the path, service selector, etc... and we need to specify this all manually by hand. This is not how this should work, and not how this work for any chart for other major projects.

Code illustration:

  1. No custom host:

override.yaml:

ingress:
  enabled: true
  className: nginx

Resulting Ingress:

# Source: gitea/templates/gitea/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gitea
  labels:
    helm.sh/chart: gitea-10.2.0
    app: gitea
    app.kubernetes.io/name: gitea
    app.kubernetes.io/instance: gitea
    app.kubernetes.io/version: "1.22.0"
    version: "1.22.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
spec:
  ingressClassName: nginx
  rules:
    - host: "git.example.com"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: gitea-http
                port:
                  number: 3000
  1. Custom host:

override.yaml:

ingress:
  enabled: true
  className: nginx
  hosts:
    - host: git.<mydomain>

Resulting Ingress:

# Source: gitea/templates/gitea/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gitea
  labels:
    helm.sh/chart: gitea-10.2.0
    app: gitea
    app.kubernetes.io/name: gitea
    app.kubernetes.io/instance: gitea
    app.kubernetes.io/version: "1.22.0"
    version: "1.22.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
spec:
  ingressClassName: nginx
  rules:
    - host: "git.<mydomain>"
      http:
        paths:

The user then needs to specify manually:

      paths:
        - path: /
          pathType: Prefix

Setting a custom hostname shouldn't override the paths for the hostname, and this is again how this is done for all major charts.

When trying to specify a custom host for our ingress resource via the chart variable designed for it, this actually removes all the other ingress config, i.e. the `path`, service selector, etc... and we need to specify this all manually by hand. This is not how this should work, and not how this work for any chart for other major projects. Code illustration: 1. No custom host: `override.yaml`: ``` ingress: enabled: true className: nginx ``` Resulting `Ingress`: ``` # Source: gitea/templates/gitea/ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: gitea labels: helm.sh/chart: gitea-10.2.0 app: gitea app.kubernetes.io/name: gitea app.kubernetes.io/instance: gitea app.kubernetes.io/version: "1.22.0" version: "1.22.0" app.kubernetes.io/managed-by: Helm annotations: spec: ingressClassName: nginx rules: - host: "git.example.com" http: paths: - path: / pathType: Prefix backend: service: name: gitea-http port: number: 3000 ``` 2. Custom host: `override.yaml`: ``` ingress: enabled: true className: nginx hosts: - host: git.<mydomain> ``` Resulting `Ingress`: ``` # Source: gitea/templates/gitea/ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: gitea labels: helm.sh/chart: gitea-10.2.0 app: gitea app.kubernetes.io/name: gitea app.kubernetes.io/instance: gitea app.kubernetes.io/version: "1.22.0" version: "1.22.0" app.kubernetes.io/managed-by: Helm annotations: spec: ingressClassName: nginx rules: - host: "git.<mydomain>" http: paths: ``` The user then needs to specify manually: ``` paths: - path: / pathType: Prefix ``` Setting a custom hostname shouldn't override the `paths` for the hostname, and this is again how this is done for all major charts.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#674
No description provided.