github.com/argoproj/argo-cd/v3@v3.2.1/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        # Skip schema validation if chart contains JSON schema validation. Defaults to false
    90        skipSchemaValidation: false
    91  
    92        # Optional Helm version to template with. If omitted it will fall back to look at the 'apiVersion' in Chart.yaml
    93        # and decide which Helm binary to use automatically. This field can be either 'v2' or 'v3'.
    94        version: v2
    95  
    96        # You can specify the Kubernetes API version to pass to Helm when templating manifests. By default, Argo CD uses
    97        # the Kubernetes version of the target cluster. The value must be semver formatted. Do not prefix with `v`.
    98        kubeVersion: 1.30.0
    99  
   100        # You can specify the Kubernetes resource API versions to pass to Helm when templating manifests. By default, Argo
   101        # CD uses the API versions of the target cluster. The format is [group/]version/kind.
   102        apiVersions:
   103          - traefik.io/v1alpha1/TLSOption
   104          - v1/Service
   105  
   106        # Optional namespace to template with. If left empty, defaults to the app's destination namespace.
   107        namespace: custom-namespace
   108  
   109      # kustomize specific config
   110      kustomize:
   111        # Optional kustomize version. Note: version must be configured in argocd-cm ConfigMap
   112        version: v3.5.4
   113        # Supported kustomize transformers. https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
   114        namePrefix: prod-
   115        nameSuffix: -some-suffix
   116        commonLabels:
   117          foo: bar
   118        commonAnnotations:
   119          beep: boop-${ARGOCD_APP_REVISION}
   120        # Toggle which enables/disables env variables substitution in commonAnnotations
   121        commonAnnotationsEnvsubst: true
   122        # Defines if the common label(s) should be applied to resource selectors. It also excludes common labels from
   123        # templates unless `labelIncludeTemplates` is set to true.
   124        labelWithoutSelector: false
   125        # Defines if the common label(s) should be applied to resource templates.
   126        labelIncludeTemplates: false
   127        forceCommonLabels: false
   128        forceCommonAnnotations: false
   129        images:
   130        - quay.io/argoprojlabs/argocd-e2e-container:0.2
   131        - my-app=gcr.io/my-repo/my-app:0.1
   132        namespace: custom-namespace
   133        replicas:
   134        - name: kustomize-guestbook-ui
   135          count: 4
   136        components:
   137          - ../component  # relative to the kustomization.yaml (`source.path`).
   138        # Ignore locally missing component directories when using Kustomize Components. Defaults to false
   139        ignoreMissingComponents: true
   140        patches:
   141          - target:
   142              kind: Deployment
   143              name: guestbook-ui
   144            patch: |-
   145              - op: add # Add new element to manifest
   146                path: /spec/template/spec/nodeSelector/
   147                value:
   148                  env: "pro"
   149  
   150        # You can specify the Kubernetes API version to pass to Helm when templating manifests. By default, Argo CD uses
   151        # the Kubernetes version of the target cluster. The value must be semver formatted. Do not prefix with `v`.
   152        kubeVersion: 1.30.0
   153  
   154        # You can specify the Kubernetes resource API versions to pass to Helm when templating manifests. By default, Argo
   155        # CD uses the API versions of the target cluster. The format is [group/]version/kind.
   156        apiVersions:
   157          - traefik.io/v1alpha1/TLSOption
   158          - v1/Service
   159  
   160      # directory
   161      directory:
   162        recurse: true
   163        jsonnet:
   164          # A list of Jsonnet External Variables
   165          extVars:
   166          - name: foo
   167            value: bar
   168            # You can use "code" to determine if the value is either string (false, the default) or Jsonnet code (if code is true).
   169          - code: true
   170            name: baz
   171            value: "true"
   172          # A list of Jsonnet Top-level Arguments
   173          tlas:
   174          - code: false
   175            name: foo
   176            value: bar
   177        # Exclude contains a glob pattern to match paths against that should be explicitly excluded from being used during
   178        # manifest generation. This takes precedence over the `include` field.
   179        # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{config.yaml,env-use2/*}'
   180        exclude: 'config.yaml'
   181        # Include contains a glob pattern to match paths against that should be explicitly included during manifest
   182        # generation. If this field is set, only matching manifests will be included.
   183        # To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{*.yml,*.yaml}'
   184        include: '*.yaml'
   185  
   186      # plugin specific config
   187      plugin:
   188        # If the plugin is defined as a sidecar and name is not passed, the plugin will be automatically matched with the
   189        # Application according to the plugin's discovery rules.
   190        name: mypluginname
   191        # environment variables passed to the plugin
   192        env:
   193          - name: FOO
   194            value: bar
   195        # Plugin parameters are new in v2.5.
   196        parameters:
   197          - name: string-param
   198            string: example-string
   199          - name: array-param
   200            array: [item1, item2]
   201          - name: map-param
   202            map:
   203              param-name: param-value
   204    
   205    # Sources field specifies the list of sources for the application
   206    sources:
   207      - repoURL: https://github.com/argoproj/argocd-example-apps.git  # Can point to either a Helm chart repo or a git repo.
   208        targetRevision: HEAD  # For Helm, this refers to the chart version.
   209        path: guestbook  # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
   210        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
   211  
   212    # Destination cluster and namespace to deploy the application
   213    destination:
   214      # cluster API URL
   215      server: https://kubernetes.default.svc
   216      # or cluster name
   217      # name: in-cluster
   218      # The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
   219      namespace: guestbook
   220      
   221    # Extra information to show in the Argo CD Application details tab
   222    info:
   223      - name: 'Example:'
   224        value: 'https://example.com'
   225        
   226    # Sync policy
   227    syncPolicy:
   228      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.
   229        enabled: true # Enables automated syncing of the application ( true by default ).
   230        prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
   231        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 ).
   232        allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
   233      syncOptions:     # Sync options which modifies sync behavior
   234      - Validate=false # disables resource validation (equivalent to 'kubectl apply --validate=false') ( true by default ).
   235      - CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
   236      - PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
   237      - PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
   238      - RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
   239      - ApplyOutOfSyncOnly=true # Only sync out-of-sync resources, rather than applying every object in the application
   240      - SkipDryRunOnMissingResource=true # Allow skip dry run on missing resource
   241      - Replace=true # Argo CD will use kubectl replace or kubectl create command to apply changes.
   242      managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
   243        labels: # The labels to set on the application namespace
   244          any: label
   245          you: like
   246        annotations: # The annotations to set on the application namespace
   247          the: same
   248          applies: for
   249          annotations: on-the-namespace
   250  
   251      # The retry feature is available since v1.7
   252      retry:
   253        limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
   254        backoff:
   255          duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
   256          factor: 2 # a factor to multiply the base duration after each failed retry
   257          maxDuration: 3m # the maximum amount of time allowed for the backoff strategy
   258  
   259    # Will ignore differences between live and desired states during the diff. Note that these configurations are not
   260    # used during the sync process unless the `RespectIgnoreDifferences=true` sync option is enabled.
   261    ignoreDifferences:
   262    # for the specified json pointers
   263    - group: apps
   264      kind: Deployment
   265      jsonPointers:
   266      - /spec/replicas
   267    - kind: ConfigMap
   268      jqPathExpressions:
   269      # Example: Ignore changes to a specific key inside a ConfigMap
   270      - '.data["config.yaml"]'
   271    # for the specified managedFields managers
   272    - group: "*"
   273      kind: "*"
   274      managedFieldsManagers:
   275      - kube-controller-manager
   276      # Name and namespace are optional. If specified, they must match exactly, these are not glob patterns.
   277      name: my-deployment
   278      namespace: my-namespace
   279  
   280    # RevisionHistoryLimit limits the number of items kept in the application's revision history, which is used for
   281    # informational purposes as well as for rollbacks to previous versions. This should only be changed in exceptional
   282    # circumstances. Setting to zero will store no history. This will reduce storage used. Increasing will increase the
   283    # space used to store the history, so we do not recommend increasing it.
   284    revisionHistoryLimit: 10