argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.06k stars 5.52k forks source link

CRD's in helm chart are not installed #3784

Open rgoldfinger-quizlet opened 4 years ago

rgoldfinger-quizlet commented 4 years ago

Checklist:

Describe the bug

When installing a Helm chart that includes CRD's, the CRD's are not installed.

To Reproduce

Install the following application:


apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: traefik
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  destination:
    namespace: argocd
    server: {{ .Values.clusterIP }}
  project: {{ .Values.project }}
  source:
    chart: traefik
    repoURL: https://containous.github.io/traefik-helm-chart
    targetRevision: 8.5.0
  syncPolicy:
    automated:
        prune: true

The installation fails because the CRD's are missing.

Expected behavior

The CRD's included in the chart are installed.

Version

argocd: v1.5.5+0fdef48
  BuildDate: 2020-05-16T04:05:28Z
  GitCommit: 0fdef4861e12026e133224f7c9413072340e2983
  GitTreeState: clean
  GoVersion: go1.14.1
  Compiler: gc
  Platform: darwin/amd64
argocd-server: v1.5.8+47f43f9
  BuildDate: 2020-06-16T19:33:19Z
  GitCommit: 47f43f9256246be7374064e783a6ec68d74a28c1
  GitTreeState: clean
  GoVersion: go1.14.1
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: {Version:kustomize/v3.6.1 GitCommit:c97fa946d576eb6ed559f17f2ac43b3b5a8d5dbd BuildDate:2020-05-27T20:47:35Z GoOs:linux GoArch:amd64}
  Helm Version: version.BuildInfo{Version:"v3.2.0", GitCommit:"e11b7ce3b12db2941e90399e874513fbd24bcb71", GitTreeState:"clean", GoVersion:"go1.13.10"}
  Kubectl Version: v1.14.0
kaiyou commented 4 years ago

Facing the same issue. From what I gather, ArgoCD picks the helm version here: https://github.com/argoproj/argo-cd/blob/master/util/helm/helmver.go#L57

Also, traefik v2 helm chart from https://containous.github.io/traefik-helm-chart includes two apiVersion statements to declare both compatibility to helm 2 and helm 3. I am guessing this is the root cause.

bencompton commented 4 years ago

Same problem here with Traefik. I might be overlooking something, but I'm not seeing the two apiVersion statements; I just see v1 here. Doesn't seem like an Argo CD problem to me. Just installing the CRDs separately from the chart in Argo CD for now. 🤷

randrusiak commented 4 years ago

I have the same problem. I guess it's caused because argo-cd uses helm template under the hood instead of install

chamarakera commented 3 years ago

@randrusiak - Please check if your Chart's apiVersion is v1. If so it has to be changed to apiVersion: v2 https://helm.sh/docs/topics/v2_v3_migration/

AgentK20 commented 3 years ago

Thanks @ckeragala for pointing this out. Discovered your comment after hours of scratching my head over why CRDs from an upstream project weren't being deployed.

jonanderson10 commented 3 years ago

FYI to anyone with this issue in an upstream chart (off-the-shelf) you can place the manifest of your CRDs into the templates folder of your "chart" that is referencing the upstream as a workaround.

mstrzele commented 3 years ago

As a workaround, you can always force the application to use Helm v3 as it should handle the charts in both versions (apiVersion: v1 and apiVersion: v2).

apiVersion: argoproj.io/v1alpha1
kind: Application
# ...
spec:
  source:
    # ...
    helm:
      # ...
      version: v3
  # ...
brodin commented 1 year ago

I am still struggling with this and can't get past 3.2.x :/

Any advice?

worldsayshi commented 6 months ago

In case you end up here you might have the same problem as me. Don't forget to whitelist the helm chart in the sourceRepos list in the AppProject!