Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use file from other source as Helm --set-file param #13220

Open
3 tasks done
lucacox opened this issue Apr 13, 2023 · 6 comments · May be fixed by #17941
Open
3 tasks done

Cannot use file from other source as Helm --set-file param #13220

lucacox opened this issue Apr 13, 2023 · 6 comments · May be fixed by #17941
Labels
enhancement New feature or request multi-source-apps Bugs or enhancements related to multi-source Applications.

Comments

@lucacox
Copy link

lucacox commented Apr 13, 2023

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

In Application using multiple sources reference of one source is not substituted in helm.fileParameters entries. It works (at least it seems) for the helm.valueFiles property

To Reproduce

Using this Application definition:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kratos
  namespace: argocd
spec:
  project: ory
  destination:
    name: ''
    namespace: auth
    server: 'https://kubernetes.default.svc'
  sources:
    - repoURL: 'https://k8s.ory.sh/helm/charts'
      targetRevision: 0.30.0
      chart: kratos
      helm:
        valueFiles:
          - $myRepo/kratos/k8s/overlay/development/kratos-values.yaml

        fileParameters:
          - name: identity
            path: $myRepo/kratos/k8s/overlay/development/identity_schemas/identity.schema.json
    - repoURL: git@my-private:repo.git
      targetRevision: development
      ref: myRepo

gives this error in the UI:

