Rolling upgrades for Kong Gateway

Uses: Kong Gateway Operator
Related Documentation

Using DataPlane

This method is only available when running in hybrid mode.

To change the image used for your DataPlane resources, set the spec.deployment.podTemplateSpec.spec.containers[].image field in your resource:

kubectl edit dataplane dataplane-example -n kong

Once the resource is saved, Kubernetes will perform a rolling upgrade of your Pods.

Using GatewayConfiguration

This method is only available when running in KIC mode.

The GatewayConfiguration API can be used to provide the image and the image version desired for either the ControlPlane or DataPlane component of the Gateway. For example:

kind: GatewayConfiguration
apiVersion: gateway-operator.konghq.com/v1alpha1
metadata:
  name: kong
  namespace: default
spec:
  dataPlaneOptions:
    deployment:
      podTemplateSpec:
        spec:
          containers:
          - name: proxy
            image: kong/kong-gateway:3.10
  controlPlaneOptions:
    deployment:
      podTemplateSpec:
        spec:
          containers:
          - name: controller
            image: kong/kubernetes-ingress-controller:

The above configuration will deploy all DataPlane resources connected to the GatewayConfiguration (by way of GatewayClass) using kong/kong-gateway:3.10 and any ControlPlane will be deployed with kong/kubernetes-ingress-controller:.

Given the above, a manual upgrade or downgrade can be performed by changing the version.

For example, assuming that at least one Gateway is currently deployed and running using the above GatewayConfiguration, an upgrade could be performed by running the following:

kubectl edit gatewayconfiguration kong

And updating the proxy container image tag in spec.dataPlaneOptions.deployment.podTemplateSpec.spec to 3.4 like so: kong/kong-gateway:3.4. The result will be a replacement Pod that will roll out with the old version, and once healthy the old Pod will be terminated.

Something wrong?

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!