Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

About Argo CD ApplicationSet and SCM Provider generator

October 4, 2023
Ishita Sequeira
Related topics:
CI/CDGitOpsKubernetes
Related products:
Red Hat OpenShift Container Platform

    The ApplicationSet controller is a part of Argo CD that adds support for an ApplicationSet CustomResourceDefinition (CRD). The ApplicationSet controller helps to add Application automation and improve multicluster support and cluster multitenant support within Argo CD.

    ApplicationSet provides the following benefits:

    • The ability to use a single Kubernetes manifest to target multiple Kubernetes clusters and deploy multiple applications from one or multiple Git repositories with Argo CD.
    • Improved support for monorepos. In the context of Argo CD, a monorepo is multiple Argo CD Application resources defined within a single Git repository.
    • Within multitenant clusters, improves the ability of individual cluster tenants to deploy applications using Argo CD (without needing to involve privileged cluster administrators in enabling the destination clusters/namespaces).

    You can view all the supported fields for ApplicationSet in the Argo CD documentation.

    ApplicationSet generators

    Generators generate parameters and are rendered into the template field of the ApplicationSet resource. ApplicationSet supports a variety of generators, as described below:

    • List generator: Generates parameters based on an arbitrary list of key/value pairs.
    • Cluster generator: Allows you to target Argo CD applications to clusters based on the list of clusters defined within (and managed by) Argo CD.
    • Git generator: Allows you to create applications based on files within a Git repository or based on the directory structure of a Git repository.
    • Matrix generator: Can be used to combine the generated parameters of two separate generators.
    • Merge generator: Can be used to merge the generated parameters of two or more generators.
    • SCM Provider generator: Uses the API of a source code management (SCM) provider (e.g., GitHub) to discover repositories within an organization automatically.
    • Pull Request generator: Uses the API of a Source-Code-Management-as-a-Service (SCMaaS) provider (e.g., GitHub) to discover open pull requests within a repository automatically.
    • Cluster Decision Resource generator: Used to interface with Kubernetes custom resources that use custom resource-specific logic to decide which set of Argo CD clusters to deploy to.
    • Plug-in generator: Makes RPC HTTP requests to provide parameters.

    This article focuses exclusively on the SCM Provider generator and its use cases.

    Source code management

    SCM is used to track modifications to a source code repository. SCM tracks a running history of changes to a code base and helps resolve conflicts when merging updates from multiple contributors. SCM is also synonymous with version control.

    As software projects grow in lines of code and contributor headcount, the costs of communication overhead and management complexity also grow. SCM is a critical tool to alleviate the organizational strain of growing development costs.

    SCM Provider generator

    The SCM Provider generator uses the API of a SCMaaS provider such as GitHub to discover repositories within an organization automatically. This fits well with GitOps layout patterns that split microservices across many repositories.

    As of Argo CD version 2.8, the supported SCM providers are:

    • GitHub
    • GitLab 
    • Gitea
    • Bitbucket 
    • Azure DevOps
    • Bitbucket Cloud

    You can configure the ApplicationSet with SCM Provider as follows:

    apiVersion: argoproj.io/v1alpha1
    kind: ApplicationSet
    metadata:
      name: myapps
    spec:
      generators:
      - scmProvider:
          # Which protocol to clone using.
          cloneProtocol: ssh
          # See below for provider specific options.
          github:
            # ...

    cloneProtocol: defines the protocol to use for the SCM URL. The default is provider-specific, but ssh if possible.

    The provider's parameters are described in the Argo CD documentation. We will use GitHub for the example in this article.

    GitHub

    The GitHub mode uses the GitHub API to scan an organization in either github.com or GitHub Enterprise:

    apiVersion: argoproj.io/v1alpha1
    kind: ApplicationSet
    metadata:
      name: guestbook
    spec:
      generators:
      - scmProvider:
          github:
            organization: argoproj
          cloneProtocol: https
          filters:
          - repositoryMatch: example-apps
      template:
        metadata:
          name: '{{ repository }}-guestbook'
        spec:
          project: "default"
          source:
            repoURL: '{{ url }}'
            targetRevision: '{{ branch }}'
            path: guestbook
          destination:
            server: https://kubernetes.default.svc
            namespace: guestbook

    The parameters are explained below:

    • Organization: In the example above, we used argoproj. If you have multiple organizations, use multiple generators.
    • api: This field is optional; however, if you are using GitHub Enterprise, you will need to specify the URL to access the API. In our example, we are not using GitHub Enterprise.
    • filters: SCM Provider supports multiple filters. We are using a repositoryMatch filter matching the repository with name example-apps. You can find more filters in the documentation.

    Use case

    There is an e-commerce website with multiple services for orders, inventory, payments, etc.; each service is stored in a separate Git repository within the same organization. When we deploy the e-commerce website, we want all the services to be deployed simultaneously for the website to start successfully.

    In this case, we can use the SCM Provider generator to generate all the services belonging to the same organization. You can configure the ApplicationSet in the following format:

    apiVersion: argoproj.io/v1alpha1
    kind: ApplicationSet
    metadata:
      name: ecommerce-website
    spec:
      generators:
      - scmProvider:
          github:
            organization: ecommerceWebsite
          cloneProtocol: https
      template:
        metadata:
          name: '{{ repository }}'
        spec:
          project: "default"
          source:
            repoURL: '{{ url }}'
            targetRevision: '{{ branch }}'
            path: app
          destination:
            server: https://kubernetes.default.svc
            namespace: ecomm

    The ApplicationSet above will read all the repositories in the GitHub organization ecommerceWebsite and deploy all the services in the repositories within the path app in each repository.

    Pros

    Deploying multiple applications and services in the same organization is easy and quick. You can use the SCM Provider generator to allow you to dynamically generate ephemeral environments for testing or prod-like environments easily.

    Cons

    Once the entire organization is added to the SCM Provider generator, it will pick all the repositories matching the added filtering conditions. If you want to create a new repository within the same organization and do not want it to be deployed, you would need to ensure that the repository does not match any of the filtering conditions added to the SCM Provider generator. This becomes an additional effort if the SCM generator is not configured properly.

    Conclusion

    The ApplicationSet custom resource helps you easily and quickly manage multitenant or cluster application deployment. The SCM Provider generator is helpful when you want to manage all repositories of a known pattern within an organization and deploy resources to Argo CD by automatically identifying changes to any of the repositories in the organization.

    Last updated: October 26, 2023

    Related Posts

    • 3 patterns for deploying Helm charts with Argo CD

    • Automate CI/CD on pull requests with Argo CD ApplicationSets

    • Multiple sources for Argo CD applications

    • Manage namespaces in multitenant clusters with Argo CD, Kustomize, and Helm

    • Prevent auto-reboot during Argo CD sync with machine configs

    • How to set up your GitOps directory structure

    Recent Posts

    • What GPU kernels mean for your distributed inference

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    What’s up next?

    Path to GitOps cover card

    Read The Path to GitOps for a comprehensive look at the tools, workflows, and structures teams need to have in place in order to enable a complete GitOps workflow.

    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.