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

Finalize Delivery-related template interface #289

Closed
sclevine opened this issue Nov 2, 2021 · 6 comments
Closed

Finalize Delivery-related template interface #289

sclevine opened this issue Nov 2, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@sclevine
Copy link
Contributor

sclevine commented Nov 2, 2021

In RFC0013, two templates were proposed for deploying services and validated them post-deployment:

  • ClusterDeployTemplates are cluster-scoped resources that enable application operators to specify resource templates that deploy environments.
    ClusterDeployTemplates take a single source artifact and return a single deployment artifact.

    source -> deployment

  • ClusterDeliveryTemplates are cluster-scoped resources that enable application operators to specify resource templates that perform validations on a particular deployed environment.
    ClusterDeliveryTemplates take a deployment artifact and any number of additional source artifacts. They return a single deployment artifact.

    deployment, source[] -> deployment

Based on feedback from the community, I want to suggest that we simplify this interface by making these templates identical in inputs/outputs, by moving the source->deployment "cast" to the input of ClusterDeployTemplate. This also gives us the ability to inject additional K8s config (e.g., values.yaml files for Kapp, out-of-band resources) into ClusterDeployTemplate. Additionally, I also want to suggest that we rename these resources for clarity. The new descriptions would look like:

  • ClusterDeploymentTemplates are cluster-scoped resources that enable application operators to specify resource templates that deploy environments.
    ClusterDeliveryTemplates take a deployment artifact and any number of additional source artifacts. They return a single deployment artifact.

    deployment, source[] -> deployment

  • ClusterDeploymentValidationTemplates are cluster-scoped resources that enable application operators to specify resource templates that perform validations on a particular deployed environment.
    ClusterDeliveryTemplates take a deployment artifact and any number of additional source artifacts. They return a single deployment artifact.

    deployment, source[] -> deployment

An interesting outcome of this approach would be that it becomes possible to feed the output of a deployment into another deployment. This may or may not be useful. One use case might be deploying several environments that should remain synchronized.

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

Hello @sclevine! Welcome to the Cartographer community and thank you for opening your first issue, we appreciate your contributions

@squeedee
Copy link
Member

squeedee commented Nov 2, 2021

@sclevine I like this on principle, but I'm a little worried that "(Cluster)Deployment(Template)" receives a "deployment" ?

I know it can happen with source into source, config into config etc, but typically that doesn't happen.

@jwntrs
Copy link
Contributor

jwntrs commented Nov 4, 2021

source into source is actually fairly common. At unit-test step is one example.

I also think that there is a separate distinction for deployment into deployment. It's actually a source into deployment where the source gets cast into a deployment (which gives nice symmetry when its later downcast back to a source).

@squeedee
Copy link
Member

squeedee commented Nov 8, 2021

RFC 13 should be updated to match this spec if we accept this issue

@DanieldeR DanieldeR added this to the 1.0 milestone Nov 8, 2021
waciumawanjohi added a commit that referenced this issue Nov 9, 2021
As per conversation in issue #289 #289
@waciumawanjohi
Copy link
Contributor

An interesting outcome of this approach would be that it becomes possible to feed the output of a deployment into another deployment. This may or may not be useful. One use case might be deploying several environments that should remain synchronized.

  1. I see usefulness in ClusterDeploymentTemplate consuming deployments from other ClusterDeploymentTemplates. Namely, consider a Delivery author who does not have access to create ClusterDeploymentTemplates. There exist two templates that alter a cluster in a manner necessary for their tests of the app to be deployed. The Delivery author can simply call the first deployment template and then call the second deployment template.
  2. I do not think that ClusterDeploymentTemplate consuming deployments from other ClusterDeploymentTemplates gives us enough primitives to keep two environments synchronized. This is because ClusterDeploymentTemplate only takes a single deployment. While that deployment would be locked, every other value (e.g. the sources) would not be locked. So synchronization cannot be assured.
    • Possible solution, the sources taken by a deployment are also locked and also passed along. This is not very satisfying because there is no distinction between sources and deployments. Better to allow ClusterDeploymentTemplate to take (and pass on) multiple deployments. Even this is a bit messy, as we would then have to dissambiguate between the different deployments that were being referenced within the template field of the ClusterDeploymentTemplate or ClusterDeploymentValidationTemplates .

waciumawanjohi added a commit that referenced this issue Nov 11, 2021
As per conversation in issue #289 #289
@waciumawanjohi
Copy link
Contributor

Closed by #322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants