Git Product home page Git Product logo

Comments (2)

glyhood avatar glyhood commented on July 16, 2024

@adabuleanu
Yes it's possible. I recently did this and documented it here
https://www.linkedin.com/pulse/continuous-deployment-argocd-applicationset-ifeoluwa-oluwole/

Basically this:

apiVersion: argoproj.io/v1alpha
kind: ApplicationSet
metadata:
  name: example-appset
  namespace: argocd
spec:
  generators:
  - git:
      repoURL: https://gitlab.com/abcxyz/example-project/argocd.git
      revision: main
      files:
      - path: "apps/examples/"
  template:
    metadata:
      name: '{{name}}'
    spec:
      project: '{{project}}'
      source:
        chart: helm-chart-name
        repoURL: https://<packaged helm chart url>
        targetRevision: 2.0
        helm:
          values: |-
            {{values}} # see "values" snippet below 
      destination:
        name: staging-cluster
        namespace: '{{namespace}}'
      
      syncPolicy:
        automated:
          prune: true
        syncOptions:
          - CreateNamespace=true

and the parameters to be passed via the values.yaml will look like this:

# This section is for the Argo CD Application resource

name: app1-example # Argo CD application resource name
project: linkedin # Argo CD project
namespace: staging # Ensures namespace in destination cluster exists. 


# This section contains the values for the helm chart
values: |-
  fullnameOverride: app1-staging
  image:
    repository: 1234567890.dkr.ecr.us-west-1.amazonaws.com/app1:latest
  namespace: staging
  containerPort: 7080
  autoscaling:
    enabled: false
  ingress:
    host: app1.staging.com
  env:
    enabled: false

from applicationset.

adabuleanu avatar adabuleanu commented on July 16, 2024

@glyhood in your example you are creating Applications from ApplicationSets that use a source of helm chart inside a helm repository, while your values files are stored in a git repository. My question (maybe not clear) was related to the fact if you can use charts inside a helm repository or a in git repository.

For charts inside helm repository the Application will look like this:

    spec:
      source:
        repoURL: "{{source.repoURL}}" <--------- this is a helm repo (same "repoURL" key)
        chart:  "{{source.chart}}" <--------- "chart" key is specific to helm repositories
        targetRevision: '{{source.targetRevision}}'  <--------- this is the helm chart version (same "targetRevision" key)

For charts inside git repository the Application will look like this:

    spec:
      source:
        repoURL: "{{source.repoURL}}" <--------- this is a git repo (same "repoURL" key)
        path: "{{source.path}}" <--------- "path" key is specific to helm repositories
        targetRevision: '{{source.targetRevision}}'  <--------- this can be a git branch or a git tag (same "targetRevision" key)

From my investigation this is not possible at the moment. I found this feature request that might help with better "templating" inside ApplicationSets: argoproj/argo-cd#11183

from applicationset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.