Odoo 15.0 longpolling behaviour behind GKE Ingress Load balancer

108 views Asked by At

I tried installing Odoo inside GKE, and expose the service via GKE Ingress Load Balancing

I keeps getting 502 from /longpolling/poll after 50s, but when i simulate live chat going in and out, the /longpolling/poll return 200, when no chat coming in/out it returns 502 again

this is my odoo.conf

[options] 
    addons_path = /mnt/extra-addons
    admin_passwd = 
    csv_internal_sep = ,
    data_dir = /var/lib/odoo
    db_host = 172.20.x.x
    db_maxconn = 64
    db_name = odoo
    db_password = odoo
    db_port = 5432
    db_sslmode = prefer
    db_template = template0
    db_user = odoo
    ;dbfilter = 
    demo = {}
    email_from = False
    geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
    http_enable = True
    # http_interface = 127.0.0.1
    http_port = 8069
    import_partial =
    limit_memory_hard = 2684354560
    limit_memory_soft = 2147483648
    limit_request = 8192
    limit_time_cpu = 60
    limit_time_real = 120
    limit_time_real_cron = -1
    list_db = False
    log_db = False
    log_db_level = warning
    log_handler = :INFO
    log_level = debug
    logfile = 
    longpolling_port = 8072
    # xmlrpc_port = 8069
    # xmlrpc_interface = 127.0.0.1
    # netrpc_interface = 127.0.0.1
    max_cron_threads = 2
    osv_memory_age_limit = False
    osv_memory_count_limit = False
    pidfile = None
    proxy_mode = True
    reportgz = False
    screencasts = None
    screenshots = /tmp/odoo_tests
    ;server_wide_modules = openupgrade_framework
    smtp_password = False
    smtp_port = 25
    smtp_server = localhost
    smtp_ssl = False
    smtp_user = False
    ;syslog = False
    test_enable = False
    test_file = False
    test_tags = None
    translate_modules = ['all'] 
    unaccent = False
    ;upgrades_paths = 
    without_demo = True
    workers = 0

my ingress yaml is :

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    ingress.gcp.kubernetes.io/pre-shared-cert: ssl-odoo
    kubernetes.io/ingress.class: gce
    kubernetes.io/ingress.global-static-ip-name: gcp-lb-static-odoo
    
  labels:
    app: odoo-ingress
    app.kubernetes.io/component: odoo-ingress
    app.kubernetes.io/instance: odoo-ingress
  name: odoo-ingress
  namespace: odoo 
spec:
  defaultBackend:
    service:
      name: odoo-cls-service
      port:
        number: 8069
  rules:
  - host: odoo.dummyodoo.com
    http:
      paths:
      - path: /longpolling 
        pathType: Prefix
        backend:
          service:
            name: odoolp-cls-service # tried with dedicated or same as / 
            port:
              number: 8072
      - path: / 
        pathType: Prefix
        backend:
          service:
            name: odoo-cls-service
            port:
              number: 8069

i tried using docker instead of GKE, /longpolling/poll return 200 even when there is no live chat activity

i want to use GKE ingress so that i can integrate with the Google Managed Certificate which afaik not going to work with nginx pod

Anyone have a suggestion please

1

There are 1 answers

0
Erlangga Er On BEST ANSWER

it turns out Odoo /longpolling/poll takes 50s to finally respond, but the default timeout on ingress on GKE is 30s, after changing the timeout on GKE LB ingress to 60s the browser get HTTP 200