Skip to content

Commit

Permalink
docs: add warning for user when using replace sync option (argoproj#1…
Browse files Browse the repository at this point in the history
…1566)

* docs: adding warning to 'replace' sync option

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>

* Update sync-options.md

Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>

Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com>
Signed-off-by: asingh <11219262+ashutosh16@users.noreply.github.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
  • Loading branch information
ashutosh16 authored and emirot committed Jan 27, 2023
1 parent af90bed commit 2ff4f81
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions docs/user-guide/sync-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ metadata:
argocd.argoproj.io/sync-options: Validate=false
```

If you want to exclude a whole class of objects globally, consider setting `resource.customizations` in [system level configuration](../user-guide/diffing.md#system-level-configuration).
If you want to exclude a whole class of objects globally, consider setting `resource.customizations` in [system level configuration](../user-guide/diffing.md#system-level-configuration).

## Skip Dry Run for new custom resources types

When syncing a custom resource which is not yet known to the cluster, there are generally two options:
Expand All @@ -60,9 +60,9 @@ The dry run will still be executed if the CRD is already present in the cluster.

## Selective Sync

Currently when syncing using auto sync Argo CD applies every object in the application.
Currently when syncing using auto sync Argo CD applies every object in the application.
For applications containing thousands of objects this takes quite a long time and puts undue pressure on the api server.
Turning on selective sync option which will sync only out-of-sync resources.
Turning on selective sync option which will sync only out-of-sync resources.

You can add this option by following ways

Expand All @@ -77,7 +77,7 @@ spec:
syncPolicy:
syncOptions:
- ApplyOutOfSyncOnly=true
```
```

2) Set sync option via argocd cli

Expand All @@ -104,8 +104,8 @@ spec:

## Prune Last

This feature is to allow the ability for resource pruning to happen as a final, implicit wave of a sync operation,
after the other resources have been deployed and become healthy, and after all other waves completed successfully.
This feature is to allow the ability for resource pruning to happen as a final, implicit wave of a sync operation,
after the other resources have been deployed and become healthy, and after all other waves completed successfully.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -142,6 +142,10 @@ spec:

If the `Replace=true` sync option is set the Argo CD will use `kubectl replace` or `kubectl create` command to apply changes.

!!! warning
During the sync process, the resources will be synchronized using the 'kubectl replace/create' command.
This sync option has the potential to be destructive and might lead to resources having to be recreated, which could cause an outage for your application.

This can also be configured at individual resource level.
```yaml
metadata:
Expand Down Expand Up @@ -299,8 +303,8 @@ sync option, otherwise nothing will happen. If the namespace doesn't already exi
already have labels and/or annotations set on it, you're good to go. Using `managedNamespaceMetadata` will also set the
resource tracking label (or annotation) on the namespace, so you can easily track which namespaces are managed by ArgoCD.

In the case you do not have any custom annotations or labels but would nonetheless want to have resource tracking set on
your namespace, that can be done by setting `managedNamespaceMetadata` with an empty `labels` and/or `annotations` map,
In the case you do not have any custom annotations or labels but would nonetheless want to have resource tracking set on
your namespace, that can be done by setting `managedNamespaceMetadata` with an empty `labels` and/or `annotations` map,
like the example below:

```yaml
Expand All @@ -311,7 +315,7 @@ metadata:
spec:
syncPolicy:
managedNamespaceMetadata:
labels: # The labels to set on the application namespace
labels: # The labels to set on the application namespace
annotations: # The annotations to set on the application namespace
syncOptions:
- CreateNamespace=true
Expand Down Expand Up @@ -374,7 +378,7 @@ spec:
syncPolicy:
managedNamespaceMetadata:
annotations:
abc: 123
abc: 123
syncOptions:
- CreateNamespace=true
```
Expand All @@ -398,4 +402,3 @@ The resulting namespace will have its annotations set to
foo: bar
something: completely-different
```

0 comments on commit 2ff4f81

Please sign in to comment.