rpc error: code = Unknown desc = Manifest generation error (cached): `helm template . --name-template kratos --namespace auth --kube-version 1.25 --set-file identity=/tmp/47de275d-f0c3-419a-8382-9628f1674103/kratos/kratos/k8s/overlay/development/identity_schemas/identity.schema.json --values .kratos/k8s/overlay/development/kratos-values.yaml --api-versions acid.zalan.do/v1 --api-versions acid.zalan.do/v1/OperatorConfiguration --api-versions acid.zalan.do/v1/PostgresTeam --api-versions acid.zalan.do/v1/postgresql --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 authzed.com/v1alpha1 --api-versions authzed.com/v1alpha1/SpiceDBCluster --api-versions auto.gke.io/v1 --api-versions auto.gke.io/v1/AllowlistedV2Workload --api-versions auto.gke.io/v1/AllowlistedWorkload --api-versions auto.gke.io/v1alpha1 --api-versions auto.gke.io/v1alpha1/AllowlistedWorkload --api-versions autoscaling/v1 --api-versions autoscaling/v1/HorizontalPodAutoscaler --api-versions autoscaling/v2 --api-versions autoscaling/v2/HorizontalPodAutoscaler --api-versions autoscaling/v2beta2 --api-versions autoscaling/v2beta2/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 cloud.google.com/v1 --api-versions cloud.google.com/v1/BackendConfig --api-versions cloud.google.com/v1beta1 --api-versions cloud.google.com/v1beta1/BackendConfig --api-versions coordination.k8s.io/v1 --api-versions coordination.k8s.io/v1/Lease --api-versions core.strimzi.io/v1beta2 --api-versions core.strimzi.io/v1beta2/StrimziPodSet --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/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 getambassador.io/v1beta1 --api-versions getambassador.io/v1beta1/RateLimit --api-versions getambassador.io/v1beta2 --api-versions getambassador.io/v1beta2/Filter --api-versions getambassador.io/v1beta2/FilterPolicy --api-versions getambassador.io/v1beta2/RateLimit --api-versions getambassador.io/v2 --api-versions getambassador.io/v2/AuthService --api-versions getambassador.io/v2/ConsulResolver --api-versions getambassador.io/v2/DevPortal --api-versions getambassador.io/v2/Filter --api-versions getambassador.io/v2/FilterPolicy --api-versions getambassador.io/v2/Host --api-versions getambassador.io/v2/KubernetesEndpointResolver --api-versions getambassador.io/v2/KubernetesServiceResolver --api-versions getambassador.io/v2/LogService --api-versions getambassador.io/v2/Mapping --api-versions getambassador.io/v2/Module --api-versions getambassador.io/v2/RateLimit --api-versions getambassador.io/v2/RateLimitService --api-versions getambassador.io/v2/TCPMapping --api-versions getambassador.io/v2/TLSContext --api-versions getambassador.io/v2/TracingService --api-versions getambassador.io/v3alpha1 --api-versions getambassador.io/v3alpha1/AuthService --api-versions getambassador.io/v3alpha1/ConsulResolver --api-versions getambassador.io/v3alpha1/DevPortal --api-versions getambassador.io/v3alpha1/Filter --api-versions getambassador.io/v3alpha1/FilterPolicy --api-versions getambassador.io/v3alpha1/Host --api-versions getambassador.io/v3alpha1/KubernetesEndpointResolver --api-versions getambassador.io/v3alpha1/KubernetesServiceResolver --api-versions getambassador.io/v3alpha1/Listener --api-versions getambassador.io/v3alpha1/LogService --api-versions getambassador.io/v3alpha1/Mapping --api-versions getambassador.io/v3alpha1/Module --api-versions getambassador.io/v3alpha1/RateLimit --api-versions getambassador.io/v3alpha1/RateLimitService --api-versions getambassador.io/v3alpha1/TCPMapping --api-versions getambassador.io/v3alpha1/TLSContext --api-versions getambassador.io/v3alpha1/TracingService --api-versions hub.gke.io/v1 --api-versions hub.gke.io/v1/Membership --api-versions internal.autoscaling.gke.io/v1alpha1 --api-versions internal.autoscaling.gke.io/v1alpha1/CapacityRequest --api-versions kafka.strimzi.io/v1alpha1 --api-versions kafka.strimzi.io/v1alpha1/KafkaTopic --api-versions kafka.strimzi.io/v1alpha1/KafkaUser --api-versions kafka.strimzi.io/v1beta1 --api-versions kafka.strimzi.io/v1beta1/KafkaTopic --api-versions kafka.strimzi.io/v1beta1/KafkaUser --api-versions kafka.strimzi.io/v1beta2 --api-versions kafka.strimzi.io/v1beta2/Kafka --api-versions kafka.strimzi.io/v1beta2/KafkaBridge --api-versions kafka.strimzi.io/v1beta2/KafkaConnect --api-versions kafka.strimzi.io/v1beta2/KafkaConnector --api-versions kafka.strimzi.io/v1beta2/KafkaMirrorMaker --api-versions kafka.strimzi.io/v1beta2/KafkaMirrorMaker2 --api-versions kafka.strimzi.io/v1beta2/KafkaRebalance --api-versions kafka.strimzi.io/v1beta2/KafkaTopic --api-versions kafka.strimzi.io/v1beta2/KafkaUser --api-versions migration.k8s.io/v1alpha1 --api-versions migration.k8s.io/v1alpha1/StorageState --api-versions migration.k8s.io/v1alpha1/StorageVersionMigration --api-versions monitoring.googleapis.com/v1 --api-versions monitoring.googleapis.com/v1/ClusterPodMonitoring --api-versions monitoring.googleapis.com/v1/ClusterRules --api-versions monitoring.googleapis.com/v1/GlobalRules --api-versions monitoring.googleapis.com/v1/OperatorConfig --api-versions monitoring.googleapis.com/v1/PodMonitoring --api-versions monitoring.googleapis.com/v1/Rules --api-versions monitoring.googleapis.com/v1alpha1 --api-versions monitoring.googleapis.com/v1alpha1/ClusterPodMonitoring --api-versions monitoring.googleapis.com/v1alpha1/ClusterRules --api-versions monitoring.googleapis.com/v1alpha1/GlobalRules --api-versions monitoring.googleapis.com/v1alpha1/OperatorConfig --api-versions monitoring.googleapis.com/v1alpha1/PodMonitoring --api-versions monitoring.googleapis.com/v1alpha1/Rules --api-versions networking.gke.io/v1 --api-versions networking.gke.io/v1/ManagedCertificate --api-versions networking.gke.io/v1/ServiceAttachment --api-versions networking.gke.io/v1beta1 --api-versions networking.gke.io/v1beta1/FrontendConfig --api-versions networking.gke.io/v1beta1/ManagedCertificate --api-versions networking.gke.io/v1beta1/ServiceAttachment --api-versions networking.gke.io/v1beta1/ServiceNetworkEndpointGroup --api-versions networking.gke.io/v1beta2 --api-versions networking.gke.io/v1beta2/ManagedCertificate --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 nodemanagement.gke.io/v1alpha1 --api-versions nodemanagement.gke.io/v1alpha1/UpdateInfo --api-versions oathkeeper.ory.sh/v1alpha1 --api-versions oathkeeper.ory.sh/v1alpha1/Rule --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 redis.redis.opstreelabs.in/v1beta1 --api-versions redis.redis.opstreelabs.in/v1beta1/Redis --api-versions redis.redis.opstreelabs.in/v1beta1/RedisCluster --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 --api-versions warden.gke.io/v1 --api-versions warden.gke.io/v1/Audit --include-crds` failed exit status 1: Error: failed parsing --set-file data: open /tmp/47de275d-f0c3-419a-8382-9628f1674103/kratos/kratos/k8s/overlay/development/identity_schemas/identity.schema.json: no such file or directory
14 minutes ago (Thu Apr 13 2023 17:01:24 GMT+0200)

Notice this:

