Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot create 'consumers' entities when not using a database #1207

Open
Mattie112 opened this issue Jan 2, 2025 · 0 comments
Open

cannot create 'consumers' entities when not using a database #1207

Mattie112 opened this issue Jan 2, 2025 · 0 comments

Comments

@Mattie112
Copy link

I would like to run kong in hybrid mode. It needs to access both kubernetes resources (and that works) but also I need to provision dynamically consumers / routes. I would like to have the "bare minimum" nicely in my devops but for applications, well just add them to the database.

I am using terraform:

resource "helm_release" "kong" {
  chart = "kong/kong"
  name  = "kong"
  namespace = kubernetes_namespace.kong_namespace.metadata[0].name
  values = [file("${path.module}/templates/kong-kong.yaml")]
}

Here is my kong-kong yaml file:

proxy:
  enabled: true
  type: LoadBalancer
  LoadBalancerClass: "alb"
  tls:
    enabled: true
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
    service.beta.kubernetes.io/aws-load-balancer-type: "alb"
    service.beta.kubernetes.io/aws-load-balancer-internal: "false"
    service.beta.kubernetes.io/aws-load-balancer-ssl-negotiation-policy: "ELBSecurityPolicy-FS-1-2-Res-2020-10"
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "xx"
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "ssl"
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
    service.beta.kubernetes.io/aws-load-balancer-ip-address-type: "dualstack"
    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
    konghq.com/proxy-trusted-ips: "10.0.0.0/8"
  ingress:
    enabled: true
    hostname: "xx
    annotations:
      kubernetes.io/ingress.class: kong  # Ensure it uses Kong's ingress
      alb.ingress.kubernetes.io/ip-address-type: dualstack

env:
  proxy_listen: "0.0.0.0:8000 proxy_protocol, 0.0.0.0:8443 ssl proxy_protocol"
  admin_listen: "0.0.0.0:8001, 0.0.0.0:8444 ssl" # = API
  admin_gui_api_url: "https://xx"
  admin_gui_listen: "0.0.0.0:8002, 0.0.0.0:8445 ssl" # = webui
  admin_gui_url: "https://xx"
  kong_trusted_ips: "10.0.0.0/8"
  kong_real_ip_header: "x-forwarded-for"

resources:
  limits:
    memory: "512Mi"
    cpu: "2000m"
  requests:
    memory: "256Mi"
    cpu: "250m"

logLevel: "warn"

manager: # (webui)
  enabled: true
  type: ClusterIP
  ingress:
    enabled: true
    hostname: "xx"
    annotations:
      kubernetes.io/ingress.class: kong  # Ensure it uses Kong's ingress
      konghq.com/protocols: 'https' # Only listen on HTTPS
      konghq.com/https-redirect-status-code: "301" # Auto redirect to HTTPS
  tls:
    enabled: true
  http:
    enabled: true

admin: # (api)
  enabled: true
  type: ClusterIP
  ingress:
    enabled: true
    hostname: "xxet"
    annotations:
      kubernetes.io/ingress.class: kong  # Ensure it uses Kong's ingress
      konghq.com/protocols: 'https' # Only listen on HTTPS
      konghq.com/https-redirect-status-code: "301" # Auto redirect to HTTPS
  tls:
    enabled: true
  http:
    enabled: true

postgresql:
  enabled: true

(note: not sure if the proxy protocol part is correct, need to test/verify)

When I want to create a consumer via the UI I get the following error:

cannot create 'consumers' entities when not using a database

Is there any other changes I need to make to allow kong to use the database? Postgresql seems to be working fine:

postgresql 15:51:30.06 INFO  ==> ** Starting PostgreSQL **
2025-01-02 15:51:30.105 GMT [1] LOG:  pgaudit extension initialized
2025-01-02 15:51:30.115 GMT [1] LOG:  starting PostgreSQL 13.11 on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2025-01-02 15:51:30.116 GMT [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2025-01-02 15:51:30.116 GMT [1] LOG:  listening on IPv6 address "::", port 5432
2025-01-02 15:51:30.122 GMT [1] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2025-01-02 15:51:30.132 GMT [150] LOG:  database system was shut down at 2025-01-02 15:51:29 GMT
2025-01-02 15:51:30.145 GMT [1] LOG:  database system is ready to accept connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant