Applications in ArgoCD can be created by the UI, CLI, or by applying a manifest file in Kubernetes (declarative setup, mono application). Mono application is where an application is exported or written as a manifest file with the type of Application
A pattern of deploying and managing a group of applications using a single top-level ArgoCD application which manages multiple mono applications then the mono applications execute the manifest files each with its own Git repository and path
Multiple interdependent applications, each with its own unique requirements and deployment process. Any changes made to the top level will trigger to all of the managed applications
Say the following example has the app-of-apps.yaml file the top level which executes the app1.yaml and app2.yaml mono apps, the mono apps then execute each of the targeted manifest files accordingly. It doesn’t has to be in the same repository or the same structure
Example
├───app-of-apps
│ app1.yaml
│ app2.yaml
├───manifests
│ ├───app1
│ │ deployment.yaml
│ │ service.yaml
│ └───app2
│ deployment.yaml
│ service.yaml
└───top-level
app-of-apps.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-of-apps
namespace: argocd
spec:
project: default
source:
repoURL: <Git_URL>
targetRevision: HEAD
# where the mono apps are located
path: <./path/to/manifest>
destination:
server: <https://kubernetes.default.svc>
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app1
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: <Git_URL>
targetRevision: HEAD
# where the manifest files (svc, deployment, etc..) are stored
path: <./path/to/manifest>
destination:
server: <https://kubernetes.default.svc>
namespace: app1_ns
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true
The top level file can be applied directly from the Git repo
kubectl apply -f <git_Repo_with_path_to_file_URL> -n argocd
# check applications created in kubernetes
kubectl get Application -n argocd # or -A
ArgoCD can be used to deploy Helm charts, can also automatically detect values of a chart and change it while creating an application
Alternatively can use command line to create the application and change values accordingly
argocd app create <helm_app_name> \\
--repo <Helm_repo_URL> \\
--path <./path> \\
--helm-set service.type=NodePort \\
--helm-set <paramater>.<key>=<value> \\
--dest-namespace default \\
--dest-server <https://kubernetes.default.svc>
Note: if you try to list installed helm charts using helm ls
there will be no output because its a created application not a created chart