Vertically scaling your pods or containers requires them to be restarted. Not having control on when containers can scale may cause unwanted disruption during critical business hours. The maintenance window feature is intended to provide more control over when pods and containers can be scaled. Setting the maintenance window provides clear guidance to the AI-based optimizer to consider the right metrics resolution and optimization window. For example, if the maintenance window is set to be every Sunday from 12 AM to 2 AM UTC, the optimizer will make sure that it considers the whole week metrics consider the 1-minute, 5-minutes, 30-minutes, and 1-hour resolutions. It will optimize for the best resources that will carry the container untouched for the following week, given that enough history is collected.
Maintenance window can be set at the controller/pod level. It defines when the pod to be analyzed for scalability. When the maintenance window is set, the pod will be skipped from the regular checks (every 1h) and will consider the set maintenance window.
To define maintenance window on a pod, just annotate this pod's controller with the following annotations:
magalix/mw-cronThis is a standard (5 parts) CRON expression. see https://en.wikipedia.org/wiki/Cron for more info. This cron defines the times when the pod will be analyzed for scalability. A decision is normally generated after few minutes from this trigger time. (required)
magalix/mw-offsetAn offset duration from the trigger time that the decision will be executed at. Supported duration strings are anything supported by golang
time.ParseDurationmethod. see https://golang.org/pkg/time/#ParseDuration for more info. (optional, defaults to 0). The minimum value is
0sand the minimum recommended is
magalix/mw-timezoneThe optional timezone of the trigger times. The default is UTC if the timezone is not specified.
apiVersionextensions/v1beta1 kindDeployment metadata annotations magalix/mw-cron30 5,10,19,20 * * * magalix/mw-offset2h .....
This will trigger the optimizer at
At 05:30 AM,
07:30 PM and
08:30 PM. The 2h offset means that the decision will be executed at At
09:30 PM and
10:30 PM. The timezone for those times are UTC
What if the maintenance window is not specified?
The AI will assume that hourly checks are acceptable. It will analyze on hourly bases the required resources covering only the next hour.
Is the maintenance window a free feature?
A Pro plan is required to be able to use the maintenance window feature.
What if I set an invalid maintenance window?
The optimizer will ignore it and keep optimizing on an hourly basis.