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
-
docker run --rm \
-
--network main_net \
-
-e KONG_DATABASE=postgres \
-
-e KONG_PG_HOST=kong-public-database \
-
-e KONG_PG_DATABASE=kong \
-
kong:0.14 kong migrations up
-
-
docker run --rm \
-
--network main_net \
-
-e KONG_DATABASE=postgres \
-
-e KONG_PG_HOST=kong-public-database \
-
-e KONG_PG_DATABASE=kong \
-
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:
-
docker exec -it kong_public_kong-public.1.z00bbj0zlqmdnz4l3fc1nv1ok /bin/sh
-
kong migrations finish