[GH-ISSUE #91] Kubernetes - bad gateway #51

Closed
opened 2026-02-26 09:35:35 +03:00 by kerem · 2 comments
Owner

Originally created by @metal3d on GitHub (Apr 2, 2018).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/91

Hi,

I'm trying hard to make it working on Kubernetes. I generated objects with Kompose from a modified docker-compose.yml file:

version: '2'
services:
  onlyoffice-documentserver-data:
    image: onlyoffice/documentserver:latest
    environment:
      - ONLYOFFICE_DATA_CONTAINER=true
      - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
      - POSTGRESQL_SERVER_PORT=5432
      - POSTGRESQL_SERVER_DB_NAME=onlyoffice
      - POSTGRESQL_SERVER_USER=onlyoffice
      - RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq
      - REDIS_SERVER_HOST=onlyoffice-redis
      - REDIS_SERVER_PORT=6379
    stdin_open: true
    restart: always
    volumes:
      - data:/var/www/onlyoffice/Data
      - log:/var/log/onlyoffice
      - cache:/var/lib/onlyoffice/documentserver/App_Data/cache/files
      - files:/var/www/onlyoffice/documentserver-example/public/files
      - fonts:/usr/share/fonts
    privileged: true
    ports:
      - '80'
      - '8000'
      - '9001'

  onlyoffice-documentserver:
    image: onlyoffice/documentserver:latest
    depends_on:
      - onlyoffice-documentserver-data
      - onlyoffice-postgresql
      - onlyoffice-redis
      - onlyoffice-rabbitmq
    environment:
      - ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data
      - BALANCE=uri depth 3
      - EXCLUDE_PORTS=443
      - HTTP_CHECK=GET /healthcheck
      - EXTRA_SETTINGS=http-check expect string true
      - RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq
      - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
      - POSTGRESQL_SERVER_PORT=5432
      - POSTGRESQL_SERVER_DB_NAME=onlyoffice
      - POSTGRESQL_SERVER_USER=onlyoffice
      - REDIS_SERVER_HOST=onlyoffice-redis
      - REDIS_SERVER_PORT=6379
    stdin_open: true
    restart: always
    ports:
      - '80:80'
    volumes_from:
     - onlyoffice-documentserver-data
    privileged: true

  onlyoffice-redis:
    container_name: onlyoffice-redis
    image: redis
    restart: always
    ports:
      - '6379'
    privileged: true

  onlyoffice-rabbitmq:
    container_name: onlyoffice-rabbitmq
    image: rabbitmq
    restart: always
    ports:
      - '5672'
    privileged: true

  onlyoffice-postgresql:
    container_name: onlyoffice-postgresql
    image: postgres:9.5
    environment:
      - POSTGRES_DB=onlyoffice
      - POSTGRES_USER=onlyoffice
    restart: always
    volumes:
      - postgresql_data:/var/lib/postgresql
    ports:
      - '5432'
    privileged: true

volumes:
  postgresql_data:
  data:
  log:
  cache:
  fonts:
  files:

The docker-compose has no haproxy container, because I've got Traefik on Kubernetes. I checked the pods to understand what's wrong.

It seems that 8000 port is not used by any service, nginx seems to be configured to proxy_pass on that port. So that's the problem ?

Just to be precise:

kubectl logs onlyoffice-documentserver-549d777dcd-vj72m 
Starting supervisor: supervisord.
 * Starting nginx nginx
   ...done.
Generating AllFonts.js, please wait...Done
onlyoffice-documentserver:docservice: stopped
onlyoffice-documentserver:docservice: started
onlyoffice-documentserver:converter: stopped
onlyoffice-documentserver:converter: started
 * Reloading nginx configuration nginx
   ...done.
kubectl logs onlyoffice-documentserver-data-764b87d54d-2477r 
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
 * Starting nginx nginx
   ...done.
Generating AllFonts.js, please wait...Done
 * Reloading nginx configuration nginx
   ...done.

Grep command seems to have a problem

kubectl exec -it onlyoffice-documentserver-549d777dcd-vj72m -- tail -f /var/log/onlyoffice/documentserver/nginx.error.log
2018/04/02 13:30:07 [error] 105#105: *1 no live upstreams while connecting to upstream, client: 10.1.224.161, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://docservice/favicon.ico", host: "office.XXXX.org", referrer: "http://office.XXXX.org/welcome"

I replace my hostname by XXXX => so that means that data server is not ok:

kubectl exec -it onlyoffice-documentserver-549d777dcd-vj72m --  curl 10.1.224.161
404 page not found

There is something that I miss... but what ?

Nginx are running on both documentserver and documentserver-data... that should work...

Any help... ?

Originally created by @metal3d on GitHub (Apr 2, 2018). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/91 Hi, I'm trying hard to make it working on Kubernetes. I generated objects with Kompose from a modified docker-compose.yml file: ``` version: '2' services: onlyoffice-documentserver-data: image: onlyoffice/documentserver:latest environment: - ONLYOFFICE_DATA_CONTAINER=true - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql - POSTGRESQL_SERVER_PORT=5432 - POSTGRESQL_SERVER_DB_NAME=onlyoffice - POSTGRESQL_SERVER_USER=onlyoffice - RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq - REDIS_SERVER_HOST=onlyoffice-redis - REDIS_SERVER_PORT=6379 stdin_open: true restart: always volumes: - data:/var/www/onlyoffice/Data - log:/var/log/onlyoffice - cache:/var/lib/onlyoffice/documentserver/App_Data/cache/files - files:/var/www/onlyoffice/documentserver-example/public/files - fonts:/usr/share/fonts privileged: true ports: - '80' - '8000' - '9001' onlyoffice-documentserver: image: onlyoffice/documentserver:latest depends_on: - onlyoffice-documentserver-data - onlyoffice-postgresql - onlyoffice-redis - onlyoffice-rabbitmq environment: - ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data - BALANCE=uri depth 3 - EXCLUDE_PORTS=443 - HTTP_CHECK=GET /healthcheck - EXTRA_SETTINGS=http-check expect string true - RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql - POSTGRESQL_SERVER_PORT=5432 - POSTGRESQL_SERVER_DB_NAME=onlyoffice - POSTGRESQL_SERVER_USER=onlyoffice - REDIS_SERVER_HOST=onlyoffice-redis - REDIS_SERVER_PORT=6379 stdin_open: true restart: always ports: - '80:80' volumes_from: - onlyoffice-documentserver-data privileged: true onlyoffice-redis: container_name: onlyoffice-redis image: redis restart: always ports: - '6379' privileged: true onlyoffice-rabbitmq: container_name: onlyoffice-rabbitmq image: rabbitmq restart: always ports: - '5672' privileged: true onlyoffice-postgresql: container_name: onlyoffice-postgresql image: postgres:9.5 environment: - POSTGRES_DB=onlyoffice - POSTGRES_USER=onlyoffice restart: always volumes: - postgresql_data:/var/lib/postgresql ports: - '5432' privileged: true volumes: postgresql_data: data: log: cache: fonts: files: ``` The docker-compose has no haproxy container, because I've got Traefik on Kubernetes. I checked the pods to understand what's wrong. It seems that 8000 port is not used by any service, nginx seems to be configured to proxy_pass on that port. So that's the problem ? Just to be precise: ``` kubectl logs onlyoffice-documentserver-549d777dcd-vj72m Starting supervisor: supervisord. * Starting nginx nginx ...done. Generating AllFonts.js, please wait...Done onlyoffice-documentserver:docservice: stopped onlyoffice-documentserver:docservice: started onlyoffice-documentserver:converter: stopped onlyoffice-documentserver:converter: started * Reloading nginx configuration nginx ...done. ``` ``` kubectl logs onlyoffice-documentserver-data-764b87d54d-2477r Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. * Starting nginx nginx ...done. Generating AllFonts.js, please wait...Done * Reloading nginx configuration nginx ...done. ``` Grep command seems to have a problem ``` kubectl exec -it onlyoffice-documentserver-549d777dcd-vj72m -- tail -f /var/log/onlyoffice/documentserver/nginx.error.log 2018/04/02 13:30:07 [error] 105#105: *1 no live upstreams while connecting to upstream, client: 10.1.224.161, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://docservice/favicon.ico", host: "office.XXXX.org", referrer: "http://office.XXXX.org/welcome" ``` I replace my hostname by XXXX => so that means that data server is not ok: ``` kubectl exec -it onlyoffice-documentserver-549d777dcd-vj72m -- curl 10.1.224.161 404 page not found ``` There is something that I miss... but what ? Nginx are running on both documentserver and documentserver-data... that should work... Any help... ?
kerem 2026-02-26 09:35:35 +03:00
Author
Owner

@agolybev commented on GitHub (Apr 3, 2018):

Hi @metal3d.
Check whether you proxy traffic to onlyoffice-documentserver container, the one hasn't got 'container_name', so it name will be extended by suffix . Add necessary HTTP headers to the proxy request
Additional, I've got few notice for you:
First, you don't have to export any ports from onlyoffice-documentserver-data container.
Second, the next code isn't need if you removed haproxy container:

 - BALANCE=uri depth 3
 - EXCLUDE_PORTS=443
 - HTTP_CHECK=GET /healthcheck

Finally, Are you sure about export ports forn rabbitmq, postgresql and redis container? They will be exported outside network.

<!-- gh-comment-id:378193294 --> @agolybev commented on GitHub (Apr 3, 2018): Hi @metal3d. Check whether you proxy traffic to `onlyoffice-documentserver` container, the one hasn't got 'container_name', so it name will be extended by suffix . [Add necessary HTTP headers to the proxy request](https://helpcenter.onlyoffice.com/server/document/document-server-proxy.aspx) Additional, I've got few notice for you: First, you don't have to export any ports from `onlyoffice-documentserver-data` container. Second, the next code isn't need if you removed `haproxy` container: ``` - BALANCE=uri depth 3 - EXCLUDE_PORTS=443 - HTTP_CHECK=GET /healthcheck ``` Finally, Are you sure about export ports forn rabbitmq, postgresql and redis container? They will be exported outside network.
Author
Owner

@ShockwaveNN commented on GitHub (Apr 22, 2019):

This issue was closed due to no response.

<!-- gh-comment-id:485455202 --> @ShockwaveNN commented on GitHub (Apr 22, 2019): This issue was closed due to no response.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#51
No description provided.