-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation unclear: Flux Kustomization patches do not apply over nested kustomizations #1000
Comments
IDEA: Recursive patches for
Could validate it's able to do the recursion on the target resource (if it's supported by the target API) ... Best to my understanding (not much) the native kustomize patches are recursive. |
I really like this idea, I am also trying to do nested patches, here is my example below:
DISCLAIMER, ignore indentation, our company doesn't allow pasting |
I would also really stand to benefit from a recursive patching feature. We have a similar nested kustomization tree:
We're following the multi-tenancy model from https://github.com/fluxcd/flux2-multi-tenancy and https://github.com/controlplaneio-fluxcd/d1-fleet which requires patching
But...this only applies to the first layer/depth down. Any HelmRelease or Kustomization resources the next level down or deeper won't be patched. To get those we have to expand the patch as follows and would have to continue doing so for each layer of depth:
|
We use following kustomizations structure in our projects:
kustomize.config.k8s.io/v1beta1 -> kustomize.toolkit.fluxcd.io/v1 -> kustomize.toolkit.fluxcd.io/v1 -> helmrelease
In my setup I have a patch on all top-level flux kustomizations with a patch for all helm releases - full kustomization file.
The patch is not delivered to the HR. This makes sense as when I do flux trace on that HR, it's only dependend on it's parent kustomization.
Altough documentation mention writing patches at top-level Flux kustomization as a feature used in bulk shard assignment:
Image is a screenshot of the code from the documentation
![image](https://private-user-images.githubusercontent.com/2377891/278046099-0e92c4b3-f394-429f-8950-a8b46c8f3478.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1MDczMzEsIm5iZiI6MTcyNDUwNzAzMSwicGF0aCI6Ii8yMzc3ODkxLzI3ODA0NjA5OS0wZTkyYzRiMy1mMzk0LTQyOWYtODk1MC1hOGI0NmM4ZjM0NzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjRUMTM0MzUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGM4NjhhNDA4Y2YzNTNkNjY4ZDQ1NDgzNWFmNjFhY2ZhZGIxZDAwNzgyYjhmMTRlNDE0NjYwYmRmZWI3YTE0NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.H9KNOujUATECsd3AK5CFaEXZKlOuAy0ggY7ZUnZ8zbc)
I think that the documentation is wrong. I have a very minimal example where it's not working: https://gitlab.com/ondrej.kolin/flux-helmrelease-patch-test
The text was updated successfully, but these errors were encountered: