Skip to content
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

Dependencies and order between resources and charts #111

Closed
eladb opened this issue Apr 20, 2020 · 0 comments · Fixed by #223
Closed

Dependencies and order between resources and charts #111

eladb opened this issue Apr 20, 2020 · 0 comments · Fixed by #223
Assignees
Labels
effort/large 1+ weeks feature-request New/Enhanced functionality wanted

Comments

@eladb
Copy link
Contributor

eladb commented Apr 20, 2020

It is not uncommon to require that resources will be applied to a k8s cluster in a specific order. For example, if a resource is placed in a namespace, the Namespace resource must be applied before it.

Constructs have a concept of dependencies (Node.of(this).addDependency(that)), and cdk8s should respect dependencies between resources when the chart's manifest is synthesized so that the resources are ordered in the manifest based on their topological order.

Furthermore, if a dependency is added between two charts or resources from two different charts, we need to somehow codify the order between the charts. To do that we can employ a convention in which charts have a numeric ordinal prefix (i.e. 000-chartname.yaml). This seems like a practice used by other projects (example) and offers a simple way for users to apply these charts through a simple kubectl apply -f DIR.

@eladb eladb added the feature-request New/Enhanced functionality wanted label Apr 20, 2020
@eladb eladb changed the title Dependencies and order between charts Dependencies and order between resources and charts Apr 20, 2020
@eladb eladb modified the milestone: Alpha Launch Apr 27, 2020
@iliapolo iliapolo added the effort/large 1+ weeks label May 26, 2020
@mergify mergify bot closed this as completed in #223 Jun 9, 2020
mergify bot pushed a commit that referenced this issue Jun 9, 2020
`ApiObject` and `Chart` can now declare dependencies between one another. 

BREAKING CHANGE: `cdk8s` discontinues support for the `onPrepare` and `onSynthesis` construct hooks. These methods will eventually be removed from the `constructs` programming model.

Resolves #111

------------------------------------------------------------------------------------
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/large 1+ weeks feature-request New/Enhanced functionality wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants