github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/application.yaml (about)

     1  apiVersion: argoproj.io/v1alpha1
     2  kind: Application
     3  metadata:
     4    name: guestbook
     5    # You'll usually want to add your resources to the argocd namespace.
     6    namespace: argocd
     7    # Add this finalizer ONLY if you want these to cascade delete.
     8    finalizers:
     9      # The default behaviour is foreground cascading deletion
    10      - resources-finalizer.argocd.argoproj.io
    11      # Alternatively, you can use background cascading deletion
    12      # - resources-finalizer.argocd.argoproj.io/background
    13    # Add labels to your application object.
    14    labels:
    15      name: guestbook
    16  spec:
    17    # The project the application belongs to.
    18    project: default
    19  
    20    # Source of the application manifests
    21    source:
    22      repoURL: https://github.com/argoproj/argocd-example-apps.git  # Can point to either a Helm chart repo or a git repo.
    23      targetRevision: HEAD  # For Helm, this refers to the chart version.
    24      path: guestbook  # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
    25  
    26      # helm specific config
    27      chart: chart-name  # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts.
    28      helm:
    29        passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains
    30        # Extra parameters to set (same as setting through values.yaml, but these take precedence)
    31        parameters:
    32        - name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname"
    33          value: mydomain.example.com
    34        - name: "ingress.annotations.kubernetes\\.io/tls-acme"
    35          value: "true"
    36          forceString: true # ensures that value is treated as a string
    37  
    38        # Use the contents of files as parameters (uses Helm's --set-file)
    39        fileParameters:
    40        - name: config
    41          path: files/config.json
    42  
    43        # Release name override (defaults to application name)
    44        releaseName: guestbook
    45  
    46        # Helm values files for overriding values in the helm chart
    47        # The path is relative to the spec.source.path directory defined above
    48        valueFiles:
    49        - values-prod.yaml
    50  
    51        # Ignore locally missing valueFiles when installing Helm chart. Defaults to false
    52        ignoreMissingValueFiles: false
    53  
    54        # Values file as block file. Prefer to use valuesObject if possible (see below)
    55        values: |
    56          ingress:
    57            enabled: true
    58            path: /
    59            hosts:
    60              - mydomain.example.com
    61            annotations:
    62              kubernetes.io/ingress.class: nginx
    63              kubernetes.io/tls-acme: "true"
    64            labels: {}
    65            tls:
    66              - secretName: mydomain-tls
    67                hosts:
    68                  - mydomain.example.com
    69  
    70        # Values file as block file. This takes precedence over values
    71        valuesObject:
    72          ingress:
    73            enabled: true
    74            path: /
    75            hosts:
    76              - mydomain.example.com
    77            annotations:
    78              kubernetes.io/ingress.class: nginx
    79              kubernetes.io/tls-acme: "true"
    80            labels: {}
    81            tls:
    82              - secretName: mydomain-tls
    83                hosts:
    84                  - mydomain.example.com
    85  
    86        # Skip custom resource definition installation if chart contains custom resource definitions. Defaults to false
    87        skipCrds: false
    88  
    89        # Optional Helm version to template with. If omitted it will fall back to look at the 'apiVersion' in Chart.yaml
    90        # and decide which Helm binary to use automatically. This field can be either 'v2' or 'v3'.
    91        version: v2
    92  
    93      # kustomize specific config
    94      kustomize:
    95        # Optional kustomize version. Note: version must be configured in argocd-cm ConfigMap
    96        version: v3.5.4
    97        # Supported kustomize transformers. https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
    98        namePrefix: prod-
    99        nameSuffix: -some-suffix
   100        commonLabels:
   101          foo: bar
   102        commonAnnotations:
   103          beep: boop-${ARGOCD_APP_REVISION}
   104        # Toggle which enables/disables env variables substitution in commonAnnotations
   105        commonAnnotationsEnvsubst: true
   106        images:
   107        - gcr.io/heptio-images/ks-guestbook-demo:0.2
   108        - my-app=gcr.io/my-repo/my-app:0.1
   109        namespace: custom-namespace
   110        replicas:
   111        - name: kustomize-guestbook-ui
   112          count: 4
   113  
   114      # directory
   115      directory:
   116        recurse: true
   117        jsonnet:
   118          # A list of Jsonnet External Variables
   119          extVars:
   120          - name: foo
   121            value: bar
   122            # You can use "code to determine if the value is either string (false, the default) or Jsonnet code (if code is true).
   123          - code: true
   124            name: baz
   125            value: "true"
   126          # A list of Jsonnet Top-level Arguments
   127          tlas:
   128          - code: false
   129            name: foo
   130            value: bar
   131        # Exclude contains a glob pattern to match paths against that should be explicitly excluded from being used during
   132        # manifest generation. This takes precedence over the `include` field.
   133        # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{config.yaml,env-use2/*}'
   134        exclude: 'config.yaml'
   135        # Include contains a glob pattern to match paths against that should be explicitly included during manifest
   136        # generation. If this field is set, only matching manifests will be included.
   137        # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{*.yml,*.yaml}'
   138        include: '*.yaml'
   139  
   140      # plugin specific config
   141      plugin:
   142        # If the plugin is defined as a sidecar and name is not passed, the plugin will be automatically matched with the
   143        # Application according to the plugin's discovery rules.
   144        name: mypluginname
   145        # environment variables passed to the plugin
   146        env:
   147          - name: FOO
   148            value: bar
   149        # Plugin parameters are new in v2.5.
   150        parameters:
   151          - name: string-param
   152            string: example-string
   153          - name: array-param
   154            array: [item1, item2]
   155          - name: map-param
   156            map:
   157              param-name: param-value
   158    
   159    # Sources field specifies the list of sources for the application
   160    sources:
   161      - repoURL: https://github.com/argoproj/argocd-example-apps.git  # Can point to either a Helm chart repo or a git repo.
   162        targetRevision: HEAD  # For Helm, this refers to the chart version.
   163        path: guestbook  # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
   164        ref: my-repo  # For Helm, acts as a reference to this source for fetching values files from this source. Has no meaning when under `source` field
   165  
   166    # Destination cluster and namespace to deploy the application
   167    destination:
   168      # cluster API URL
   169      server: https://kubernetes.default.svc
   170      # or cluster name
   171      # name: in-cluster
   172      # The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
   173      namespace: guestbook
   174      
   175    # Extra information to show in the Argo CD Application details tab
   176    info:
   177      - name: 'Example:'
   178        value: 'https://example.com'
   179        
   180    # Sync policy
   181    syncPolicy:
   182      automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
   183        prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
   184        selfHeal: true # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
   185        allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
   186      syncOptions:     # Sync options which modifies sync behavior
   187      - Validate=false # disables resource validation (equivalent to 'kubectl apply --validate=false') ( true by default ).
   188      - CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
   189      - PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
   190      - PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
   191      - RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
   192      - ApplyOutOfSyncOnly=true # Only sync out-of-sync resources, rather than applying every object in the application
   193      managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
   194        labels: # The labels to set on the application namespace
   195          any: label
   196          you: like
   197        annotations: # The annotations to set on the application namespace
   198          the: same
   199          applies: for
   200          annotations: on-the-namespace
   201  
   202      # The retry feature is available since v1.7
   203      retry:
   204        limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
   205        backoff:
   206          duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
   207          factor: 2 # a factor to multiply the base duration after each failed retry
   208          maxDuration: 3m # the maximum amount of time allowed for the backoff strategy
   209  
   210    # Will ignore differences between live and desired states during the diff. Note that these configurations are not
   211    # used during the sync process unless the `RespectIgnoreDifferences=true` sync option is enabled.
   212    ignoreDifferences:
   213    # for the specified json pointers
   214    - group: apps
   215      kind: Deployment
   216      jsonPointers:
   217      - /spec/replicas
   218    - kind: ConfigMap
   219      jqPathExpressions:
   220      - '.data["config.yaml"].auth'
   221    # for the specified managedFields managers
   222    - group: "*"
   223      kind: "*"
   224      managedFieldsManagers:
   225      - kube-controller-manager
   226      # Name and namespace are optional. If specified, they must match exactly, these are not glob patterns.
   227      name: my-deployment
   228      namespace: my-namespace
   229  
   230    # RevisionHistoryLimit limits the number of items kept in the application's revision history, which is used for
   231    # informational purposes as well as for rollbacks to previous versions. This should only be changed in exceptional
   232    # circumstances. Setting to zero will store no history. This will reduce storage used. Increasing will increase the
   233    # space used to store the history, so we do not recommend increasing it.
   234    revisionHistoryLimit: 10