<p>Some of our services in our K8s (EKS) envirnment use config files to drive functionality so we don't have to redeploy the whole image each time.  Using <code>kubectl cp</code> command allows us to copy new config files to the pod.  So the command <code>kubectl cp settings.json myapi-76dc75f47c-lkvdm:/app/settings.json</code> copies the new <code>settings.json</code> file to the pod.</p>
<p>For fun I deleted the pod and k8s recreated it successfully with the old <code>settings.json</code> file.  Anyone know a way of keeping the new <code>settings.json</code> file if the pod gets destroyed?  Is there a way to update the deployment without redeploying the image?</p>
<p>Thanks, Tim</p>

Timothy Shenton
<p>Store the config file inside a ConfigMap and mount the ConfigMap to Deployment's pod template. When the file needs updating, either:</p>
<ol>
<li>Re-create the ConfigMap (kubectl delete then kubectl create --from-file)</li>
<li>Or use the &quot;dry-run kubectl create piped into kubectl replace&quot; technique from <a href="https://stackoverflow.com/a/38216458/34586">https://stackoverflow.com/a/38216458/34586</a></li>
</ol>
