From 42863a475b2b7b73e99e22927c73c33e2251e4a9 Mon Sep 17 00:00:00 2001 From: JesseBot Date: Wed, 17 Aug 2022 21:11:41 +0200 Subject: [PATCH] docs: Add "Create Namespace" to sync options doc (#3490) (#10326) * Add create namespace to the sync options doc Signed-off-by: JesseBot * Update docs/user-guide/sync-options.md Co-authored-by: Michael Crenshaw Signed-off-by: JesseBot Co-authored-by: Michael Crenshaw --- docs/user-guide/sync-options.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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.