Charms that comprise Charmed Kubernetes install required software such
kube-apiserver using snap packages. The
daemon periodically scans installed snaps for updates and will automatically
refresh upgradeable packages to ensure the software is current.
All charms built from layer-snap include a
option that can be used to adjust the
snapd refresh interval. By default,
Charmed Kubernetes charms set this option to the maximum amount of time
snapd will allow between scans.
Refresh interval configuration
Display the currently configured
snapd_refresh option for a given charm:
juju config <charm> snapd_refresh
snapd_refresh option with the following:
juju config <charm> snapd_refresh=<value>
The value returned or set above should be an explicit timer, an empty string, or the special keyword max.
An explicit timer may be a simple
mon(scan every Monday) or a more complex
mon3,23:00(scan on the third Monday of the month at 23:00). See possible values for explicit timers in the the refresh.timer section of the system options documentation.
An empty string instructs
snapdto refresh snap packages according to the default system policy. This is currently 4 times per day.
When set to
max, refresh scans will be delayed for the maximum amount of time allowed by
snapd. This is currently once per month based on the date this option was set.
Determine the actual max value
snap get on a deployed system to determine the value that
when a charm is configured with
snapd_refresh=max. An example with
shows that the
max option used when
etcd/0 was deployed has mapped to the
last Sunday of every month (
juju config etcd snapd_refresh max juju run --unit etcd/0 'snap get system refresh.timer' sun5
Refresh interval among peers
Charmed Kubernetes applications that support peering will use Juju
leadership to configure a consistent refresh interval among peers. The lead
will set an initial refresh value. Subsequent units that join as followers
will use the leader value as their snap refresh interval. This ensures all
units in a peer group will refresh at approximately the same time.
Force snapd to refresh installed snaps
If an immediate snap refresh is desired, invoke
snap refresh on the
applicable cluster components. For example, refresh all snaps on all
juju run --application etcd 'snap refresh'
As another example, only refresh the
cdk-addons snap on the
kubernetes-master/0 unit with:
juju run --unit kubernetes-master/0 'snap refresh cdk-addons'