Controlling time windows for application upgrades
Configure application upgrade windows
With application upgrade windows you can control when upgrades of
applications will occur. Similar to maintenance windows
for supd upgrades, they are configured in site-profiles
and then
applied to sites in their configuration.
Site provider windows
As a site provider you may configure application upgrade windows controlling when applications for all tenants on a site will be upgraded.
To configure an application upgrade window as a site provider, first
create a site-profile
. The following site-profile
, called
nightly-upgrades
, allows the upgrade to be performed between
02:00-05:00 during the weekdays and any time on weekends.
name: nightly-upgrades
application-upgrade-windows:
- days-of-week: Monday, Tuesday, Wednesday, Thursday, Friday
start-time: 02:00
timezone: site-local
duration: 3h
- days-of-week: Saturday, Sunday
start-time: 00:00
timezone: site-local
duration: 24h
cat site-provider-site-profile.yaml | supctl create system site-profiles
The next step is to apply the site-profile
to the relevant sites:
site-profiles:
- nightly-upgrades
cat site-provider-site-profile-assignment.yaml | supctl merge system sites stockholm-sergel
cat site-provider-site-profile-assignment.yaml | supctl merge system sites gothenburg-bergakungen
Application owner windows
Additionally, as an application owner (sub tenant) you may configure application upgrade windows controlling when your own applications on a site will be upgraded.
To configure an application upgrade window as a application owner,
first create a site-profile
. The following site-profile
, called
weekly-upgrades
, allows the upgrade to be performed between
00:00-05:00 during the weekends.
name: weekly-upgrades
application-upgrade-windows
- days-of-week: Saturday, Sunday
start-time: 00:00
timezone: site-local
duration: 5h
cat app-owner-site-profile.yaml | supctl create site-profiles
The next step is to apply the site-profile
to the relevant sites:
site-profiles:
- weekly-upgrades
cat app-owner-site-profile-assignment.yaml | supctl merge assigned-sites stockholm-sergel
cat app-owner-site-profile-assignment.yaml | supctl merge assigned-sites gothenburg-bergakungen
To have any effect, the application windows for a site configured by an application owner need to be within at least one upgrade window configured by a site provider for the same site. If no site provider application upgrade window is configured for a site, the application owner may fully control when applications will be upgraded on that site.
By viewing the state data of an assigned site as an application owner you will see both your own application upgrade windows, but also any inherited application upgrade windows configured by a site provider.
supctl show assigned-sites gothenburg-bergakungen
...
application-upgrade-windows:
- days-of-week: Saturday, Sunday
start-time: 00:00
timezone: site-local
duration: 5h
inherited-application-upgrade-windows:
- days-of-week: Monday, Tuesday, Wednesday, Thursday, Friday
start-time: 02:00
timezone: site-local
duration: 3h
- days-of-week: Saturday, Sunday
start-time: 00:00
timezone: site-local
duration: 24h
Site local time vs. UTC
To simplify upgrade management, it is possible to configure time windows in two different ways, either expressed in the local time at the edge site or in UTC (Coordinated Universal Time).
Dependent on the use case, it could be convenient to use one
application upgrade window, expressed in site-local
time, to allow
upgrades at the same local time at every site in the world.
View queued application upgrades
On a site, it is possible to list your applications waiting to be scheduled. This is done by:
supctl show --site gothenburg-bergakungen application-queue
- name: alpine
time: 2024-02-28T10:57:00.827Z
application-deployment: alpine-dep
version: 1.3.0
Block upgrades
As a site provider you may block all application upgrades for all
tenants on a site. This is done by configuring the
application-upgrades-blocked
for a certain site.
Example:
supctl merge system sites gothenburg-bergakungen <<EOF
application-upgrades-blocked: true
EOF
Force upgrades
Occasionally, it may be necessary to perform application upgrades even
when no upgrade window is currently open or when upgrades are blocked
by a site provider. To address this situation, you can force
application upgrades for applications that are waiting to be
scheduled. This can be done using the force-upgrades
or
force-upgrade
action.
supctl do --site gothenburg-bergakungen application-queue force-upgrades --application-names alpine
supctl do --site gothenburg-bergakungen application-queue force-upgrade alpine --version 1.2.0
Manipulate the application queue
If there is a need, it is possible to manipulate the queue of applications waiting to be scheduled on a site by deleting element(s).
Example:
supctl do --site gothenburg-bergakungen application-queue delete alpine --version 1.3.0