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

Question: Helm repository with multible values files #938

Closed
rpahli opened this issue Dec 18, 2018 · 9 comments
Closed

Question: Helm repository with multible values files #938

rpahli opened this issue Dec 18, 2018 · 9 comments

Comments

@rpahli
Copy link

rpahli commented Dec 18, 2018

We are using helm for our deployments with multiple helm repositories. The directory structure looks like:

<ENV>/<APPLICATION_NAME>/values.yaml

It would be great to have a detection mechanism for this. Something like a argo.yaml which we can placed inside the directory.

Example:

type: helm
helm-repository: stable
chart: redis
version: 1.0.0

do you think this is useful?

@alexmt
Copy link
Collaborator

alexmt commented Dec 26, 2018

Helllo @rpahli ! Not sure if I understood your proposal correctly.

Are you suggesting to add applications auto-detection mechanism? So user could connect repository with multiple argo.yaml files instead of manually run argocd app create for every application?

This is already supported but in a slightly different way. You can create directory argo-cd-apps which has yaml definition for each your environment and connect it to argocd using argocd app create appications --repo <repourl> --path argo-cd-apps. E.g.:

argo-cd-apps/prod.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: helm-guestbook
spec:
  destination:
    namespace: default
    server: https://localhost:6443
  project: default
  source:
    helm:
      valueFiles:
      - values-production.yaml
    path: helm-guestbook
    repoURL: https://github.com/argoproj/argocd-example-apps

This way you can manage argocd application in a gitops way.

@rpahli
Copy link
Author

rpahli commented Dec 26, 2018

Hello @alexmt,

that's what I'm looking for. But what I miss is the opportunity to use remote helm repositories with local values files.

@alexmt
Copy link
Collaborator

alexmt commented Dec 26, 2018

You might use URL. e.g.

  source:
    helm:
      valueFiles:
      - https://raw.githubusercontent.com/argoproj/argocd-example-apps/master/helm-guestbook/values-production.yaml

Unfortunately, Helm does not support URLs which require authentication.

@rpahli
Copy link
Author

rpahli commented Dec 26, 2018

What I mean is I want to use remote helm chart (tgz files) for example from https://hub.helm.sh and only the values files are in a git repositories. I know helm template does not support remote templates out of the box but this would be very helpful if argo-cd would support this. Maybe I can support to implement this feature if you think this is helpful.

@jessesuen
Copy link
Member

@rpahli - The way to accomplish this without building any extra features, is by having a helm chart in your private git repo, with a dependency to your desired chart in the upstream helm repository. The values.yaml in the private git repo is able to customize the helm parameters in the upstream chart.

I added an example of how to do that here:
https://github.com/argoproj/argocd-example-apps/tree/master/helm-dependency

Let us know if this satisfies your use case.

@rpahli
Copy link
Author

rpahli commented Jan 9, 2019

Ok I'll check it if this works for us.

Thanks

@alexmt
Copy link
Collaborator

alexmt commented Mar 15, 2019

First class help charts without involving git is WIP. I think we can close this one. @rpahli please feel free to reopen if #1145 does not cover your use case

@alexmt alexmt closed this as completed Mar 15, 2019
@omallo
Copy link

omallo commented Sep 29, 2021

Hi @alexmt , I do have a similar requirement as @rpahli and I believe that #1145 is not really addressing this fully.

With the implementation in #1145, when using a Helm repository as a source, it is not possible to use the source.helm.valueFiles or source.helm.fileParameters elements since there is no reference to a Git repository in which those external files would be stored.

Would it make sense to still point to a Git repository in the source section and instead configure the Helm repository/chart inside the source.helm element in order to provide such a support? Something like the following:

source:
  # the Git repository in which the values files and other files required for Helm are stored
  repoURL: https://github.com/xxx/yyy.git
  targetRevision: master
  path: my-nginx
  helm:
    # the chart repository/name/version
    repoURL: https://kubernetes.github.io/ingress-nginx
    chart: ingress-nginx
    chartVersion: 4.0.3
    # the following values files and other files are stored in the Git repository referenced above
    valueFiles:
      - values.yaml
    fileParameters:
      - name: certificate.content
        path: certificate.crt

I believe this would have the following important advantages:

  • Complex values files can be externalized and don't have to be defined inside the Application manifest file.
  • Arbitrary files (also binary files) can be referenced and passed to Helm.
  • The Helm overlaying mechanism for values files can be used by specifying multiple values files.
  • The deployment can also be done directly with Helm, w/o using ArgoCD, e.g. for local testing.

Would it make sense to re-consider having such a functionality?

@raelix
Copy link

raelix commented May 8, 2022

Generally, Helm has the ability of providing external values.yaml. Looks like this is not possible if not adding the chart as dependency which cause the values.yaml to have the name of the dependency as root parent of the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants