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

configuration param not declared #11

Closed DanPhonovation closed 3 years ago

DanPhonovation commented 3 years ago

In using the helm chart available as of today...

I'm getting the following error during container create:

Loading configuration overwrites from:
- /n8n-config/config.json
- /n8n-secret/secret.json

Error: configuration param 'database.mariadb.host' not declared in the
schema
configuration param 'database.mariadb.user' not declared in the schema
configuration param 'database.mariadb.password' not declared in the schema

My values is:

# Default helm values for n8n.
# Default values within the n8n application can be found under https://github.com/n8n-io/n8n/blob/master/packages/cli/config/index.ts
n8n:
  encryption_key: *******
defaults: 

config: # Dict with all n8n json config options
  database:
    mariadb:
      host: mariadb-galera-k8wide.mariadb-k8wide.svc.kubespray.local
      user: n8n
    type: mariadb

secret: # Dict with all n8n json config options, unlike config the values here will end up in a secret.
  database:
    mariadb:
      password: *******
      user: n8n

# Typical Example of a config in combination with a secret.
# config:
#    database:
#      type: postgresdb
#      postgresdb:
#        host: 192.168.0.52
# secret:
#    database:
#      postgresdb:
#        password: 'big secret'
## ALL possible n8n Values
#
#database:
#  type:             # Type of database to use - Other possible types ['sqlite', 'mariadb', 'mongodb', 'mysqldb', 'postgresdb'] - default: sqlite
#  tablePrefix:      # Prefix for table names - default: ''
#  mongodb:
#    connectionUrl:  # MongoDB Connection URL - default: mongodb://user:password@localhost:27017/database
#  postgresdb:
#    database:       # PostgresDB Database - default: n8n
#    host:           # PostgresDB Host - default: localhost
#    password:        # PostgresDB Password - default: ''
#    port:            # PostgresDB Port - default: 5432
#    user:            # PostgresDB User - default: root
#    schema:            # PostgresDB Schema - default: public
#    ssl:
#      ca:            # SSL certificate authority - default: ''
#      cert:            # SSL certificate - default: ''
#      key:            # SSL key - default: ''
#      rejectUnauthorized:    # If unauthorized SSL connections should be rejected - default: true
#  mysqldb:
#    database:        # MySQL Database - default: n8n
#    host:            # MySQL Host - default: localhost
#    password:        # MySQL Password - default: ''
#    port:            # MySQL Port - default: 3306
#    user:            # MySQL User - default: root
#credentials:
#  overwrite:
#    data:        # Overwrites for credentials - default: "{}"
#    endpoint:    # Fetch credentials from API - default: ''
#
#executions:
#  process:                # In what process workflows should be executed - possible values [main, own] - default: own
#  timeout:                # Max run time (seconds) before stopping the workflow execution - default: -1
#  maxTimeout:            # Max execution time (seconds) that can be set for a workflow individually - default: 3600
#  saveDataOnError:        # What workflow execution data to save on error - possible values [all , none] - default: all
#  saveDataOnSuccess:    # What workflow execution data to save on success - possible values [all , none] - default: all
#  saveDataManualExecutions:    # Save data of executions when started manually via editor - default: false
#  pruneData:            # Delete data of past executions on a rolling basis - default: false
#  pruneDataMaxAge:        # How old (hours) the execution data has to be to get deleted - default: 336
#  pruneDataTimeout:        # Timeout (seconds) after execution data has been pruned - default: 3600
#generic:
#  timezone:     # The timezone to use - default: America/New_York
#path:         # Path n8n is deployed to - default: "/"
#host:         # Host name n8n can be reached - default: localhost
#port:         # HTTP port n8n can be reached - default: 5678
#listen_address: # IP address n8n should listen on - default: 0.0.0.0
#protocol:       # HTTP Protocol via which n8n can be reached - possible values [http , https] - default: http
#ssl_key:        # SSL Key for HTTPS Protocol - default: ''
#ssl_cert:       # SSL Cert for HTTPS Protocol - default: ''
#security:
#  excludeEndpoints: # Additional endpoints to exclude auth checks. Multiple endpoints can be separated by colon - default: ''
#  basicAuth:
#    active:     # If basic auth should be activated for editor and REST-API - default: false
#    user:       # The name of the basic auth user - default: ''
#    password:   # The password of the basic auth user - default: ''
#    hash:       # If password for basic auth is hashed - default: false
#  jwtAuth:
#    active:               # If JWT auth should be activated for editor and REST-API - default: false
#    jwtHeader:            # The request header containing a signed JWT - default: ''
#    jwtHeaderValuePrefix: # The request header value prefix to strip (optional) default: ''
#    jwksUri:              # The URI to fetch JWK Set for JWT authentication - default: ''
#    jwtIssuer:            # JWT issuer to expect (optional) - default: ''
#    jwtNamespace:         # JWT namespace to expect (optional) -  default: ''
#    jwtAllowedTenantKey:  # JWT tenant key name to inspect within JWT namespace (optional) - default: ''
#    jwtAllowedTenant:     # JWT tenant to allow (optional) - default: ''
#endpoints:
#  rest:       # Path for rest endpoint  default: rest
#  webhook:    # Path for webhook endpoint  default: webhook
#  webhookTest: # Path for test-webhook endpoint  default: webhook-test
#externalHookFiles: # Files containing external hooks. Multiple files can be separated by colon - default: ''
#nodes:
#  exclude: # Nodes not to load - default: "[]"
#  errorTriggerType: # Node Type to use as Error Trigger - default: n8n-nodes-base.errorTrigger
# Set additional environment variables on the Deployment
extraEnv: {}
# Set this if running behind a reverse proxy and the external port is different from the port n8n runs on
#   WEBHOOK_TUNNEL_URL: "https://n8n.myhost.com/
##
##
##
##
## Common Kubernetes Config Settings
persistence:
  ## If true, use a Persistent Volume Claim, If false, use emptyDir
  ##
  enabled: true
  type: dynamic
  ## Persistent Volume Access Mode
  ##
  accessModes:
    - ReadWriteOnce
  ## Persistent Volume size
  ##
  size: 10Gi
  ## Use an existing PVC
  ##
  # existingClaim:

