Running with Kubernetes

I’m interested in running n8n using kubernetes for a small internal project. I had noticed in another post on this forum people have done so already. How can this be setup and is there anything already in place to get try to run this with k8?

Sorry, have sadly currently no ready k8s setup. I have also do not have that much experience with k8s. So hope somebody else who is already running n8n on k8s can post something. If not, I will try to create an example “soonish”.

I use n8n on Kubernetes.
You can use n8n by deploying the following manifest.

Access NodePort to use n8n.
Note that in this configuration, data saved with n8n is not persisted.

1 Like

Thank you very much @tar-xzvff and welcome to the community!

1 Like

Thank you!! What are the commands to run this locally?

It should actually not matter if you run it locally or on a server, should always be the default k8s command which is mentioned in the above gist: kubectl apply -f n8n.yml (if you saved the content of the gist as “n8n.yml” and you are executing it in the folder it is saved in).

Also, be aware that it is only for testing. The above file does not persist the data in any way. So the data will be lost if you stop the pod.

Hi @jan ,

at first thanks for this amazing and free alternative for zapier. It helps me save time by sending attachments from my printer to gdrive.

I run my n8n instance in a k8s cluster since today. I’ve saw you have some docker-compose examples in you github repo but nothing for k8s. Are you interested in a pull request with an k8s setup example?

If yes, i could prepare a pull request to give back something to the community.

Regards from Berlin,
Alex

Really great to hear that n8n is helpful for you!

Yes a pull-request with a k8s setup would be great and for sure helpful for many people. Thanks a lot!

Greetings from Mexico but from Wednesday also again back in Berlin.

Nice, any update for it?

Any improvement for persistent data and real clustering?
I really like to know if anyone has any method for setting up n8n in HA mode with a load balancer and persistent data shared between nodes.
Even a clustering mode in Docker is better than nothing.
I created an environment with couple of DBs available (MySQL, Postgres, MSSQL) and using Treafik as proxy with TLS on Docker.
It works very good actually but I like to have the n8n nodes clustered for HA.

Any idea?

1 Like

This is our k8s config with Postgres running as StatefulSet. I hope it might help someone

3 Likes

I was going to post mine, but @bacarini already posted pretty much the same that I have.

I do have a question for @bacarini tho, I see that you have

annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "5678"

Are these used for automatic discovery of prometheus ( GitHub - prometheus-community/helm-charts: Prometheus community Helm charts) ?

Also does anyone have a Grafana dashboard ready for n8n? That would be lovely

Hey @Couto

yes, these annotations are used for automatic discovery but we are not using Helm charts though

as for the dashboard, we are using a Node.js one and custom k8s charts on top of it

1 Like

is it possible that multiple cluster nodes can access same aws rds aurora i guess i will cause error due to replication of cron job between multi[le instances.

three good posts from @andreffs18

3 Likes