"Database already bootstrapped" messages when upgrading Kong with Helm

Uses: Kong Gateway
TL;DR

Why does Kong’s Helm upgrade report “Database already bootstrapped”?

This happens when the Kong Helm chart was uninstalled and reinstalled instead of upgraded — helm install always runs kong migrations bootstrap, which fails against a database that a previous install already bootstrapped. Use helm upgrade instead, which runs kong migrations up and kong migrations finish, after bumping the image tag in values.yaml.

Problem

When attempting to upgrade Kong using Helm, the kong-init-migrations pod reports:

Database already bootstrapped

Additionally, reviewing the Kong pod logs will show:

Run with --v (verbose) or --vv (debug) for more details
waiting for db
Error: /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:30: New migrations available; run 'kong migrations up' to proceed

Cause

This issue occurs when the chart is uninstalled and reinstalled rather than upgraded.

Solution

When upgrading via Helm you should follow the below procedure.

  1. Change the version of Kong in the values.yaml to the desired target. For example, if you are upgrading from 3.10.0.0 to 3.14.0.0 you should change

    image:
      repository: kong-docker-kong-enterprise-edition-docker.bintray.io/kong-enterprise-edition
      tag: 3.10.0.0

    to

    image:
      repository: kong-docker-kong-enterprise-edition-docker.bintray.io/kong-enterprise-edition
      tag: 3.14.0.0
  2. Upgrade the chart

    helm upgrade my-kong kong/kong -n kong --values ./values.yaml

When helm install is run this causes the installation to run kong migrations bootstrap, whereas running helm upgrade will run kong migrations up and kong migrations finish.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!