Just want to update image of deployment simple as kubectl set image
Try patch_deployment but it seems that it has a few issues, And just can not get it work well.
Is there a simple api like kubectl set image or will there be more docs of how to format the
body of patch_deployment to satisfy the server ?
Update:
After some test, this format works for me to update a image of an existing container:
from kubernetes import client, config
from kubernetes.client.rest import ApiException
from pprint import pprint
config.load_kube_config()
client.configuration.debug = True
api_instance = client.AppsV1beta1Api()
body = {"spec":{"template":{"spec":{"containers":[{"name":"image","image":"gcr.io/xxx/image:tag"}]}}}}
api_response = api_instance.patch_namespaced_deployment('deploy_name', 'default', body,pretty=True)
pprint.pprint(api_response)
Would be nice if you can add that as an example (you just need to clean it up a little and make it similar to other examples).
Make a PR https://github.com/kubernetes-incubator/client-python/pull/352, please review it.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen.
Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Most helpful comment
Update:
After some test, this format works for me to update a image of an existing container: