github.com/argoproj/argo-cd/v3@v3.2.1/docs/user-guide/commands/argocd_admin_app_generate-spec.md (about)

     1  # `argocd admin app generate-spec` Command Reference
     2  
     3  ## argocd admin app generate-spec
     4  
     5  Generate declarative config for an application
     6  
     7  ```
     8  argocd admin app generate-spec APPNAME [flags]
     9  ```
    10  
    11  ### Examples
    12  
    13  ```
    14  
    15  	# Generate declarative config for a directory app
    16  	argocd admin app generate-spec guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-namespace default --dest-server https://kubernetes.default.svc --directory-recurse
    17  
    18  	# Generate declarative config for a Jsonnet app
    19  	argocd admin app generate-spec jsonnet-guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path jsonnet-guestbook --dest-namespace default --dest-server https://kubernetes.default.svc --jsonnet-ext-str replicas=2
    20  
    21  	# Generate declarative config for a Helm app
    22  	argocd admin app generate-spec helm-guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path helm-guestbook --dest-namespace default --dest-server https://kubernetes.default.svc --helm-set replicaCount=2
    23  
    24  	# Generate declarative config for a Helm app from a Helm repo
    25  	argocd admin app generate-spec nginx-ingress --repo https://charts.helm.sh/stable --helm-chart nginx-ingress --revision 1.24.3 --dest-namespace default --dest-server https://kubernetes.default.svc
    26  
    27  	# Generate declarative config for a Kustomize app
    28  	argocd admin app generate-spec kustomize-guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path kustomize-guestbook --dest-namespace default --dest-server https://kubernetes.default.svc --kustomize-image quay.io/argoprojlabs/argocd-e2e-container:0.1
    29  
    30  	# Generate declarative config for a app using a custom tool:
    31  	argocd admin app generate-spec kasane --repo https://github.com/argoproj/argocd-example-apps.git --path plugins/kasane --dest-namespace default --dest-server https://kubernetes.default.svc --config-management-plugin kasane
    32  
    33  ```
    34  
    35  ### Options
    36  
    37  ```
    38        --allow-empty                                Set allow zero live resources when sync is automated
    39        --annotations stringArray                    Set metadata annotations (e.g. example=value)
    40        --auto-prune                                 Set automatic pruning when sync is automated
    41        --config-management-plugin string            Config management plugin name
    42        --dest-name string                           K8s cluster Name (e.g. minikube)
    43        --dest-namespace string                      K8s target namespace
    44        --dest-server string                         K8s cluster URL (e.g. https://kubernetes.default.svc)
    45        --directory-exclude string                   Set glob expression used to exclude files from application source path
    46        --directory-include string                   Set glob expression used to include files from application source path
    47        --directory-recurse                          Recurse directory
    48        --dry-source-path string                     Path in repository to the app directory for the dry source
    49        --dry-source-repo string                     Repository URL of the app dry source
    50        --dry-source-revision string                 Revision of the app dry source
    51        --env string                                 Application environment to monitor
    52    -f, --file string                                Filename or URL to Kubernetes manifests for the app
    53        --helm-api-versions stringArray              Helm api-versions (in format [group/]version/kind) to use when running helm template (Can be repeated to set several values: --helm-api-versions traefik.io/v1alpha1/TLSOption --helm-api-versions v1/Service). If not set, use the api-versions from the destination cluster
    54        --helm-chart string                          Helm Chart name
    55        --helm-kube-version string                   Helm kube-version to use when running helm template. If not set, use the kube version from the destination cluster
    56        --helm-namespace string                      Helm namespace to use when running helm template. If not set, use app.spec.destination.namespace
    57        --helm-pass-credentials                      Pass credentials to all domain
    58        --helm-set stringArray                       Helm set values on the command line (can be repeated to set several values: --helm-set key1=val1 --helm-set key2=val2)
    59        --helm-set-file stringArray                  Helm set values from respective files specified via the command line (can be repeated to set several values: --helm-set-file key1=path1 --helm-set-file key2=path2)
    60        --helm-set-string stringArray                Helm set STRING values on the command line (can be repeated to set several values: --helm-set-string key1=val1 --helm-set-string key2=val2)
    61        --helm-skip-crds                             Skip helm crd installation step
    62        --helm-skip-schema-validation                Skip helm schema validation step
    63        --helm-skip-tests                            Skip helm test manifests installation step
    64        --helm-version string                        Helm version
    65    -h, --help                                       help for generate-spec
    66        --hydrate-to-branch string                   The branch to hydrate the app to
    67        --ignore-missing-components                  Ignore locally missing component directories when setting Kustomize components
    68        --ignore-missing-value-files                 Ignore locally missing valueFiles when setting helm template --values
    69    -i, --inline                                     If set then generated resource is written back to the file specified in --file flag
    70        --jsonnet-ext-var-code stringArray           Jsonnet ext var
    71        --jsonnet-ext-var-str stringArray            Jsonnet string ext var
    72        --jsonnet-libs stringArray                   Additional jsonnet libs (prefixed by repoRoot)
    73        --jsonnet-tla-code stringArray               Jsonnet top level code arguments
    74        --jsonnet-tla-str stringArray                Jsonnet top level string arguments
    75        --kustomize-api-versions stringArray         api-versions (in format [group/]version/kind) to use when running helm template (Can be repeated to set several values: --helm-api-versions traefik.io/v1alpha1/TLSOption --helm-api-versions v1/Service). If not set, use the api-versions from the destination cluster. Only applicable when Helm is enabled for Kustomize builds
    76        --kustomize-common-annotation stringArray    Set common labels in Kustomize
    77        --kustomize-common-label stringArray         Set common labels in Kustomize
    78        --kustomize-force-common-annotation          Force common annotations in Kustomize
    79        --kustomize-force-common-label               Force common labels in Kustomize
    80        --kustomize-image stringArray                Kustomize images (e.g. --kustomize-image node:8.15.0 --kustomize-image mysql=mariadb,alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d)
    81        --kustomize-kube-version string              kube-version to use when running helm template. If not set, use the kube version from the destination cluster. Only applicable when Helm is enabled for Kustomize builds
    82        --kustomize-label-include-templates          Apply common label to resource templates
    83        --kustomize-label-without-selector           Do not apply common label to selectors. Also do not apply label to templates unless --kustomize-label-include-templates is set
    84        --kustomize-namespace string                 Kustomize namespace
    85        --kustomize-replica stringArray              Kustomize replicas (e.g. --kustomize-replica my-development=2 --kustomize-replica my-statefulset=4)
    86        --kustomize-version string                   Kustomize version
    87    -l, --label stringArray                          Labels to apply to the app
    88        --name string                                A name for the app, ignored if a file is set (DEPRECATED)
    89        --nameprefix string                          Kustomize nameprefix
    90        --namesuffix string                          Kustomize namesuffix
    91    -o, --output string                              Output format. One of: json|yaml (default "yaml")
    92    -p, --parameter stringArray                      set a parameter override (e.g. -p guestbook=image=example/guestbook:latest)
    93        --path string                                Path in repository to the app directory, ignored if a file is set
    94        --plugin-env stringArray                     Additional plugin envs
    95        --project string                             Application project name
    96        --ref string                                 Ref is reference to another source within sources field
    97        --release-name string                        Helm release-name
    98        --repo string                                Repository URL, ignored if a file is set
    99        --revision string                            The tracking source branch, tag, commit or Helm chart version the application will sync to
   100        --revision-history-limit int                 How many items to keep in revision history (default 10)
   101        --self-heal                                  Set self healing when sync is automated
   102        --set-finalizer                              Sets deletion finalizer on the application, application resources will be cascaded on deletion
   103        --source-name string                         Name of the source from the list of sources of the app.
   104        --sync-option Prune=false                    Add or remove a sync option, e.g add Prune=false. Remove using `!` prefix, e.g. `!Prune=false`
   105        --sync-policy string                         Set the sync policy (one of: manual (aliases of manual: none), automated (aliases of automated: auto, automatic))
   106        --sync-retry-backoff-duration duration       Sync retry backoff base duration. Input needs to be a duration (e.g. 2m, 1h) (default 5s)
   107        --sync-retry-backoff-factor int              Factor multiplies the base duration after each failed sync retry (default 2)
   108        --sync-retry-backoff-max-duration duration   Max sync retry backoff duration. Input needs to be a duration (e.g. 2m, 1h) (default 3m0s)
   109        --sync-retry-limit int                       Max number of allowed sync retries
   110        --sync-retry-refresh                         Indicates if the latest revision should be used on retry instead of the initial one
   111        --sync-source-branch string                  The branch from which the app will sync
   112        --sync-source-path string                    The path in the repository from which the app will sync
   113        --validate                                   Validation of repo and cluster (default true)
   114        --values stringArray                         Helm values file(s) to use
   115        --values-literal-file string                 Filename or URL to import as a literal Helm values block
   116  ```
   117  
   118  ### Options inherited from parent commands
   119  
   120  ```
   121        --argocd-context string           The name of the Argo-CD server context to use
   122        --auth-token string               Authentication token; set this or the ARGOCD_AUTH_TOKEN environment variable
   123        --client-crt string               Client certificate file
   124        --client-crt-key string           Client certificate key file
   125        --config string                   Path to Argo CD config (default "/home/user/.config/argocd/config")
   126        --controller-name string          Name of the Argo CD Application controller; set this or the ARGOCD_APPLICATION_CONTROLLER_NAME environment variable when the controller's name label differs from the default, for example when installing via the Helm chart (default "argocd-application-controller")
   127        --core                            If set to true then CLI talks directly to Kubernetes instead of talking to Argo CD API server
   128        --grpc-web                        Enables gRPC-web protocol. Useful if Argo CD server is behind proxy which does not support HTTP2.
   129        --grpc-web-root-path string       Enables gRPC-web protocol. Useful if Argo CD server is behind proxy which does not support HTTP2. Set web root.
   130    -H, --header strings                  Sets additional header to all requests made by Argo CD CLI. (Can be repeated multiple times to add multiple headers, also supports comma separated headers)
   131        --http-retry-max int              Maximum number of retries to establish http connection to Argo CD server
   132        --insecure                        Skip server certificate and domain verification
   133        --kube-context string             Directs the command to the given kube-context
   134        --logformat string                Set the logging format. One of: json|text (default "json")
   135        --loglevel string                 Set the logging level. One of: debug|info|warn|error (default "info")
   136        --plaintext                       Disable TLS
   137        --port-forward                    Connect to a random argocd-server port using port forwarding
   138        --port-forward-namespace string   Namespace name which should be used for port forwarding
   139        --prompts-enabled                 Force optional interactive prompts to be enabled or disabled, overriding local configuration. If not specified, the local configuration value will be used, which is false by default.
   140        --redis-compress string           Enable this if the application controller is configured with redis compression enabled. (possible values: gzip, none) (default "gzip")
   141        --redis-haproxy-name string       Name of the Redis HA Proxy; set this or the ARGOCD_REDIS_HAPROXY_NAME environment variable when the HA Proxy's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis-ha-haproxy")
   142        --redis-name string               Name of the Redis deployment; set this or the ARGOCD_REDIS_NAME environment variable when the Redis's name label differs from the default, for example when installing via the Helm chart (default "argocd-redis")
   143        --repo-server-name string         Name of the Argo CD Repo server; set this or the ARGOCD_REPO_SERVER_NAME environment variable when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-repo-server")
   144        --server string                   Argo CD server address
   145        --server-crt string               Server certificate file
   146        --server-name string              Name of the Argo CD API server; set this or the ARGOCD_SERVER_NAME environment variable when the server's name label differs from the default, for example when installing via the Helm chart (default "argocd-server")
   147  ```
   148  
   149  ### SEE ALSO
   150  
   151  * [argocd admin app](argocd_admin_app.md)	 - Manage applications configuration
   152