diff --git a/docs/user-guide/sync-options.md b/docs/user-guide/sync-options.md index c48341031d109..5b120ffa9736c 100644 --- a/docs/user-guide/sync-options.md +++ b/docs/user-guide/sync-options.md @@ -214,3 +214,17 @@ spec: ``` The example above shows how an ArgoCD Application can be configured so it will ignore the `spec.replicas` field from the desired state (git) during the sync stage. This is achieve by calculating and pre-patching the desired state before applying it in the cluster. Note that the `RespectIgnoreDifferences` sync option is only effective when the resource is already created in the cluster. If the Application is being created and no live state exists, the desired state is applied as-is. + +## Create Namespace + +```yaml +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + namespace: test +spec: + syncPolicy: + syncOptions: + - CreateNamespace=true +``` +The example above shows how an Argo CD Application can be configured so it will create namespaces for the Application resources if the namespaces don't exist already. Without this either declared in the Application manifest or passed in the cli via `--sync-option CreateNamespace=true`, the Application will fail to sync if the resources' namespaces do not exist.