argoproj / argo-helm

ArgoProj Helm Charts
https://argoproj.github.io/argo-helm/
Apache License 2.0
1.72k stars 1.86k forks source link

Problem with TLS ingress #2964

Open Youpiiiii opened 2 weeks ago

Youpiiiii commented 2 weeks ago

Describe the bug

Bad generation of ingress

Related helm chart

argo-cd

Helm chart version

7.6.8

To Reproduce

helm install argocd argo/argo-cd -f argo-cd/values.yaml --dry-run With this values:

server:
  ingress:
    enabled: true
    tls: true

Generate this ingress:

# Source: argo-cd/templates/argocd-server/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server
  namespace: "argocd"
  labels:
    helm.sh/chart: argo-cd-5.36.7
    app.kubernetes.io/name: argocd-server
    app.kubernetes.io/instance: argocd
    app.kubernetes.io/component: server
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: argocd
    app.kubernetes.io/version: v2.7.6
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: argocd-server
                port:
                  number: 80
  tls:
    true

Why tls: true ?

Expected behavior

# Source: argo-cd/templates/argocd-server/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server
  namespace: "argocd"
  labels:
    helm.sh/chart: argo-cd-5.36.7
    app.kubernetes.io/name: argocd-server
    app.kubernetes.io/instance: argocd
    app.kubernetes.io/component: server
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: argocd
    app.kubernetes.io/version: v2.7.6
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: argocd-server
                port:
                  number: 80
  tls:
    - secretName: argocd-server-tls
      hosts:
      - argocd.example.com

Screenshots

No response

Additional context

No response

mkilchhofer commented 4 days ago

Are you sure? Your reprod steps are inconsistent. You are talking about helm chart version 7.6.8 and your rendered YAML says:

# ..
  labels:
    helm.sh/chart: argo-cd-5.36.7 # <- this means chart version 5.36.7
# ..

You need to update the Helm chart version to the latest (2 new Major versions) to use tls: true. The Helm chart version 5.36.x is using another structure:

https://github.com/argoproj/argo-helm/blob/172ce600a1d686d3de1ba4967a07a8bbe7c121f1/charts/argo-cd/templates/argocd-server/ingress.yaml#L86-L89


Update: Ah maybe you are using an old repo cache as your command does not specify a version excplicitly

- helm install argocd argo/argo-cd -f argo-cd/values.yaml --dry-run
+ helm install argocd argo/argo-cd -f argo-cd/values.yaml --version 7.6.8 --dry-run