Kong Update

Submitted by code_admin on Tue, 05/28/2019 - 15:31

Inplace Kong update (with downtime)

docker pull new images (Kong and Konga)

Change docker compose file
- Change Kong version
- Check ports
- Add stdout vars
- Change Konga version
- Check healthcheck makes sense

Docker Stack rm kong stack

Start up the stack again with new compose file

Checked error and saw:
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | /usr/local/share/lua/5.1/kong/init.lua:337: in function 'init'
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | init_by_lua:3: in main chunk
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:337: database needs bootstrap; run 'kong migrations bootstrap'
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | stack traceback:
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | [C]: in function 'error'
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | /usr/local/share/lua/5.1/kong/init.lua:337: in function 'init'
kong_public_kong-public.1.qauc3qa754hx@ic-soadevteam.cc.ic.ac.uk | init_by_lua:3: in main chunk

DON't docker stack rm - we need DB running to do migration on it

I had to do two migrations

  1. docker run --rm \
  2.     --network main_net \
  3.     -e KONG_DATABASE=postgres \
  4.     -e KONG_PG_HOST=kong-public-database \
  5.     -e KONG_PG_DATABASE=kong \
  6.     kong:0.14 kong migrations up
  7.  
  8. docker run --rm \
  9.     --network main_net \
  10.     -e KONG_DATABASE=postgres \
  11.     -e KONG_PG_HOST=kong-public-database \
  12.     -e KONG_PG_DATABASE=kong \
  13.     kong:1.1.2 kong migrations up

After this all looked good
but it wasn't there is a new upgrade process https://github.com/Kong/kong/blob/master/UPGRADE.md#upgrade-from-0x-to-…

I had to run the following commands:

  1. docker exec -it kong_public_kong-public.1.z00bbj0zlqmdnz4l3fc1nv1ok /bin/sh
  2. kong migrations finish

Tags

RJM Article Type
Work Notes