{"id":30278,"date":"2022-06-14T21:12:06","date_gmt":"2022-06-14T21:12:06","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=30278"},"modified":"2022-12-23T05:52:46","modified_gmt":"2022-12-23T05:52:46","slug":"sync-options-in-argo-cd","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/sync-options-in-argo-cd\/","title":{"rendered":"Sync Options in Argo CD"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30-1024x500.png\" alt=\"\" class=\"wp-image-30279\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30-1024x500.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30-300x146.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30-768x375.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30-1536x749.png 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-30.png 1773w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Common to both manual and automatic sync policies.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Skip schema validation<\/strong>: When selected, bypasses validating the YAML schema.<\/li><li><strong>Auto-create namespace<\/strong>: When selected, automatically create the namespace if the specified namespace does not exist in the cluster.<\/li><li><strong>Prune last<\/strong>: When selected, removes those resources that do not exist in the currently deployed version during the final wave of the sync operation. See\u00a0<a target=\"_blank\" rel=\"noreferrer noopener\">Prune last<\/a>.<\/li><li><strong>Apply out of sync only<\/strong>: When selected, syncs only those resources in the application that have been changed and are\u00a0<strong>OutOfSync<\/strong>, instead of syncing every resource regardless of their state. This option is useful to reduce load and save time when you have thousands of resources in an application. <\/li><li><strong>Selective sync:<\/strong> Currently when syncing using auto sync ArgoCD 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.<\/li><\/ul>\n\n\n\n<p><strong>Prune propagation policy<\/strong>:<br>Defines how resources are pruned, applying Kubernetes cascading deletion prune policies. For more information, see&nbsp;<a href=\"https:\/\/kubernetes.io\/docs\/concepts\/architecture\/garbage-collection\/#cascading-deletion\" target=\"_blank\" rel=\"noreferrer noopener\">Kubernetes &#8211; Cascading deletion<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Foreground<\/strong>: The default prune propagation policy used by Argo CD. With this policy, Kubernetes changes the state of the owner resource to `deletion in progress`, until the controller deletes the dependent resources and finally the owner resource itself.<\/li><li><strong>Background<\/strong>: When selected, Kubernetes deletes the owner resource immediately, and then deletes the dependent resources in the background.<\/li><li><strong>Orphan<\/strong>: When selected, Kubernetes deletes the dependent resources that remain orphaned after the owner resource is deleted.<\/li><\/ul>\n\n\n\n<p>All Prune propagation policies can be used with:<\/p>\n\n\n\n<p><strong>Replace<\/strong>: When selected, Argo CD executes&nbsp;<code>kubectl replace<\/code>&nbsp;or&nbsp;<code>kubectl create<\/code>, instead of the default&nbsp;<code>kubectl apply<\/code>&nbsp;to enforce the changes in Git. This action will potentially recreate resources and should be used with care. See&nbsp;<a href=\"https:\/\/argo-cd.readthedocs.io\/en\/stable\/user-guide\/sync-options\/#replace-resource-instead-of-applying-changes\" target=\"_blank\" rel=\"noreferrer noopener\">Replace Resource Instead Of Applying Change<\/a>.<\/p>\n\n\n\n<p><strong>Retry<\/strong>: When selected, retries a failed sync operation, based on the retry settings configured:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Maximum number of sync retries (<strong>Limit<\/strong>)<\/li><li>Duration of each retry attempt in seconds, minutes, or hours (<strong>Duration<\/strong>)<\/li><li>Maximum duration permitted for each retry (<strong>Max Duration<\/strong>)<\/li><li>Factor by which to multiply the Duration in the event of a failed retry (<strong>Factor<\/strong>). A factor of 2 for example, attempts the second retry in 2 X 2 seconds, where 2 seconds is the Duration.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Common to both manual and automatic sync policies. Skip schema validation: When selected, bypasses validating the YAML schema. Auto-create namespace: When selected, automatically create the namespace if the specified namespace does not exist in the cluster. Prune last: When selected, removes those resources that do not exist in the currently deployed version during the final&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-30278","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=30278"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30278\/revisions"}],"predecessor-version":[{"id":30280,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30278\/revisions\/30280"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=30278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=30278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=30278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}