kustomize-controller
kustomize-controller copied to clipboard
MalformedYAMLError when kustomize remote base can’t be accessed
Flux is unable to kustomize a kustomization object with https url resource in.
Warning BuildFailed 2m (x33 over 5h12m) kustomize-controller kustomize build failed: accumulating resources: accumulating resources from 'https://gitlab.interl.url/repo/repo-library.git//library?ref=xxxxxxxxxxxx': MalformedYAMLError: yaml: line 3: mapping values are not allowed in this context in File: https://gitlab.internal.url/repo/repo-library.git//library?ref=xxxxxxxxxxx
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- "https://gitlab.internal.url/repo/repo-library.git//library?ref=xxxxxxxxxxxx"
Does it work with kustomize build .
?
both kubectl kustomize
and kustomize
binary directly work
Is that repository public? Can you also post here your flux check
output please.
➜ flux check
► checking prerequisites
✔ Kubernetes 1.24.9+rke2r2 >=1.24.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.32.2
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.0.0-rc.2
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.0.0-rc.2
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.0.0-rc.2
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta2
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta2
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed
the repo is private, for now I was able to workaround the issue by adding the url kustomize object as a submodule and then referencing a local directory vs a remote url. Not sure if this was an issue with authentication that looked like kustomization parsing error.
Yeah looks like Kustomize v5 has a bug where it shows MalformedYAMLError instead of network errors. We don’t recommend using remote bases, nor do we support private repos like that, using Flux GitRepositories is how you can fetch manifests from Git and unlike Kustomize, we do cache them.