-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argo cd doesn't respect waves #8358
Comments
Hi. Sync-waves only apply during the same sync context, and not globally. So, they are not respected across different Applications, since each Application will have its own sync context. There is some ongoing effort to implement dependencies between Applications (#7437, #3892). I think we should close this issue as a duplicate. |
Oh, I see. Docs description was not clear at all in regard. So the only feasible way for this to work (right now) is to wrap these apps inside one giant helm chart to emulate apps of apps behaviour? |
@alekc I'm also having issues with installing kyverno using argocd. Even with app of apps, because kyverno needs to be up (CRD's installed) before the policies are installed I'm having issues :-( Did you manage to fix this somehow? Maybe helm dependencies? But that does not make sure kyverno is installed first, it just installs other things :-( Thanks for any help. Cheers |
In my pipeline I did a very bad thing....
Basically used a wrapper based on
https://artifacthub.io/packages/helm/kiwigrid/any-resource to create a set
of argo applications. In this way argo sees them as apps of apps and
respects wave attributes.
It is ugly but it works. So far I was unable to find a better way to deal
with this issue given my deployment requirements.
…On Fri, 25 Mar 2022, 17:42 Flávio Moringa, ***@***.***> wrote:
@alekc <https://github.com/alekc> I'm also having issues with installing
kyverno using argocd. Even with app of apps, because kyverno needs to be up
(CRD's installed) before the policies are installed I'm having issues :-(
Did you manage to fix this somehow? Maybe helm dependencies? But that does
not make sure kyverno is installed first, it just installs other things :-(
Thanks for any help.
Cheers
—
Reply to this email directly, view it on GitHub
<#8358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACJ5VZAYFGKSBQUN76TA3LVBX3GXANCNFSM5NPHZGVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
But in app of apps how do you define the dependencies using waves? I'm probably missing something obvious here :-( And thanks for the help |
@flaviomoringa yes, I've added that to argo cd config (not too sure if that was required, but won't hurt having it). As for the declaration, here is a small example (it's a terraform based approach) locals {
wrappedApps = {
// wave -25
"priority-classes" = templatefile(
"${path.module}/templates/argo-helm-app.yaml", merge(local.argocd_default_app_values, {
name = "priority-classes"
namespace = "runtime"
project = "runtime"
helm_chart = "any-resource"
helm_chart_repoUrl = "https://kiwigrid.github.io"
helm_chart_version = "0.1.0"
argocd_wave = "-25"
// language=yaml
helm_values = <<-EOT
anyResources:
high_priority: |-
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
globalDefault: false
description: "high priority pods."
medium_priority: |-
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: medium-priority
value: 500000
globalDefault: false
description: "medium priority pods."
EOT
}))
// Wave -20
"kyverno" = !var.app_kyverno_enable ? null : templatefile(
"${path.module}/templates/argo-helm-app.yaml", merge(local.argocd_default_app_values, {
name = var.app_kyverno_helm_chart_name
namespace = "runtime"
project = "runtime"
helm_chart = var.app_kyverno_helm_chart_name
helm_chart_repoUrl = var.app_kyverno_helm_chart
helm_chart_version = var.app_kyverno_helm_chart_version
argocd_wave = "-20"
helm_values = <<-EOF
resources:
requests:
cpu: 109m
memory: 226M
limits:
cpu: 109m
memory: 226M
EOF
}))
........ and then that local is looped and rendered with resource "kubectl_manifest" "argocd-app-wrapper" {
depends_on = [kubectl_manifest.argocd-project-runtime, kubectl_manifest.argocd-project-monitoring]
wait = true
// language=yaml
yaml_body = <<-EOT
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: bootstrap-app-wrapper
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-100"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
chart: any-resource
repoURL: https://kiwigrid.github.io
targetRevision: "0.1.0"
helm:
values: |
anyResources:
%{~for key, val in local.wrappedApps}
%{~if val != null}
${key}: |-
${indent(12, val)}
%{~endif}
%{~endfor}
destination:
server: https://kubernetes.default.svc
namespace: "default"
syncPolicy:
automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
prune: true
selfHeal: true
syncOptions: # Sync options which modifies sync behavior
- CreateNamespace=true
retry:
limit: 10 # number of failed sync attempt retries; unlimited number of attempts if less than 0
backoff:
duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
factor: 2 # a factor to multiply the base duration after each failed retry
maxDuration: 3m # the maximum amount of time allowed for the backoff strategy
EOT As you can see, we create an application called Let me know if you need further help. |
this makes waves work ? |
Yes because in this way, they are under the same context as described in
#8358 (comment)
…On Fri, 1 Apr 2022, 20:09 Rafael Sathler, ***@***.***> wrote:
this makes waves work ?
—
Reply to this email directly, view it on GitHub
<#8358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACJ5V6WN5AFFQ3LM5SAU73VC5CXNANCNFSM5NPHZGVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@alekc Could you clarify if this preserved order only during bootstrap? Or does this also preserve order when syncing differences across both applications at the same time? |
not sure I understand. As long as the apps manifesto are part of the same helm chart (see example above), it will respect the wave settings on them during the installation and during sync stages. |
Checklist:
argocd version
.Similar to #5146 and #5585
Describe the bug
When applying multiple argocd application (not apps of the apps) with different sync waves annotations, they are not respected. I.e
Having
and
Kyverno starts much later
than overprovisioner
I've also tried to follow https://argo-cd.readthedocs.io/en/stable/operator-manual/upgrading/1.7-1.8/#health-assessement-of-argoprojioapplication-crd-has-been-removed and changed my argocd-cm
(for which btw there is no mention about it here https://argo-cd.readthedocs.io/en/stable/user-guide/sync-waves/)
but still no luck.
To Reproduce
Expected behavior
Resources pass from one wave to another only when the previous wave is finished and all applications are in synced and healthy state
Screenshots
Version
2.2.3
The text was updated successfully, but these errors were encountered: