MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Application Sets

Application Sets

ApplicationSets dynamically generate ArgoCD Applications from templates, enabling consistent deployment of services across environments and tenants without manual Application creation for each service.


ApplicationSet Generators

GeneratorUse CaseDescription
Git directoryService discoveryGenerates Applications from Helm chart directories
ListMulti-environmentDeploys the same chart to dev, staging, prod
ClusterMulti-clusterDeploys to multiple Kubernetes clusters
MatrixCombinedCombines generators (e.g., services x environments)

Control Plane ApplicationSet

Generates an Application for each control plane service:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: control-plane-services
  namespace: argocd
spec:
  generators:
    - git:
        repoURL: https://github.com/matih-labs/matih-prototype.git
        revision: main
        directories:
          - path: infrastructure/helm/control-plane/*
  template:
    metadata:
      name: "cp-{{path.basename}}"
    spec:
      project: control-plane
      source:
        repoURL: https://github.com/matih-labs/matih-prototype.git
        path: "{{path}}"
        targetRevision: main
        helm:
          valueFiles:
            - values.yaml
            - values-dev.yaml
      destination:
        server: https://kubernetes.default.svc
        namespace: matih-control-plane
      syncPolicy:
        automated:
          prune: true
          selfHeal: true

Data Plane ApplicationSet

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: data-plane-services
  namespace: argocd
spec:
  generators:
    - git:
        repoURL: https://github.com/matih-labs/matih-prototype.git
        revision: main
        directories:
          - path: infrastructure/helm/data-plane/*
  template:
    metadata:
      name: "dp-{{path.basename}}"
    spec:
      project: data-plane
      destination:
        namespace: matih-data-plane
      syncPolicy:
        automated:
          prune: true
          selfHeal: true

Multi-Environment Matrix

Deploy services across environments using the Matrix generator:

generators:
  - matrix:
      generators:
        - git:
            directories:
              - path: infrastructure/helm/control-plane/*
        - list:
            elements:
              - env: dev
                cluster: dev-cluster
              - env: staging
                cluster: staging-cluster

Sync Policies

PolicyBehavior
automated.pruneDelete resources removed from Git
automated.selfHealRevert manual changes to match Git
syncOptions.CreateNamespaceAuto-create namespace if missing
retry.limitNumber of sync retry attempts

Related Pages