<p>I am using python to interact with Kubernetes. I need to delete an existing pod and recreate it with different name and PVC. From Python API documentation I got to know that  Python provides API create_namespaced_pod which accepts body as argument which is suppose to be Pod  specific data.
But I dont want to construct this Body Parameter  fetching data from old pod and setting again in body.  Is there any other way where in i can read the old pod content, update PVC and pod name and call create_namespaced_pod method to create new pod ?</p>
<p>I tried to pass  content of pod to create_namespaced_pod  method. But it does not give any exception but Pod does not gets created. Below code prints &quot;--  created pod---&quot;</p>
<pre><code>targetPodResult = v1.read_namespaced_pod(podname, obj.metadata.namespace, async_req=True)  
targetPod = targetPodResult.get()
targetPod.metadata.name = targetPod.metadata.name + &quot;_new&quot;
print(targetPod)
v1.create_namespaced_pod('default', targetPod, async_req=True)
print(&quot;--  created pod---&quot;)
</code></pre>

HotDev
<p>i am able to create pod now  using different variant of method with body = targetPod like below. also, i need to set resource_version of old pod to 'None'</p>
<pre><code>v1.create_namespaced_pod(body = targetPod, namespace = 'default')
</code></pre>
