Provide a way to global.ingress.class so that the ingress is not at all populated with spec.ingressClass parameter

Summary

In the value.yaml please provide a way to remove spec.ingressClass from ingresses so as to use traefik. Previously the kubernetes doesn't mind if we set it empty. Now kubernetes asks for a valid value or remove the item.

Steps to reproduce

Install the charts with global.ingress.class as empty string.

Configuration used

postgresql:
  install: false
redis:
  install: false
certmanager:
  install: false
nginx-ingress:
  enabled: false
gitlab:
  webservice:
    ingress:
      annotations:
        cert-manager.io/cluster-issuer: "letsencrypt-prod-http"
      tls:
        secretName: git-crt-secret
    minReplicas: 1
    maxReplicas: 1
    resources:
      requests:
        cpu: 10m
        memory: 512Mi
    workhorse:
      resources:
        requests:
          cpu: 10m
          memory: 512Mi
  kas:
    minReplicas: 1
    maxReplicas: 1
  sidekiq:
    minReplicas: 1
    maxReplicas: 1
    resources:
      requests:
        cpu: 10m
        memory: 256Mi
  gitlab-grafana:
    ingress:
      annotations:
        cert-manager.io/cluster-issuer: "letsencrypt-prod-http"
      tls:
        secretName: git-crt-secret
  gitlab-shell:
    minReplicas: 1
    maxReplicas: 1
  gitaly:
    resources:
      requests:
        cpu: 50m
  shared-secrets:
    resources:
      requests:
        cpu: 10m
  migrations:
    resources:
      requests:
        cpu: 10m
  toolbox:
    resources:
      requests:
        cpu: 10m
    backups:
      cron:
        enabled: true
        schedule: 0 23 * * *
        extraArgs: '--skip lfs,uploads,artifacts,registry,packages'
      objectStorage:
        backend: 's3'
        config:
          secret: git-minio-secrets
          key: backupconnection
registry:
  ingress:
    annotations:
      cert-manager.io/cluster-issuer: "letsencrypt-prod-http"
    tls:
      secretName: git-dk-crt-secret
  hpa:
    minReplicas: 1
    maxReplicas: 1
  storage:
    secret: git-minio-secrets
    key: registryconnection
gitlab-runner:
  install: false
prometheus:
  server:
    resources:
      requests:
        cpu: 20m
  configmapReload:
    resources:
      requests:
        cpu: 10m
grafana:
  grafana.ini:
    server:
      root_url: https://git.example.com/-/grafana/
      serve_from_sub_path: true
  resources:
    requests:
      cpu: 20m
certmanager-issuer:
  email: xyz@gmail.com
global:
  edition: ce
  hosts:
    domain: git.example.com
    https: true
    externalIP: 10.1.2.1
    ssh: git.example.com
    gitlab:
      name: git.example.com
      https: true
    registry:
      name: dk.example.com
      https: true
  shell:
    port: 2222
  redis:
    host: git-redis
    port: 6379
    password:
      enabled: false
  psql:
    host: postgres.db
    port: 5432
    database: gitlabhq_production
    username: gitlabuser
    password:
      useSecret: true
      secret: gitlab-secrets
      key: POSTGRES_PASSWORD
  geo:
    enabled: true
    role: primary
  email:
    display_name: XXX Git
    from: noreply-git@example.com
    reply_to: noreply-git@example.com
  smtp:
    enabled: true
    address: smtp.example.com
    port: 25
    user_name: 'git@example.com'
    password:
      secret: gitlab-secrets
      key: email_password
    authentication: 'login'
  appConfig:
    incomingEmail:
      enabled: true
      address: git+%{key}@example.com
      user: git@example.com
      host: imap.example.com
      password:
        secret: gitlab-secrets
        key: email_password
    serviceDeskEmail:
      enabled: true
      address: git+%{key}@example.com
      user: git@example.com
      host: imap.example.com
      password:
        secret: gitlab-secrets
        key: email_password
    object_store:
      connection:
        secret: git-minio-secrets
        key: connection
    lfs:
      bucket: gitlab-lfs-storage
      connection:
        secret: git-minio-secrets
        key: connection
    artifacts:
      bucket: gitlab-artifacts-storage
      connection:
        secret: git-minio-secrets
        key: connection
    uploads:
      bucket: gitlab-uploads-storage
      connection:
        secret: git-minio-secrets
        key: connection
    packages:
      bucket: gitlab-packages-storage
      connection:
        secret: git-minio-secrets
        key: connection
    backups:
      bucket: gitlab-backup-storage
      tmpBucket: gitlab-tmp-storage
  registry:
    bucket: gitlab-registry-storage
  minio:
    enabled: false
  grafana:
    enabled: true
  ingress:
    enabled: true
    configureCertmanager: false
    class: ''
    annotations:
      'kubernetes.io/tls-acme': true
      'cert-manager.io/cluster-issuer': letsencrypt-prod-http
      'kubernetes.io/ingress.class': traefik
      'kubernetes.io/ingress.provider': traefik
      'traefik.ingress.kubernetes.io/router.entrypoints': websecure
      'traefik.ingress.kubernetes.io/router.tls': true

Current behavior

Error: UPGRADE FAILED: cannot patch "gitlab-grafana-app" with kind Ingress: Ingress.extensions "gitlab-grafana-app" is invalid: spec.ingressClassName: Invalid value: "": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)') && cannot patch "gitlab-kas" with kind Ingress: Ingress.extensions "gitlab-kas" is invalid: spec.ingressClassName: Invalid value: "": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)') && cannot patch "gitlab-webservice-default" with kind Ingress: Ingress.extensions "gitlab-webservice-default" is invalid: spec.ingressClassName: Invalid value: "": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)') && cannot patch "gitlab-registry" with kind Ingress: Ingress.extensions "gitlab-registry" is invalid: spec.ingressClassName: Invalid value: "": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)')

Expected behavior

It should remove spec.ingressClass from the ingress configurations.

Versions

  • Chart: 15.1.0
  • Platform:
    • Cloud: (GKE | AKS | EKS | ?)
    • Self-hosted: (OpenShift | Minikube | Rancher RKE | ?) Kubeadm
  • Kubernetes: (kubectl version)
    • Client: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:22:29Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
    • Server: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.2", GitCommit:"f66044f4361b9f1f96f0053dd46cb7dce5e990a8", GitTreeState:"clean", BuildDate:"2022-06-15T14:15:38Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
  • Helm: (helm version)
    • Client: version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}
    • Server: