question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kubectl set image ?

See original GitHub issue

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 ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
FingerLiucommented, Sep 26, 2017

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)

0reactions
k8s-ci-robotcommented, Jun 20, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deployments - Kubernetes
Caution: Do not change this label. The pod-template-hash label is added by the Deployment controller to every ReplicaSet that a Deployment creates or...
Read more >
Kubectl Set Image Command - Linux Hint
Kubectl Set Image Command ... The kubectl set command is used to overwrite or set the given cluster. It allows the user to...
Read more >
Using kubectl set to update the container image - O'Reilly
Use the kubectl set command allows us to overwrite the spec.template.spec.containers[].image property that is similar to using the kubectl run command to ...
Read more >
kubectl-set-image command man page - kubernetes-client
kubectl -set-image - Man Page. Update the image of a pod template. Eric Paris Jan 2015. Synopsis. kubectl set image [Options]. Description.
Read more >
Kubernetes how to make Deployment to update image
Every time you change the tag and run kubectl set image command, kubernetes will perform a rolling update. For example, let's say you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found