I’m trying to set up n8n on a GKE cluster using its Helm chart. The main issue is that the ingress keeps dropping the session when pointing to the app. It works fine when I access the pod directly, so it seems to be an ingress problem.
I want to add session affinity to the ingress, but I’m not sure how to do this with Terraform. Another option might be using an Nginx ingress, but I’m new to that.
Here’s a simplified version of my Terraform config:
I’ve encountered similar challenges with GKE ingress and n8n deployments. One effective solution is to implement a Network Load Balancer (NLB) instead of the default HTTP(S) Load Balancer. This approach often resolves session persistence issues.
To achieve this, you’ll need to modify your Terraform configuration. Add the following annotation to your kubernetes_ingress resource:
This setup should provide better session handling and improve overall performance. Remember to adjust your firewall rules accordingly to accommodate the NLB.
I’ve dealt with similar ingress issues in GKE, and one approach that worked well for me was switching to the NGINX Ingress Controller. It offers more flexibility and better session management right out of the box.
To implement this, you’ll first need to install the NGINX Ingress Controller in your cluster using Helm. Once installed, update your Terraform configuration to specify the NGINX ingress class and add relevant annotations for session affinity. For example, your ingress resource could include annotations like: