mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-07-22 18:49:19 +03:00
Reboot only when required, add the option to clean packages. (#13327)
* Reboot only when required, add the option to clean packages. * Update docs to reflect only Debian based distribution can be apt autocleaned * Add apt cleanup to upgrade tests
This commit is contained in:
@@ -437,3 +437,5 @@ Nodes will be rebooted when there are package upgrades (`system_upgrade_reboot:
|
||||
This can be changed to `always` or `never`.
|
||||
|
||||
Note: Downloads will happen twice unless `system_upgrade_reboot` is `never`.
|
||||
|
||||
Debian based nodes can be cleaned of packages to reduce disk space usage with `system_upgrade_autoclean: true`
|
||||
|
||||
@@ -808,6 +808,7 @@ sysctl_ignore_unknown_keys: false
|
||||
|
||||
system_upgrade: false
|
||||
system_upgrade_reboot: on-upgrade # never, always
|
||||
system_upgrade_autoclean: false
|
||||
|
||||
# Enables or disables the scheduler plugins.
|
||||
scheduler_plugins_enabled: false
|
||||
|
||||
@@ -5,10 +5,23 @@
|
||||
upgrade: dist
|
||||
autoremove: true
|
||||
dpkg_options: force-confold,force-confdef
|
||||
register: apt_upgrade
|
||||
|
||||
- name: Reboot after APT Dist-Upgrade # noqa no-handler
|
||||
- name: Check if a reboot is required
|
||||
ansible.builtin.stat:
|
||||
path: /var/run/reboot-required
|
||||
get_checksum: false
|
||||
register: reboot_required
|
||||
|
||||
- name: Reboot server if required to apply updates
|
||||
ansible.builtin.reboot:
|
||||
msg: "The system is going down for reboot NOW!"
|
||||
post_reboot_delay: 30
|
||||
when:
|
||||
- apt_upgrade.changed or system_upgrade_reboot == 'always'
|
||||
- system_upgrade_reboot != 'never'
|
||||
reboot:
|
||||
- reboot_required.stat.exists
|
||||
- system_upgrade_reboot != 'never'
|
||||
|
||||
- name: APT Autoclean
|
||||
apt:
|
||||
autoclean: true
|
||||
when:
|
||||
- system_upgrade_autoclean
|
||||
|
||||
@@ -6,6 +6,7 @@ vm_memory: 3072
|
||||
|
||||
# Kubespray settings
|
||||
auto_renew_certificates: true
|
||||
system_upgrade_autoclean: true
|
||||
|
||||
# Currently ipvs not available on KVM: https://packages.ubuntu.com/search?suite=focal&arch=amd64&mode=exactfilename&searchon=contents&keywords=ip_vs_sh.ko
|
||||
kube_proxy_mode: iptables
|
||||
|
||||
@@ -7,6 +7,7 @@ vm_memory: 3072
|
||||
# Kubespray settings
|
||||
container_manager: crio
|
||||
auto_renew_certificates: true
|
||||
system_upgrade_autoclean: true
|
||||
|
||||
# Currently ipvs not available on KVM: https://packages.ubuntu.com/search?suite=noble&arch=amd64&mode=exactfilename&searchon=contents&keywords=ip_vs_sh.ko
|
||||
kube_proxy_mode: iptables
|
||||
|
||||
Reference in New Issue
Block a user