github.com/argoproj/argo-cd@v1.8.7/docs/operator-manual/cluster-bootstrapping.md (about)

     1  # Cluster Bootstrapping
     2  
     3  This guide for operators who have already installed Argo CD, and have a new cluster and are looking to install many apps in that cluster.
     4  
     5  There's no one particular pattern to solve this problem, e.g. you could write a script to create your apps, or you could even manually create them. However, users of Argo CD tend to use the **app of apps pattern**.
     6  
     7  ## App Of Apps Pattern
     8  
     9  [Declaratively](declarative-setup.md) specify one Argo CD app that consists only of other apps.
    10  
    11  ![Application of Applications](../assets/application-of-applications.png)
    12  
    13  ### Helm Example
    14  
    15  This example shows how to use Helm to achieve this. You can, of course, use another tool if you like.
    16  
    17  A typical layout of your Git repository for this might be:
    18  
    19  ```
    20  ├── Chart.yaml
    21  ├── templates
    22  │   ├── guestbook.yaml
    23  │   ├── helm-dependency.yaml
    24  │   ├── helm-guestbook.yaml
    25  │   └── kustomize-guestbook.yaml
    26  └── values.yaml
    27  ```
    28  
    29  `Chart.yaml` is boiler-plate.
    30  
    31  `templates` contains one file for each child app, roughly:
    32  
    33  ```yaml
    34  apiVersion: argoproj.io/v1alpha1
    35  kind: Application
    36  metadata:
    37    name: guestbook
    38    namespace: argocd
    39    finalizers:
    40    - resources-finalizer.argocd.argoproj.io
    41  spec:
    42    destination:
    43      namespace: argocd
    44      server: {{ .Values.spec.destination.server }}
    45    project: default
    46    source:
    47      path: guestbook
    48      repoURL: https://github.com/argoproj/argocd-example-apps
    49      targetRevision: HEAD
    50  ``` 
    51  
    52  The sync policy to automated + prune, so that child apps are automatically created, synced, and deleted when the manifest is changed, but you may wish to disable this. I've also added the finalizer, which will ensure that your apps are deleted correctly.
    53  
    54  Fix the revision to a specific Git commit SHA to make sure that, even if the child apps repo changes, the app will only change when the parent app change that revision. Alternatively, you can set it to HEAD or a branch name.
    55  
    56  As you probably want to override the cluster server, this is a templated values.
    57  
    58  `values.yaml` contains the default values:
    59  
    60  ```yaml
    61  spec:
    62    destination:
    63      server: https://kubernetes.default.svc
    64  ```
    65  
    66  Next, you need to create and sync your parent app, e.g. via the CLI:
    67  
    68  ```bash
    69  argocd app create apps \
    70      --dest-namespace argocd \
    71      --dest-server https://kubernetes.default.svc \
    72      --repo https://github.com/argoproj/argocd-example-apps.git \
    73      --path apps  
    74  argocd app sync apps  
    75  ```
    76  
    77  The parent app will appear as in-sync but the child apps will be out of sync:
    78  
    79  ![New App Of Apps](../assets/new-app-of-apps.png)
    80  
    81  You can either sync via the UI, firstly filter by the correct label:
    82  
    83  ![Filter Apps](../assets/filter-apps.png)
    84  
    85  Then select the "out of sync" apps and sync: 
    86  
    87  ![Sync Apps](../assets/sync-apps.png)
    88  
    89  Or, via the CLI: 
    90  
    91  ```bash
    92  argocd app sync -l app.kubernetes.io/instance=apps
    93  ```
    94  
    95  View [the example on Github](https://github.com/argoproj/argocd-example-apps/tree/master/apps).