Upgrade

You can use this guide to upgrade the version of kgateway for your control plane and data plane components, or to apply changes to the components’ configuration settings.

Upgrade

  1. Set the version to upgrade kgateway in an environment variable, such as the latest patch version (2.2.0-main) .

    export NEW_VERSION=2.2.0-main
  2. Apply the kgateway CRDs for the upgrade version by using Helm.

    1. Optional: To check the CRDs locally, download the CRDs to a helm directory.

      helm template --version v$NEW_VERSION kgateway-crds oci://cr.kgateway.dev/kgateway-dev/charts/kgateway-crds --output-dir ./helm
    2. Upgrade the CRDs in your cluster:

      helm upgrade -i --namespace kgateway-system --version v$NEW_VERSION kgateway-crds oci://cr.kgateway.dev/kgateway-dev/charts/kgateway-crds
  3. Make any changes to your Helm values.

    1. Get the Helm values file for your current version.

      helm get values kgateway -n kgateway-system -o yaml > values.yaml
      open values.yaml
    2. Compare your current Helm chart values with the version that you want to upgrade to.

      • Show all values:

        helm show values oci://cr.kgateway.dev/kgateway-dev/charts/kgateway --version v$NEW_VERSION
      • Get a file with all values: You can get a kgateway/values.yaml file for the upgrade version by pulling and inspecting the Helm chart locally.

        helm pull oci://cr.kgateway.dev/kgateway-dev/charts/kgateway --version v$NEW_VERSION
        tar -xvf kgateway-v$NEW_VERSION.tgz
        open kgateway/values.yaml
    3. Make any changes that you want by editing your values.yaml Helm values file or preparing the --set flags. For development v2.2.0-main builds, include the controller.image.pullPolicy=Always setting or refer to the exact image digest to avoid using cached images.

  4. Upgrade the kgateway Helm installation.

    • Make sure to include your Helm values when you upgrade either as a configuration file or with --set flags. Otherwise, any previous custom values that you set might be overwritten.
    • When using the development build v2.2.0-main, add the --set controller.image.pullPolicy=Always option to ensure you get the latest image. Alternatively, you can specify the exact image digest.
      • To use experimental Gateway API features, include the experimental feature gate, --set controller.extraEnv.KGW_ENABLE_GATEWAY_API_EXPERIMENTAL_FEATURES=true.
      • Make sure to keep the agentgateway feature flag, --set agentgateway.enabled=true.
    helm upgrade -i -n kgateway-system kgateway oci://cr.kgateway.dev/kgateway-dev/charts/kgateway \
      -f values.yaml \
      --version v$NEW_VERSION 
  5. Verify that kgateway runs the upgraded version.

    kubectl -n kgateway-system get pod -l app.kubernetes.io/name=kgateway -o jsonpath='{.items[0].spec.containers[0].image}'

    Example output:

    cr.kgateway.dev/kgateway-dev/kgateway:2.2.0-main
  6. Confirm that the kgateway control plane is up and running.

    kubectl get pods -n kgateway-system