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
When using Flux Kustomization with postBuild.substituteFrom, I sometimes see flakiness where variables in spec.components are not substituted before reconciliation starts. This causes intermittent build failures.
Example error:
kustomization/aws-load-balancer-controller master@sha1:eb8e9d54 False False
kustomize build failed: accumulating components: loader.New "must build at directory: not a valid directory:
evalsymlink failure on '/tmp/kustomization-2899191055/infrastructure/addons/aws-load-balancer-controller/overlays/environments/${environment_name_full}'
: lstat /tmp/kustomization-2899191055/infrastructure/addons/aws-load-balancer-controller/overlays/environments/${environment_name_full}: no such file or directory"
After some retries the reconciliation succeeds, which suggests (?) a race condition in the kustomize-controller. The variables do eventually get substituted correctly.
We have the following setup:
flowchart TB
subgraph clusters
a2["infra-addons-flux-kustomization.yaml"]
a3["extra/kustomization.yaml (active addons)"]
end
subgraph infra["infrastructure/addons/*"]
b["addon folders (one per addon)<br>flux-kustomization → overlays/base → env/region components"]
end
subgraph subst["cell-metadata (configmap)"]
d["postBuild.substituteFrom<br>(${env}, ${region}, ${cluster}, etc.)"]
end
subgraph flux
e["kustomize controller"]
f["helm controller"]
end
g["rendered workloads in cluster"]
%% flow
a2 --> a3
a3 --> infra
infra --> e
d --> e
e -->|"helmrelease crs"| f
f --> g
Loading
0. In-Cluster ConfigMap
apiVersion: v1kind: ConfigMapmetadata:
name: cell-metadatanamespace: flux-systemdata:
environment_name_full: developmentaws_region: eu-north-1aws_cluster_name: example
When using Flux
KustomizationwithpostBuild.substituteFrom, I sometimes see flakiness where variables inspec.componentsare not substituted before reconciliation starts. This causes intermittent build failures.Example error:
After some retries the reconciliation succeeds, which suggests (?) a race condition in the
kustomize-controller. The variables do eventually get substituted correctly.We have the following setup:
flowchart TB subgraph clusters a2["infra-addons-flux-kustomization.yaml"] a3["extra/kustomization.yaml (active addons)"] end subgraph infra["infrastructure/addons/*"] b["addon folders (one per addon)<br>flux-kustomization → overlays/base → env/region components"] end subgraph subst["cell-metadata (configmap)"] d["postBuild.substituteFrom<br>(${env}, ${region}, ${cluster}, etc.)"] end subgraph flux e["kustomize controller"] f["helm controller"] end g["rendered workloads in cluster"] %% flow a2 --> a3 a3 --> infra infra --> e d --> e e -->|"helmrelease crs"| f f --> g0. In-Cluster ConfigMap
1. Cluster-Level Entrypoint
./clusters/eu-north-1/example/infra-addons-flux-kustomization.yaml:./clusters/eu-north-1/example/extra/kustomization.yaml:2. Example addon (
aws-load-balancer-controller)infrastructure/addons/aws-load-balancer-controller:infrastructure/addons/aws-load-balancer-controller/flux-kustomization.yamlI'm running: