Closed
Description
What is the feature and why do you need it:
There is already a util to create kubernetes API objects from yaml and it's very useful.
However, when I create an object from a yaml file, I sometimes want to delete the object created using that file, but there is no util for that.
I think it would be useful to have a util for delete that is paired with create_from_yaml.py, in other words, something like kubectl delete -f
.
Describe the solution you'd like to see:
from kubernetes import utils, client
yaml_path = "path/to/yaml"
k8s_client = client.ApiClient()
utils.create_from_yaml(k8s_client, yaml_path)
utils.delete_with_yaml(k8s_client, yaml_path)