<p>I have a Scala App running on a Service, using a PostgreSql Service,
Tables are being created by the database management plugin (Slick)</p>

<p>however, need to edit a particular table and I cant find it!</p>

<p>postgres service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: core-db
spec:
  ports:
    - port: 5432
  selector:
    app: core-db
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: core-db
spec:
  template:
    metadata:
      labels:
        app: core-db
    spec:
      containers:
        - image: "image"
          name: core-db
          imagePullPolicy: IfNotPresent
          env:
            - name: POSTGRES_USER
              value: postgres
            - name: POSTGRES_PASSWORD
              value: postgres
          ports:
            - containerPort: 5432
              name: core-db
          volumeMounts:
            - name: core-storage
              mountPath: /var/lib/postgresql/db-data
      volumes:
          - name: core-storage
            persistentVolumeClaim:
                claimName: core-pv-claim
      imagePullSecrets:
        - name: regcred
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: core-pv-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
</code></pre>

<p>I get in the pod:</p>

<pre><code>kubectl exec POD -it -- psql -U postgres
</code></pre>

<p>but \d shows no relations</p>

<p>What I am doing wrong, where is my data after all ? </p>

<p><strong>EDIT</strong></p>

<pre><code>\l
postgres  
app   
template0 
template1 

\c postgres
\dt
No relations found.

\c app
\dt
No relations found.
</code></pre>

<p>Steps I would do to check where the problem are:</p>

<ol>
<li><p>the app is working so, if it's persisting data, these data should be somewhere. 
Try to <code>kubectl delete deploy core-db</code>. Is the app still working and
saving data? </p>

<p>I expected <code>no</code> as answer, and so we can go to the following points.</p>

<p>If the answer is <code>yes</code>, so the problem may be to: </p>

<ul>
<li><p>db connection string inside the app</p></li>
<li><p>the service, how many EndPoints do you have? <code>kubectl get ep core-db</code></p></li>
</ul></li>
<li><p>exec psql pod and connect to postgres db <code>\c postgres</code> and then <code>\dt</code>. Are tables here?</p></li>
<li><p>exec psql pod and connect to app db <code>\c app</code> and then <code>\dt</code>. Are tables here?</p></li>
<li><p>exec psql pod and connect to postgres and then <code>SELECT * FROM pg_stat_activity WHERE datname = 'app';</code></p></li>
</ol>
