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
I'm having trouble with a relatively common pattern:
Deploy infrastructure
Deploy an application that has a dependency on a component of the infrastructure.
I know that if I make two Flux Kustomizations (apps and infrastructure), I should be able to use dependsOn to force Flux to deploy infrastructure first, then apps. However, I can't get it to work as I expect it to. I suspect I have a fundamental misunderstanding of FluxCD (and perhaps Kubernetes!).
Requirements:
Application is a plain Kubernetes deployment.
Application requires an HTTPRoute
HTTPRoute requires CRDs and Gateway managed by infrastructure
Based on my understanding of how FluxCD handles plain YAML files, flux will automatically process the manifests in my application. Following concepts in the Kustomize Helm example I created two new Flux Kustomizations to gain control over the order in which infrastructure and apps and deployed.
However, when bootstrapping, FluxCD always processes the apps first, which causes the reconciliation to fail immediately.
Here's a truncated version of my infra and apps kustomizations. I've gone through multiple iterations using various intervals, timings, healthchecks, and wait flags. At this point, I'm not sure if I just haven't hit the magic combination, or if I'm essentially working with an anti-pattern of my own doing.
Note that if I remove ./apps from my repo, the infrastructure spins up fine. If I then add .apps/, the applications also work as expected. I just can't seem to do them all in a single bootstrap.
Here's a truncated version of my infra and apps kustomizations.
2025-02-28T15:29:20.440Z error Kustomization/flux-system.flux-system - Reconciliation failed after 738.701414ms, next try in 10m0s HTTPRoute/my-application/my-application-route dry-run failed: no matches for kind "HTTPRoute" in version "gateway.networking.k8s.io/v1"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having trouble with a relatively common pattern:
I know that if I make two Flux Kustomizations (
apps
andinfrastructure
), I should be able to usedependsOn
to force Flux to deploy infrastructure first, then apps. However, I can't get it to work as I expect it to. I suspect I have a fundamental misunderstanding of FluxCD (and perhaps Kubernetes!).Requirements:
Based on my understanding of how FluxCD handles plain YAML files, flux will automatically process the manifests in my application. Following concepts in the Kustomize Helm example I created two new Flux Kustomizations to gain control over the order in which infrastructure and apps and deployed.
However, when bootstrapping, FluxCD always processes the apps first, which causes the reconciliation to fail immediately.
Here's a truncated version of my infra and apps kustomizations. I've gone through multiple iterations using various intervals, timings, healthchecks, and
wait
flags. At this point, I'm not sure if I just haven't hit the magic combination, or if I'm essentially working with an anti-pattern of my own doing.Note that if I remove
./apps
from my repo, the infrastructure spins up fine. If I then add.apps/,
the applications also work as expected. I just can't seem to do them all in a single bootstrap.Here's a truncated version of my infra and apps kustomizations.
Here's a truncated version of my repository structure:
Related error from
flux logs
:Possibly related issues / discussions:
Any hints pointing me in the right direction would be greatly appreciated.
(I do have a workaround where these resources are handled outside of flux, but I'm curious about what I'm missing).
eb
Beta Was this translation helpful? Give feedback.
All reactions