Flux: Kustomize issue - component=sync-loop err="loading resources from repo: duplicate definition

Created on 29 Jun 2020  路  2Comments  路  Source: fluxcd/flux

Describe the bug

Tried to implement kustomize from https://github.com/fluxcd/flux-kustomize-example.

Forked the repo to my github account.

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behaviour:

  1. Provide Flux install instructions
    helm upgrade -i flux fluxcd/flux --set git.[email protected]:nikhilbalekundargi/flux-kustomize-example.git --set manifest-generation=true --set git-path=staging --set syncGarbageCollection.enabled=true --namespace flux --set helm.versions=v3 --wait

  2. Provide a GitHub repository with Kubernetes manifests
    https://github.com/nikhilbalekundargi/flux-kustomize-example

forked from https://github.com/fluxcd/flux-kustomize-example.

Expected behavior
pod info should be deployed

A clear and concise description of what you expected to happen.

Logs

ts=2020-06-29T11:39:09.815173017Z caller=images.go:27 component=sync-loop msg="no automated workloads"
ts=2020-06-29T11:39:45.025457267Z caller=loop.go:133 component=sync-loop event=refreshed url=ssh://[email protected]/nikhilbalekundargi/flux-kustomize-example.git branch=master HEAD=6afd0470c3e3638e6be049e4cc092f5181cd4f40
ts=2020-06-29T11:39:45.078872121Z caller=sync.go:73 component=daemon info="trying to sync git changes to the cluster" old= new=6afd0470c3e3638e6be049e4cc092f5181cd4f40
ts=2020-06-29T11:39:45.085088452Z caller=loop.go:107 component=sync-loop err="loading resources from repo: duplicate definition of 'demo:deployment/podinfo' (in base/podinfo-dep.yaml and production/flux-patch.yaml)"
ts=2020-06-29T11:44:09.815463121Z caller=images.go:17 component=sync-loop msg="polling for new images for automated workloads"
ts=2020-06-29T11:44:09.835403727Z caller=images.go:23 component=sync-loop error="getting unlocked automated resources: duplicate definition of 'demo:deployment/podinfo' (in base/podinfo-dep.yaml and production/flux-patch.yaml)"
ts=2020-06-29T11:44:45.615135015Z caller=sync.go:73 component=daemon info="trying to sync git changes to the cluster" old= new=6afd0470c3e3638e6be049e4cc092f5181cd4f40
ts=2020-06-29T11:44:45.621421577Z caller=loop.go:107 component=sync-loop err="loading resources from repo: duplicate definition of 'demo:deployment/podinfo' (in base/podinfo-dep.yaml and production/flux-patch.yaml)"
ts=2020-06-29T11:44:45.623190679Z caller=loop.go:133 component=sync-loop event=refreshed url=ssh://[email protected]/nikhilbalekundargi/flux-kustomize-example.git branch=master HEAD=6afd0470c3e3638e6be049e4cc092f5181cd4f40

Additional context

  • Flux version: 1.19.0
  • Kubernetes version:
    Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.10-gke.36", GitCommit:"34a615f32e9a0c9e97cdb9f749adb392758349a6", GitTreeState:"clean", BuildDate:"2020-04-06T16:33:17Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}

  • Git provider: Github

blocked-needs-validation bug

All 2 comments

We just ran into this ourselves and found that it was a combination of two things...

  1. Make sure you have the manifest generation enabled (manifestGeneration: true if using the helm chart)
  2. Make sure the .flux.yaml file exists and has the right file extension. It doesn't pick up .flux.yml 馃槃
  1. manifestGeneration

Great catch @mikesir87, didn't realize and worked like a charm!
Just weird bacuase the .flux.yaml is already including the command updated using kustomize before kubectl apply.
I don't get the relation to this setting which clearly is part of the deployment procedure, where I thought it was only using the command updated output alone.

Thanks in advance for any clarification on that.
Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mar1n3r0 picture mar1n3r0  路  4Comments

audrey-brightloom picture audrey-brightloom  路  3Comments

phoppe93 picture phoppe93  路  4Comments

kuburoman picture kuburoman  路  3Comments

anwarchk picture anwarchk  路  4Comments