replicaCount: 2

image:
  repository: n8nio/n8n
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
#   drop:
#   - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
  type: ClusterIP
  port: 80

ingress:
  enabled: true
  annotations: {}
  # kubernetes.io/ingress.class: nginx
  # kubernetes.io/tls-acme: "true"
  hosts:
    - host: n8n.mydomain.com
      paths: [ / ]
  tls: [ { hosts: [ n8n.mydomain.com ] } ]
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
#   cpu: 100m
#   memory: 128Mi
# requests:
#   cpu: 100m
#   memory: 128Mi
autoscaling:
  enabled: true
  minReplicas: 1
  maxReplicas: 5
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}
database:
  mariadb:
    database: n8n
    host: mariadb-galera-k8wide.mariadb-k8wide.svc.kubespray.local
    password: ****
    port: 3306
    user: n8n
  type: mariadb

ConfigMap's config.json looks like:

{
  "database": {
    "mariadb": {
      "host": "mariadb-galera-k8wide.mariadb-k8wide.svc.kubespray.local",
      "user": "n8n"
    },
    "type": "mariadb"
  }
}

So I don't understand why its complaining it can't find an entrypoint for mariadb.host or mariadb.user

DanPhonovation commented 3 years ago

nevermind. Per https://docs.n8n.io/reference/data/database.html#mysql-mariadb

mysqldb and mariadb are interchangeable, so I changed everything to mysqldb and container green lit.

Vad1mo commented 3 years ago

Happy to hear you figured it out yourself. If you stick to the structure in https://github.com/n8n-io/n8n/blob/master/packages/cli/config/index.ts, you will be fine. The structure is translated 1:1 from values.yaml into that.