--set-file identity=/tmp/47de275d-f0c3-419a-8382-9628f1674103/kratos/kratos/k8s/overlay/development/identity_schemas/identity.schema.json 
--values .kratos/k8s/overlay/development/kratos-values.yaml

in --values param the $myRepo is substituted with a . and in --set-file with /tmp/47de275d-f0c3-419a-8382-9628f1674103/kratos.

Expected behavior

The files in the gite repo should be used to set the variables in Helm

Screenshots

image

Version

argocd: v2.6.7+5bcd846
  BuildDate: 2023-03-23T14:57:27Z
  GitCommit: 5bcd846fa16e4b19d8f477de7da50ec0aef320e5
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64
@lucacox lucacox added the bug Something isn't working label Apr 13, 2023
@ishitasequeira
Copy link
Member

@lucacox, multiple sources is not yet supported for helm.fileParameters field. It is only supported for helm.valueFiles field as of now.

Were you able to see the error if you reference value file from other source only, that is, only reference $myRepo in helm.valueFiles?

@mnikser
Copy link

mnikser commented May 1, 2023

Supporting helm.fileParameters field under the multiple sources is very useful. I also have use case for and I noticed it is not supported. Is there a place where we can ask for features to be added? Or is this on your road map to be added?

@crenshaw-dev
Copy link
Collaborator

This PR would solve: #12508

@m-adawi
Copy link

m-adawi commented Aug 10, 2023

I'm having the same issue. I'm using a centralized helm chart to deploy multiple ASP.NET services instead of replicating the same helm chart in many repos. I'm using the helm value extraDeploy this way:

extraDeploy: 
  - |
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: {{ include "aspnet-core.fullname" . }}-appsettings
      labels: {{- include "common.labels.standard" . | nindent 6 }}
        {{- if .Values.commonLabels }}
        {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 6 }}
        {{- end }}
      {{- if .Values.commonAnnotations }}
      annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 6 }}
      {{- end }}
    data:
      appsettings.json: |-
        {{- .Values.appsettings | nindent 4 }}

So I need to set the helm value appsettings to the appsettings.json file content which is in my service configuration repo

@ishitasequeira ishitasequeira added the multi-source-apps Bugs or enhancements related to multi-source Applications. label Jan 25, 2024
@illnr
Copy link

illnr commented Mar 9, 2024

I found a workaround solution here: #3365 (comment)

Basically you create an umbrella chart (like this one) in the same git repo where the fileParameters file is stored. The actual chart you wanted to use is just a dependency from your umbrella chart. Now you can deploy your umbrella chart with fileParameters because they are in the same repo, and use it as a value for the chart dependency.

@ishitasequeira ishitasequeira added enhancement New feature or request and removed bug Something isn't working labels Mar 17, 2024
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 12, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from argoproj#2751. Added a note about argoproj#13220 so
users are aware. argoproj#12508 aims to remove this limitation so the warning
can probably be removed with that.
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 12, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from argoproj#2751. Added a note about argoproj#13220 so
users are aware. argoproj#12508 aims to remove this limitation so the warning
can probably be removed with that.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 17, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from argoproj#2751. Added a note about argoproj#13220 so
users are aware. argoproj#12508 aims to remove this limitation so the warning
can probably be removed with that.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 23, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
@cardoe cardoe linked a pull request Apr 23, 2024 that will close this issue
14 tasks
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 23, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
@cardoe
Copy link
Contributor

cardoe commented Apr 23, 2024

I created an implementation of this in #17941, hoping someone that's interested in this feature can help me get it over the finish line.

cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 25, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from argoproj#2751. Added a note about argoproj#13220 so
users are aware. argoproj#17941 aims to remove this limitation so the warning
will be adjusted to mention the version that lands that support.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 25, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from argoproj#2751. Added a note about argoproj#13220 so
users are aware. argoproj#17941 aims to remove this limitation so the warning
will be adjusted to mention the version that lands that support.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
crenshaw-dev pushed a commit that referenced this issue Apr 25, 2024
Added documentation for fileParameters in a helm source Application or
the --helm-set-file cli option from #2751. Added a note about #13220 so
users are aware. #17941 aims to remove this limitation so the warning
will be adjusted to mention the version that lands that support.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 27, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue Apr 27, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue May 4, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue May 4, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
cardoe added a commit to cardoe/argo-cd that referenced this issue May 7, 2024
In multi-source applications helm values files can come from other repos
if you use the ref syntax but it is not possible for the --set-file
param to take files from other repos via the ref syntax. This extends
the behavior to cover set-file parameters as well as the values files.
fixes argoproj#13220, refs argoproj#17822

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request multi-source-apps Bugs or enhancements related to multi-source Applications.
Projects
None yet
7 participants