python
python copied to clipboard
Add ability to use server_side_apply to utils.create_from_yaml
What type of PR is this?
/kind feature
What this PR does / why we need it:
Allows utils.create_from_yaml
functions to optionally use server side apply. This is a feature that has been requested numerous times. It will allow applying a manifest more than once without throwing an error or updating manifests and reapplying (similar to how kubectl apply
works).
Which issue(s) this PR fixes:
Fixes #2251 Addresses #2030 Part of #1737
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Added the ability to use the optional `apply` parameter for functions within the `utils.create_from_yaml` submodule. This allows these functions to optionally use the `DynamicClient.server_side_apply` function to apply yaml manifests.
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
[Usage]: create_from_yaml(kubernetes_client, manifest, apply=True)