<p>I'm just seeing if there is one command to restore a local backup to a pod running <code>postgres</code>. I've been unable to get it working with:</p>

<p><code>kubectl exec -it &lt;pod&gt; -- &lt;various commands&gt;</code></p>

<p>So I've just resorted to:</p>

<p><code>kubectl cp &lt;my-file&gt; &lt;my-pod&gt;:&lt;my-file&gt;</code></p>

<p>Then restoring it.</p>

<p>Thinking there is likely a better way, so thought I'd ask.</p>

cjones
<p>You can call <code>pg_restore</code> command directly in the pod specifying path to your local file as a dump source (connection options may vary depending on image you're using), e.g:</p>

<pre><code>kubectl exec -i POD_NAME -- pg_restore -U USERNAME -C -d DATABASE &lt; dump.sql
</code></pre>
