argoproj / argo-cd

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

argocd not find values files in source dir #10524

Closed Syntax3rror404 closed 1 year ago

Syntax3rror404 commented 2 years ago

Checklist:

Describe the bug

I used a git with some templates with many applications. I have a templates folder for the helm templates and a values dir which includes the values from specific apps to keep it clean. If I sync that to argo argo sad for example: Error: open /tmp/48059b68-23ff-495f-8bec-2097fb796f38/nfs-subdir-external-provisioner/values/nfs-csi.yaml: no such file or directory To Reproduce For example a nfs provisioner Note that the values file which not work is source.helm.valueFiles:

/apps/argocd/templates/nfs-csi.yaml
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: nfs-csi
  namespace: argocd
spec:
  destination:
    namespace: nfs-csi
    server: {{ .Values.spec.destination.server }}
  project: default
  source:
    helm:
      valueFiles:
        - values/nfs-csi.yaml
    path: '.'
    repoURL: {{ .Values.spec.nfsCsi.source.repoURL }}
    targetRevision: {{ .Values.spec.nfsCsi.source.targetRevision }}
    chart: nfs-subdir-external-provisioner
  syncPolicy:
    automated:
      prune: false
      selfHeal: true
      allowEmpty: true
    syncOptions:
    - CreateNamespace=true

and the value file from source dir which argocd find:

/apps/argocd/values.yaml
---
spec:
  destination:
    server: https://kubernetes.default.svc
  nfsCsi:
    source:
      repoURL: "https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/"
      targetRevision: 4.0.17

and now the buggy one to fill the values from the specific application:

/apps/argocd/values/nfs-csi.yaml
---
nfs:
  server: 192.168.33.99
  path: /tank/nfs/kubernetes

Expected behavior

Argo find the files and creates the application Screenshots

Version

2.4.11

Logs

rpc error: code = Unknown desc = Manifest generation error (cached): `helm template . --name-template nfs-csi --namespace nfs-csi --kube-version 1.24 --values /tmp/48059b68-23ff-495f-8bec-2097fb796f38/nfs-subdir-external-provisioner/values/nfs-csi.yaml --api-versions admissionregistration.k8s.io/v1 --api-versions admissionregistration.k8s.io/v1/MutatingWebhookConfiguration --api-versions admissionregistration.k8s.io/v1/ValidatingWebhookConfiguration --api-versions apiextensions.k8s.io/v1 --api-versions apiextensions.k8s.io/v1/CustomResourceDefinition --api-versions apiregistration.k8s.io/v1 --api-versions apiregistration.k8s.io/v1/APIService --api-versions apps/v1 --api-versions apps/v1/ControllerRevision --api-versions apps/v1/DaemonSet --api-versions apps/v1/Deployment --api-versions apps/v1/ReplicaSet --api-versions apps/v1/StatefulSet --api-versions argoproj.io/v1alpha1 --api-versions argoproj.io/v1alpha1/AppProject --api-versions argoproj.io/v1alpha1/Application --api-versions argoproj.io/v1alpha1/ApplicationSet --api-versions argoproj.io/v1alpha1/ArgoCDExtension --api-versions autoscaling/v1 --api-versions autoscaling/v1/HorizontalPodAutoscaler --api-versions autoscaling/v2 --api-versions autoscaling/v2/HorizontalPodAutoscaler --api-versions autoscaling/v2beta1 --api-versions autoscaling/v2beta1/HorizontalPodAutoscaler --api-versions autoscaling/v2beta2 --api-versions autoscaling/v2beta2/HorizontalPodAutoscaler --api-versions awx.ansible.com/v1beta1 --api-versions awx.ansible.com/v1beta1/AWX --api-versions awx.ansible.com/v1beta1/AWXBackup --api-versions awx.ansible.com/v1beta1/AWXRestore --api-versions batch/v1 --api-versions batch/v1/CronJob --api-versions batch/v1/Job --api-versions batch/v1beta1 --api-versions batch/v1beta1/CronJob --api-versions catalog.cattle.io/v1 --api-versions catalog.cattle.io/v1/App --api-versions catalog.cattle.io/v1/ClusterRepo --api-versions catalog.cattle.io/v1/Operation --api-versions certificates.k8s.io/v1 --api-versions certificates.k8s.io/v1/CertificateSigningRequest --api-versions coordination.k8s.io/v1 --api-versions coordination.k8s.io/v1/Lease --api-versions crd.projectcalico.org/v1 --api-versions crd.projectcalico.org/v1/BGPConfiguration --api-versions crd.projectcalico.org/v1/BGPPeer --api-versions crd.projectcalico.org/v1/BlockAffinity --api-versions crd.projectcalico.org/v1/CalicoNodeStatus --api-versions crd.projectcalico.org/v1/ClusterInformation --api-versions crd.projectcalico.org/v1/FelixConfiguration --api-versions crd.projectcalico.org/v1/GlobalNetworkPolicy --api-versions crd.projectcalico.org/v1/GlobalNetworkSet --api-versions crd.projectcalico.org/v1/HostEndpoint --api-versions crd.projectcalico.org/v1/IPAMBlock --api-versions crd.projectcalico.org/v1/IPAMConfig --api-versions crd.projectcalico.org/v1/IPAMHandle --api-versions crd.projectcalico.org/v1/IPPool --api-versions crd.projectcalico.org/v1/IPReservation --api-versions crd.projectcalico.org/v1/KubeControllersConfiguration --api-versions crd.projectcalico.org/v1/NetworkPolicy --api-versions crd.projectcalico.org/v1/NetworkSet --api-versions discovery.k8s.io/v1 --api-versions discovery.k8s.io/v1/EndpointSlice --api-versions discovery.k8s.io/v1beta1 --api-versions discovery.k8s.io/v1beta1/EndpointSlice --api-versions events.k8s.io/v1 --api-versions events.k8s.io/v1/Event --api-versions events.k8s.io/v1beta1 --api-versions events.k8s.io/v1beta1/Event --api-versions flowcontrol.apiserver.k8s.io/v1beta1 --api-versions flowcontrol.apiserver.k8s.io/v1beta1/FlowSchema --api-versions flowcontrol.apiserver.k8s.io/v1beta1/PriorityLevelConfiguration --api-versions flowcontrol.apiserver.k8s.io/v1beta2 --api-versions flowcontrol.apiserver.k8s.io/v1beta2/FlowSchema --api-versions flowcontrol.apiserver.k8s.io/v1beta2/PriorityLevelConfiguration --api-versions helm.cattle.io/v1 --api-versions helm.cattle.io/v1/HelmChart --api-versions helm.cattle.io/v1/HelmChartConfig --api-versions k3s.cattle.io/v1 --api-versions k3s.cattle.io/v1/Addon --api-versions management.cattle.io/v3 --api-versions management.cattle.io/v3/APIService --api-versions management.cattle.io/v3/AuthConfig --api-versions management.cattle.io/v3/Cluster --api-versions management.cattle.io/v3/ClusterRegistrationToken --api-versions management.cattle.io/v3/Feature --api-versions management.cattle.io/v3/Group --api-versions management.cattle.io/v3/GroupMember --api-versions management.cattle.io/v3/Preference --api-versions management.cattle.io/v3/Setting --api-versions management.cattle.io/v3/Token --api-versions management.cattle.io/v3/User --api-versions management.cattle.io/v3/UserAttribute --api-versions networking.k8s.io/v1 --api-versions networking.k8s.io/v1/Ingress --api-versions networking.k8s.io/v1/IngressClass --api-versions networking.k8s.io/v1/NetworkPolicy --api-versions node.k8s.io/v1 --api-versions node.k8s.io/v1/RuntimeClass --api-versions node.k8s.io/v1beta1 --api-versions node.k8s.io/v1beta1/RuntimeClass --api-versions operator.tigera.io/v1 --api-versions operator.tigera.io/v1/APIServer --api-versions operator.tigera.io/v1/ImageSet --api-versions operator.tigera.io/v1/Installation --api-versions operator.tigera.io/v1/TigeraStatus --api-versions policy/v1 --api-versions policy/v1/PodDisruptionBudget --api-versions policy/v1beta1 --api-versions policy/v1beta1/PodDisruptionBudget --api-versions policy/v1beta1/PodSecurityPolicy --api-versions rbac.authorization.k8s.io/v1 --api-versions rbac.authorization.k8s.io/v1/ClusterRole --api-versions rbac.authorization.k8s.io/v1/ClusterRoleBinding --api-versions rbac.authorization.k8s.io/v1/Role --api-versions rbac.authorization.k8s.io/v1/RoleBinding --api-versions scheduling.k8s.io/v1 --api-versions scheduling.k8s.io/v1/PriorityClass --api-versions storage.k8s.io/v1 --api-versions storage.k8s.io/v1/CSIDriver --api-versions storage.k8s.io/v1/CSINode --api-versions storage.k8s.io/v1/CSIStorageCapacity --api-versions storage.k8s.io/v1/StorageClass --api-versions storage.k8s.io/v1/VolumeAttachment --api-versions storage.k8s.io/v1beta1 --api-versions storage.k8s.io/v1beta1/CSIStorageCapacity --api-versions ui.cattle.io/v1 --api-versions ui.cattle.io/v1/NavLink --api-versions upgrade.cattle.io/v1 --api-versions upgrade.cattle.io/v1/Plan --api-versions v1 --api-versions v1/ConfigMap --api-versions v1/Endpoints --api-versions v1/Event --api-versions v1/LimitRange --api-versions v1/Namespace --api-versions v1/Node --api-versions v1/PersistentVolume --api-versions v1/PersistentVolumeClaim --api-versions v1/Pod --api-versions v1/PodTemplate --api-versions v1/ReplicationController --api-versions v1/ResourceQuota --api-versions v1/Secret --api-versions v1/Service --api-versions v1/ServiceAccount --include-crds` failed exit status 1: Error: open /tmp/48059b68-23ff-495f-8bec-2097fb796f38/nfs-subdir-external-provisioner/values/nfs-csi.yaml: no such file or directory
ItsJustMagic commented 2 years ago

I'm also having the same issue, unable to find the files specified in spec.source.helm.valueFiles

Syntax3rror404 commented 2 years ago

Can anyone help us out please?

JJotah commented 1 year ago

I'm also having the same issue, Error: failed parsing --set-file data: open /tmp/1f78e055-4d33-4837-ab36-af50d56a3a18/app-of-apps/examples/test

crazyproger commented 1 year ago

https://argo-cd.readthedocs.io/en/latest/user-guide/multiple_sources/#helm-value-files-from-external-git-repository

working solution

crenshaw-dev commented 1 year ago

I think @crazyproger's solution is correct.

By default, the values file must reside in the same repo as the Helm chart. With multi-source apps, you can pull a values file from a different repo for use in a Helm chart.