eiffel-community / eiffel-easy2use

A sandbox to be used to try out the Eiffel protocol and related services
Apache License 2.0
10 stars 19 forks source link

Namespace not removed (#25). #82

Closed pef-ericsson closed 1 year ago

pef-ericsson commented 1 year ago

Applicable Issues

Fixes #25

Description of the Change

Namespace is deleted permanently if in the command the flags "package" and "services" are not defined. If they are defined then the namespace is not deleted. For example,

Alternate Designs

N/A

Benefits

The cluster is not getting cluttered by namespaces. Command is more realistic in this case deleting everything.

Possible Drawbacks

Perhaps a developer wouldn't like the namespace to be deleted automatically in order to reuse it again for new deployment. Yet, this one can be fixed via the command ./easy2use start ... which can be modified in order to create the given namespace, if not exist.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

Signed-off-by: Panagiotis Efstratiou panagiotis.efstratiou@ericsson.com

e-backmark-ericsson commented 1 year ago

The command example in the description of this PR doesn't include the 'remove' keyword. Shouldn't it? Furthermore, is there a risk that someone has other services/resources deployed in a namespace, and those services are killed when the namespace is killed? If so, maybe the default should be to not remove the namespace, but instead require an additional flag on the 'remove' command to also remove the namespace?

pef-ericsson commented 1 year ago

The command example in the description of this PR doesn't include the 'remove' keyword. Shouldn't it? Furthermore, is there a risk that someone has other services/resources deployed in a namespace, and those services are killed when the namespace is killed? If so, maybe the default should be to not remove the namespace, but instead require an additional flag on the 'remove' command to also remove the namespace?

  1. I added the missing word "remove".
  2. The idea, on one hand, is that if a user does not specify any package/services then the namespace is deleted permanently because the command remove will delete everything by default and the namespace will be kept on the cluster but empty. On the other hand, if a user specifies a package and/or services the command remove will delete only the desired package/services. So, the namespace will not be deleted which means that there is a chance to be empty.
  3. Given the aforementioned changes, the user knows that the command remove deletes everything without flags including the namespace, otherwise only the desired package/services.
e-backmark-ericsson commented 1 year ago

I was mostly thinking about the possibility that the user had its own created namespace, in which he/she wanted the Eiffel components to be deployed. The user could potentially have other services running there at the same time. If that is the case, will those other services also be killed when the namespace is deleted, or is there an option to only delete the workspace if it is empty?

pef-ericsson commented 1 year ago

I was mostly thinking about the possibility that the user had its own created namespace, in which he/she wanted the Eiffel components to be deployed. The user could potentially have other services running there at the same time. If that is the case, will those other services also be killed when the namespace is deleted, or is there an option to only delete the workspace if it is empty?

The proposed PR will delete the entire namespace, if package/services are not defined. Let's say that "./easy2use remove ..." works like a wrapper of the "kubectl delete ns <_namespace_>" in that case. I believe that the issue is that we need to define what does it mean "empty namespace"? There is no any kubectl command that checks if a namespace is empty. Even the "kubectl get all -n <_namespace_>" does not return all resources.

m-linner-ericsson commented 1 year ago

No, action since issue was rejected