title: How can I edit a Deployment without modify the file manually?
body: <p>I have defined a Deployment for my app:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: myapp-deployment
  spec:
    replicas: 2
    template:
      metadata:
        labels:
          app: myapp
      spec:
        containers:
        - name: myapp
          image: 172.20.34.206:5000/myapp_img:2.0
          ports:
          - containerPort: 8080
  </code></pre>
  
  <p>Now, if I want update my app's image 2.0 to 3.0, I do this:</p>
  
  <ol>
  <li><code>$ kubectl edit deployment/myapp-deployment</code></li>
  <li><code>vim</code> is open. I change the image version from 2.0 to 3.0 and save.</li>
  </ol>
  
  <p>How can it be automated? Is there a way to do it just running a command? Something like:</p>
  
  <pre><code>$ kubectl edit deployment/myapp-deployment --image=172.20.34.206:5000/myapp:img:3.0
  </code></pre>
  
  <p>I thought using Kubernetes API REST but I don't understand the <a href="https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/docs/api-reference/extensions/v1beta1/operations.html" rel="noreferrer">documentation</a>. </p>