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

feat(cli): environment promotion #3325

Merged
merged 4 commits into from Jun 20, 2022
Merged

Conversation

squakez
Copy link
Contributor

@squakez squakez commented Jun 1, 2022

With this PR the user can run:

kamel promote sample -n development --to production

in order to copy the Integration spec and the related container image from one environment (namespace) to another. In order to work the Operators have to share the same Image registry.

Features:

  • Check compatibility version between source and dest operators
  • Verify namespaced resources (ie, mount traits) are present in dest namespace
  • Verify the operators registries are the same
  • Verify Kamelets are available in dest namespace
  • Copy the Integration spec from namespace source to ns dest
  • Set container.image trait on destination to reuse image (tested) from the source Integration

Release Note

feat(cli): environment promotion

@tadayosi
Copy link
Member

tadayosi commented Jun 2, 2022

Looks great! Here is my early feedback on the feature:

  • What if the dev namespace uses a local operator but the production depends on a cluster operator (or vice versa)? Is such promotion not allowed?
  • Do we need to check user's privileges for the target namespace? Or is it ok to let it fail if they are not permitted?
  • Users might want to transform some labels (or annotations) depending on the types of envs (namespaces). Should we provide such feature as well?

@squakez
Copy link
Contributor Author

squakez commented Jun 2, 2022

Thanks for the feedback, much appreciated!!

* What if the dev namespace uses a local operator but the production depends on a cluster operator (or vice versa)?  Is such promotion not allowed?

I think it still can be done. The idea is that we copy the Integration spec plus the container which was tested and validated in a previous stage. I think the destination operator should be still able to cope with that.

* Do we need to check user's privileges for the target namespace?  Or is it ok to let it fail if they are not permitted?

We may understand which is the best ux there. If I am not wrong, the client we use to interact with the cluster is inheriting privileges from the user who has performed the login. I guess in a very first iteration we can let it fail, and add a check for valid permission in a later stage if we want.

* Users might want to transform some labels (or annotations) depending on the types of envs (namespaces). Should we provide such feature as well?

Yeah, that is something we should analyze better. I've already thought we should check for various resources in the destination namespace. We should include also some parameter in order to transform the "typical" resources bound to an environment (annotations, envs, affininity/tolerations, etc...).

* Check compatibility version between source and dest operators
* Copy the Integration spec from namespace source to ns dest
* Set container.image trait on destination to reuse image from the source Integration
@squakez squakez changed the title feat(cli): environment promotion PoC feat(cli): environment promotion Jun 16, 2022
@squakez squakez marked this pull request as ready for review June 16, 2022 15:27
@squakez squakez merged commit 030f958 into apache:main Jun 20, 2022
@squakez squakez deleted the feat/kamel_promote branch June 20, 2022 07:13
@tadayosi tadayosi added this to the 1.10.0 milestone Aug 18, 2022
@tadayosi tadayosi added the kind/feature New feature or request label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants