<p>I am running Ansible <a href="https://github.com/ansible/awx" rel="nofollow noreferrer">AWX</a> based on Docker compose setup, I need to upgrade the version of AWX which supports only Kubernetes.</p>
<p>I need to export the DB from the docker setup into Kubernetes but I don't know how to import the postgres dump into K8S. Can any one help me out please ?</p>

alvsam
<p>You can call pg_restore command directly in the pod specifying path to your local file as a dump source.</p>
<p>kubectl exec -i POD_NAME -- pg_restore -U USERNAME -C -d DATABASE &lt; dump.sql</p>
<p>(or)</p>
<p>cat database.sql | kubectl exec -i [pod-name] --psql -U [postgres-user] -d [database-name]</p>
