kubebuilder: make deploy is broken for kustomize v2.0.0 release
kustomize v2.0.0 requires that all paths other than bases have to terminate in same or subdirectory of the kustomization directory. So kustomize build config/default in make deploy fails because kustomization.yaml contains resource paths like ../rbac/rbac_role.yaml. According to kustomize v2.0.0, rbac and manager folder should be under config/default directory.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 15 (8 by maintainers)
Commits related to this issue
- dashboard-operator: fix for kustomize2 The latest version of kustomize does not allow paths outside of the current directory structure. Replaced these with kustomization.yaml files in each subfolder ... — committed to johnsonj/kubebuilder-declarative-pattern by johnsonj 5 years ago
- dashboard-operator: fix for kustomize2 The latest version of kustomize does not allow paths outside of the current directory structure. Replaced these with kustomization.yaml files in each subfolder ... — committed to johnsonj/kubebuilder-declarative-pattern by johnsonj 5 years ago
- Remove boilerplate RBAC, fix config structure for kustomize 2.0 https://github.com/kubernetes-sigs/kubebuilder/issues/595#issuecomment-468471211 — committed to djwhatle/mig-controller by djwhatle 5 years ago
- Remove boilerplate RBAC, fix config structure for kustomize 2.0 https://github.com/kubernetes-sigs/kubebuilder/issues/595#issuecomment-468471211 — committed to djwhatle/mig-controller by djwhatle 5 years ago
For existing projects, please follow this instruction to migrate the config directory structure to the new structure, which works with kustomize 2.0.0
to
Agree with the change suggested by @figo We can change it to following directory structure
I’ve had a play with config directory structures over the past few days and arrived at the following, feeling like it’s the cleanest I’ve found, keeping all the kustomize builds from
config/default, as from what I seemanagerorrbacmanifests aren’t used outside of this.I believe the reason for the “default” directory is so that a project can maintain multiple different kustomize overlays. “default”, “production”, “debug”, etc. that each allow for customizations based on a different environments while still maintaining the same bases and resources. At least that is how we are using that directory level within our projects. I would like to see that continue to exist moving forward.
at cluster-api, we are using
basesinstead ofresourcesto work with kustomize 2.0, folder structure does not need be changed, but it does need to add a kustomize.yaml in each folder.please refer to https://github.com/kubernetes-sigs/cluster-api/blob/master/config/default/kustomization.yaml
Also seeing this. A quick hack is to bring the
config/defaultmanifests into the top-levelconfig/directory, and updating your Makefiledeploystage to usekustomize build config | kubectl apply -f -.Whether having the kustomize manifests in the top-level
configdirectory is a longterm solution, I’m unsure.