8gears / n8n-helm-chart

A Kubernetes Helm chart for n8n a Workflow Automation Tool. Easily automate tasks across different services.
https://artifacthub.io/packages/helm/open-8gears/n8n
Apache License 2.0
187 stars 97 forks source link

Add dedicated Workers and Webhooks Instances #24

Closed swarnat closed 1 year ago

swarnat commented 1 year ago

I currently play a little bit to integrate the scaling options of n8n into this helm chart.

I would be happy about users, who have the chance to test. Because my lack of experience with n8n maybe oversee something. But in my eyes a deployment to k8s don't make sense without decentralized workers/incoming webhooks and a little bit HA options

Other topics of this merge:

ToDo before Merge:

Any Feedback is welcome

Vad1mo commented 1 year ago

Awesome, let me know when you are done, I'll test and merge!

swarnat commented 1 year ago

The latest commit finish my modification to add shared workloads. Last commit was to increase version to 0.196.0. We did some internal testing of this scaling functions and don't get any problems.

An important topic was, that I was not able to upgrade from your helm chart to my one, because of a migration error in n8n itself. But because I started 7 days ago with n8n, I'm not sure, if the reason was my empty database. Maybe you, or somewhere, have a realworld database to check.

About the OCI Charts: I take single steps into the Kubernetes world. 😄 The only thing I'm currently know about OCI Charts is, they are a more general way to provide helm charts. (Maybe next-gen helm charts)

vaelant commented 1 year ago

Tested this before the branch conflicts and it worked flawlessly, thanks for the work. Having a solid kubernetes HA nocode tool will make many people happy.

To save some time, here's a minimum set of values necessary for notes in case users want to test themselves.

Note: You'll need a postgreSQL instance setup ahead of time to connect:

n8n:
  encryption_key: <generate and replace with encryption string>

config:
  database:
    type: postgresdb
    postgresdb:
      database: n8n
      host: <postgresdb url>
      port: 5432
      user: <postgresdb user>

secret:
  database:
    postgresdb:
      password: <postgresdb password>

ingress:
  enabled: true
  hosts:
    - host: your.n8n.hostname
      paths:
       - /
  tls:
    - secretName: n8n-tls
      hosts:
        - your.n8n.hostname

autoscaling:
  enabled: true
  minReplicas: 1
  maxReplicas: 2
  targetCPUUtilizationPercentage: 80

scaling:
  enabled: true

  worker:
    count: 2
    concurrency: 2

  webhook:
    enabled: true
    count: 1

  redis:
    host: <redis host headless>
    password: <redis password>

redis:
  enabled: true
  global:
    redis:
      password: <redis password>
  architecture: standalone

  master:
    persistence:
      enabled: false
      existingClaim: ""
      size: 2Gi  

Thanks for tuning the chart, looking forward to merge.

Vad1mo commented 1 year ago

Happy to hear, @swarnat can you resolve the issues and I'll merge your changes!

swarnat commented 1 year ago

Of course. I will solve it within next day

swarnat commented 1 year ago

Conflict is solved and directly updated to latest version Update is quickly tested in our environment. We are using this "HA" setup since october and do not get any issues.