You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/en/docs/installation/platform-notes.md
+29-6
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,38 @@ Depending on the application used to either install and manage Kyverno or the Ku
10
10
11
11
### Notes for ArgoCD users
12
12
13
-
When deploying the Kyverno Helm chart with ArgoCD, you will need to enable `Replace` in the `syncOptions`. You may want to also ignore differences in aggregated ClusterRoles which Kyverno uses by default. Aggregated ClusterRoles are built by aggregating other ClusterRoles in the cluster and are dynamic by nature, therefore desired and observed states cannot match.
13
+
ArgoCD v2.10 introduced support for `ServerSideDiff`, leveraging Kubernetes’ Server Side Apply feature to resolve OutOfSync issues. This strategy ensures comparisons are handled on the server side, respecting fields like `skipBackgroundRequests` that Kubernetes sets by default, and fields set by mutating admission controllers like Kyverno, thereby preventing unnecessary `OutOfSync` errors caused by local manifest discrepancies.
14
14
15
-
You can do so by following instructions in these pages of the ArgoCD documentation:
15
+
You can enable `ServerSideDiff` in two ways:
16
+
* Per Application: Add the `argocd.argoproj.io/compare-options` annotation.
17
+
* Globally: Configure it in the `argocd-cmd-params-cm` ConfigMap.
16
18
17
-
*[Enable Replace in the syncOptions](https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#replace-resource-instead-of-applying-changes)
19
+
Here is a YAML fragment that shows the annotation in an ArgoCD Application resource:
When deploying the Kyverno Helm chart with ArgoCD, it is recommended to use `ServerSideApply` in the `syncOptions`. This approach helps handle metadata issues that may arise when applying the chart.
33
+
34
+
Additionally, you may want to ignore differences in aggregated ClusterRoles, which Kyverno uses by default. Aggregated ClusterRoles are dynamic and built by combining other ClusterRoles in the cluster, leading to discrepancies between desired and observed states.
35
+
36
+
You can do so by following these instructions in the ArgoCD documentation:
*[Ignore diff in aggregated cluster roles](https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/#ignoring-rbac-changes-made-by-aggregateroles)
19
40
20
-
ArgoCD uses Helm only for templating but applies the results with `kubectl`. Unfortunately `kubectl` adds metadata that exceeds the limit allowed by Kubernetes. Using `Replace` overcomes this limitation. Another option is to use server-side apply, supported in ArgoCD v2.5+.
41
+
**Note:** You may want to avoid using `Replace=true` in the `syncOptions` as it can cause issues with existing resources. It is generally recommended to rely on `ServerSideApply` for handling resource updates smoothly.
42
+
21
43
22
-
Below is an example of an ArgoCD Application manifest that should work with the Kyverno Helm chart:
44
+
Here’s an example of an ArgoCD Application manifest that should work with the Kyverno Helm chart:
23
45
24
46
```yaml
25
47
apiVersion: argoproj.io/v1alpha1
@@ -42,7 +64,8 @@ spec:
42
64
selfHeal: true
43
65
syncOptions:
44
66
- CreateNamespace=true
45
-
- Replace=true
67
+
- ServerSideApply=true
68
+
46
69
```
47
70
48
71
For considerations when using Argo CD along with Kyverno mutate policies, see the documentation [here](../writing-policies/mutate.md#argocd).
Copy file name to clipboardexpand all lines: content/en/docs/writing-policies/mutate.md
+1-14
Original file line number
Diff line number
Diff line change
@@ -1222,22 +1222,9 @@ See the [platform notes](../installation/platform-notes.md#notes-for-argocd-user
1222
1222
1223
1223
#### ArgoCD v2.10+
1224
1224
1225
-
ArgoCD version 2.10 added support for [sever side diff](https://argo-cd.readthedocs.io/en/latest/user-guide/diff-strategies/#server-side-diff) which leverage the Kubernetes Server Side Apply feature.
1226
1225
1227
-
Enabling SSA based diffs, requires an annotation to be specified on the application or globally via the “argocd-cmd-params-cm” config map.
1226
+
For considerations when using Argo CD (v2.10+) along with Kyverno, ServerSideDiff is recommended as it resolves OutOfSync warnings by delegating the comparison process to Kubernetes. See the documentation [here](../installation/platform-notes.md#argocd).
1228
1227
1229
-
Here is a YAML fragment that shows the annotation in an ArgoCD Application resource:
0 commit comments