How n8n-io/n8n-kubernetes-hosting works
Main Components
• n8n Application Components:
• n8n Deployment: Represents the pod(s) running the n8n container.
• n8n Service: Exposes the n8n deployment (likely for internal or external access).
• n8n Persistent Volume Claim: Represents the persistent storage for n8n, ensuring that any state or configuration data is retained.
• PostgreSQL Database Components:
• PostgreSQL Deployment: Represents the pod(s) running the PostgreSQL container.
• PostgreSQL Service: Exposes the Postgres pod for internal communication from n8n (and possibly external access, if needed).
• PostgreSQL Persistent Volume Claim: Ensures data persistence for the database.
• PostgreSQL ConfigMap and Secret: Represent configuration settings and sensitive data (like passwords) required to properly configure and secure the PostgreSQL instance.
• Namespace:
• A dedicated namespace in Kubernetes as defined by the namespace.yaml, which logically groups the n8n and PostgreSQL resources.
Relationships and Interactions
• Illustrating how the persistent volume claims attach to their respective deployments, showing the persistence layer for both the n8n application and the database.
• The ConfigMap and Secret for PostgreSQL should be shown as configuration dependencies for the PostgreSQL deployment.
• Optionally, include an outline of how these components fit within a Kubernetes namespace which encapsulates the resource management boundary.
Architectural Patterns and Design Principles
• Containerization: Both n8n and PostgreSQL are deployed as containers managed by Kubernetes.
• Separation of Concerns: There is a clear separation between the application layer (n8n) and the data layer (PostgreSQL), with each component having dedicated resources and configuration files.
• Declarative Infrastructure: The entire architecture is described through Kubernetes YAML files, reflecting a declarative approach to infrastructure management.
Incorporate Relevant Technologies
• Kubernetes: The primary platform used for deployment; the YAML files define deployments, services, persistent volume claims, etc.
• n8n: The application or automation tool being deployed.
• PostgreSQL: The relational database system serving as the backend.
• Configuration Management: Use of ConfigMaps and Secrets is critical for managing environment-specific settings and secure configuration data.