argoproj / argo-cd

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

Multiple sources for helm chart is not working as inteded #14536

Closed pawellrus closed 1 year ago

pawellrus commented 1 year ago

Checklist:

Describe the bug

I am trying to install application from helm chart with additional got source with values file. I set application according to docs but it is not working as intended. ArgoCD throws an error

Error: open .argocd/apps/values/postgresql.yml: no such file or directory

To Reproduce

Repo structure is following:

/
argocd
     \_root_application\
         \root-application.yaml
     \apps\
         \templates\
              \postgresql.yaml
          \values\
              \postgresql.yaml
          \Chart.yaml

root-application.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: infra-root-application
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
  labels:
    app: root-application
    appType: root
spec:
  project: default
  source:
    repoURL: 'http://my-repo.git'    
    targetRevision: main
    path: argocd/apps
  destination:
    server: "https://kubernetes.default.svc"
    namespace: argocd
  syncPolicy:
    automated:
      selfHeal: true
      prune: true
    syncOptions:
      - PruneLast=true
      - CreateNamespace=true

apps/templates/postgresql.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: postgresql
  namespace: argocd
spec:
  project: default
  sources:
    - repoURL: 'http://my-repo.git'  
      ref: values
    - repoURL: registry-1.docker.io/bitnamicharts
      chart: postgresql-ha    
      targetRevision: 11.7.9
      helm:
        releaseName: postgresql-ha
        valueFiles:
        - $values/argocd/apps/values/postgresql.yml
  destination:
    server: "https://kubernetes.default.svc"
    namespace: postgresql
  syncPolicy:
    automated:
      selfHeal: true
      prune: true
    syncOptions:
      - PruneLast=true

Expected behavior

I expect that application will be succesfully installed with values defined in /argocd/apps/values/postgresql.yaml file.

Screenshots

Version

argocd: v2.7.7+4650bb2.dirty
  BuildDate: 2023-07-05T19:42:32Z
  GitCommit: 4650bb2817c3c81405f40cf77e93ef2b5fb275fb
  GitTreeState: dirty
  GoVersion: go1.19.10
  Compiler: gc
  Platform: linux/amd64

Logs

rpc error: code = Unknown desc = Manifest generation error (cached): `helm template . --name-template postgresql-ha --namespace postgresql --kube-version 1.26 --values .argocd/apps/values/postgresql.yml --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 autoscaling/v1 --api-versions autoscaling/v1/HorizontalPodAutoscaler --api-versions autoscaling/v2 --api-versions autoscaling/v2/HorizontalPodAutoscaler --api-versions batch/v1 --api-versions batch/v1/CronJob --api-versions batch/v1/Job --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 discovery.k8s.io/v1 --api-versions discovery.k8s.io/v1/EndpointSlice --api-versions events.k8s.io/v1 --api-versions events.k8s.io/v1/Event --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 flowcontrol.apiserver.k8s.io/v1beta3 --api-versions flowcontrol.apiserver.k8s.io/v1beta3/FlowSchema --api-versions flowcontrol.apiserver.k8s.io/v1beta3/PriorityLevelConfiguration --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 policy/v1 --api-versions policy/v1/PodDisruptionBudget --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 snapshot.storage.k8s.io/v1 --api-versions snapshot.storage.k8s.io/v1/VolumeSnapshot --api-versions snapshot.storage.k8s.io/v1/VolumeSnapshotClass --api-versions snapshot.storage.k8s.io/v1/VolumeSnapshotContent --api-versions snapshot.storage.k8s.io/v1beta1 --api-versions snapshot.storage.k8s.io/v1beta1/VolumeSnapshot --api-versions snapshot.storage.k8s.io/v1beta1/VolumeSnapshotClass --api-versions snapshot.storage.k8s.io/v1beta1/VolumeSnapshotContent --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 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 .argocd/apps/values/postgresql.yml: no such file or directory
christianh814 commented 1 year ago

Typo maybe? values/argocd/apps/values/postgresql.yml vs values/argocd/apps/values/postgresql.yaml?

pawellrus commented 1 year ago

Typo maybe? values/argocd/apps/values/postgresql.yml vs values/argocd/apps/values/postgresql.yaml?

Yep, my bad. Sorry for mis-issuing.