Rolling updates

Apigee hybrid supports rolling updates. In Kubernetes, rolling updates allow Deployment updates to take place with zero downtime by incrementally updating Pod instances with new ones.

Components that support rolling updates

If you change property settings for any hybrid of the following components in your overrides file, you can use the revision property to signal that you want to perform a rolling update to the affected pods.

  • runtime
  • mart
  • udca
  • metrics
  • synchronizer

You can also use revision when you change any of the following properties:

  • nodeSelector.*
  • envs.*
  • imagePullSecrets.*
  • gcpProjectID (Deprecated)
  • k8sClusterName (Deprecated)
  • gcp.*
  • k8sCluster.*
  • contractProvider
  • org

How to perform a rolling update

For example, suppose you want to change the current runtime memory from 1Gi to 5Gi:

In the current configuration, revision is set to blue:

...
revision: blue
...
runtime:
  replicaCountMin: 2
  replicaCountMax: 20
  resources:
    cpu: 1000m
    memory: 1Gi
...

In the new configuration, revision is changed to green, signaling that you want to perform a rolling update when the change is applied. The value you set revision to does not matter; you can use any string you wish, as long as you change it from the previous value to something else.

...
revision: green
...
runtime:
  replicaCountMin: 2
  replicaCountMax: 20
  resources:
    cpu: 1000m
    memory: 5Gi
...

When you apply the change, you can use the -c flag to only update a specific pod. For example:

apigeectl apply -f my-overrides.yaml -c runtime

Or, if you do not use -c all of the pods that have config changes will be updated.