Flux: Failed to update manifest automatically without namespace: manifest not found

Created on 9 Mar 2020  路  1Comment  路  Source: fluxcd/flux

Describe the bug

I deployed a helm release without specifying the namespace, so that it will be deployed on the flux default namespace by default. Its deployment was OK, but the auto-update was not.

To Reproduce

Steps to reproduce the behaviour:

  1. Provide Flux install instructions
    I set up multi-tenant gitops:
  2. flux-system namespace with flux and helm-operator (helm v3) installed
  3. teracy namespace with flux installed
  4. Provide a GitHub repository with Kubernetes manifests
    https://github.com/hoatle/teracy-flux-dev/blob/bugs/auto-update/default/hr-teracy-dev-docs-develop.yaml

Expected behavior

  • With namespace specified on the manifest: auto-update works.
  • Without namespace specified on the manifest: auto-update did not work.

It's expected that without specified namespace, auto-update should just work.

Logs

ts=2020-03-09T17:51:30.284326883Z caller=images.go:17 component=sync-loop msg="polling for new images for automated workloads"
ts=2020-03-09T17:51:30.352851155Z caller=images.go:111 component=sync-loop workload=teracy:helmrelease/teracy-dev-docs-develop container=chart-image repo=hoatle/teracy-dev-docs pattern=glob:develop-* current=hoatle/teracy-dev-docs:develop-8656ff5 info="added update to automation run" new=hoatle/teracy-dev-docs:develop-5f6aabb reason="latest develop-5f6aabb (2020-03-09 16:25:37.982104078 +0000 UTC) > current develop-8656ff5 (2020-03-09 16:07:22.758323065 +0000 UTC)"
ts=2020-03-09T17:51:30.352939997Z caller=loop.go:141 component=sync-loop jobID=3e6df7d3-e585-c8d3-b619-23b2593f83cf state=in-progress
ts=2020-03-09T17:51:30.460550812Z caller=releaser.go:59 component=sync-loop jobID=3e6df7d3-e585-c8d3-b619-23b2593f83cf type=release updates=1
ts=2020-03-09T17:51:30.643203275Z caller=loop.go:151 component=sync-loop jobID=3e6df7d3-e585-c8d3-b619-23b2593f83cf state=done success=false err="applying changes: updating resource teracy:helmrelease/teracy-dev-docs-develop in default/hr-teracy-dev-docs-develop.yaml: manifest not found"

Additional context

  • Flux version: flux-1.2.0
  • Kubernetes version: v1.16.7
  • Git provider: github
  • Container registry provider: docker hub
blocked-needs-validation bug

Most helpful comment

Hitting this as well and it seems having to specify a namespace in the manifest makes branch based deployment in a multi-tenant cluster much more difficult (ie. single helmrelease being deployed into their own namespace, via their own flux deployments with include-image filter). Would require modifying/creating new helmrelease. Sub-optimal work-around if using manifest generation & helmrelease: you can set the namespace as default, set an extraEnv (something like targetnamespace) on the flux deployment, and piping the output of your manifest generation to a sed for the value of targetNamespace

>All comments

Hitting this as well and it seems having to specify a namespace in the manifest makes branch based deployment in a multi-tenant cluster much more difficult (ie. single helmrelease being deployed into their own namespace, via their own flux deployments with include-image filter). Would require modifying/creating new helmrelease. Sub-optimal work-around if using manifest generation & helmrelease: you can set the namespace as default, set an extraEnv (something like targetnamespace) on the flux deployment, and piping the output of your manifest generation to a sed for the value of targetNamespace

Was this page helpful?
0 / 5 - 0 ratings