Migration from Docker to K8s

Describe the problem/error/question

Hey everyone, I’ve decided to migrate my container-based n8n setup to a Kubernetes environment. While working on this transition, I encountered some confusion regarding storage components.

In my Docker setup, I used Docker volumes for persistent storage. However, in Kubernetes, we plan to integrate storage with RDS. My question is—do we still need a Persistent Volume (PV) for handling the storage part in this case?

What is the error message (if any)?

NA

Please share your workflow

NA

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

PV is only needed for the encryption key (can also be set in ENV variables)
if using SQLite PV is also needed.
And for installing custom nodes is also on the PV, but with the correct ENV variable missing nodes are automatically installed.

Long answer short, you do not need it if you use the correct ENV variables.
Only if you use external NPM packages in code nodes for example you would need PV to make sure this keeps working.

Thanks for posting.

I have tried this with out pv, its all working but surprisingly as soon as my pod restart the existing credentials are flushing out of the instance.

pls assist on this.

Hi, which pod restarts? N8N? as long as everything points to the postgresql RDS server and the encryption key and other env variables are set, i don’t see how it can loose it’s data.

Reg,
J.

We’ve created the deployment object with 1 replica (1 pod), integrated with Postgres RDS with no PV.

Above pod restarting very oftenly, However its ensuring workflows and User credentials are persistent on every restart.

Required ENV values are already placed as part of deployment manifest. Hence ENV values are intact on any state of the pod

The only weird case we noticed, the configured credentials are flushing out.

Hey could some one assist on this ?

Hi, you need a PV for postgres since it stores all of the data. In addition you need to make sure that you feed in the encryption key via an external env variables since all the credentials are encrypted/decrypted with it.
Reg,
J.

1 Like

Thanks for coming back

Im confused, I’m using AWS RDS and Set the Env Variable too.

Still why would it expect the presence of PV.

Sorry my mistake, I missed the RDS part

So, please detail: flushing out credentials:
They disappear from the UI on the credentials tab?
Are they still in the DB when they disappear?
Can you export through the cli when you are having this issue (encrypted/decrypted)
If you have an encryption key set can you dump it inside to verify it’s actually the right one.

You didn’t actually answer my question of encryption key with “all necessary env variables are set”. As one N8N instance and postgresql server can work without encryption key.

Reg,
J.

Hey

Its working now, Seems it was unhappy with mode of configuring the encryption key.

Now it’s all good.

Thanks for driving this

1 Like

Hi, can you please accept as solution?
thanks
J.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.