amazon-archives / aws-service-operator

AWS Service Operator allows you to create AWS resources using kubectl.
Apache License 2.0
732 stars 103 forks source link

Delete AdditionalResources when Deleting a Resource #41

Open christopherhein opened 6 years ago

christopherhein commented 6 years ago

This should remove any services or comfigmaps when you clean up the cluster resources for example when you make an s3 bucket and it creates a configmap and service those should be cleaned up after the fact.

christopherhein commented 6 years ago

I would love feedback on this before it's implemented. Does it make sense to delete resources from other parts if you delete the core resource?

christopherhein commented 5 years ago

also adding in the additional reference to #84 which could help to remove this.

prashantchitta commented 5 years ago

Anything created with s3 should be deleted along with s3 deletion. So the configmaps and services should be deleted as well. This is how K8 design is. In k8 you can delete configmap even if its mounted to another pod. The pod will continue to work since the configmap is mounted. If the pod dies and tries to come back up, it will fail. So here the design should be similar and in-line to K8's implementation.

If we dont remove there may be bad consequences. Say a user created a bucket called test-bucket. Later he deletes the test-bucket. So s3 bucket is cleanedup. Now if another user comes and creates test-bucket eventhough the bucket does not exist in s3, the creation will fail because the configmaps and services are existing from previous deletion.

christopherhein commented 5 years ago

I definitely agree, I'm glad to hear this isn't only my opinion. I'll add this to the backlog.

mattparkes commented 5 years ago

Definitely agree that those things should be deleted -- it's currently quite counter-intuitive and a bit of a show stopper.

I just made an S3 bucket and was surprised that when I did kubectl delete -f s3bucket.yaml that the Service and ConfigMap were left orphaned.