kontena / pharos-host-upgrades

Kube DaemonSet for host OS upgrades
Apache License 2.0
41 stars 1 forks source link

Support config files for CentOS host upgrades #9

Closed SpComb closed 6 years ago

SpComb commented 6 years ago

Allow using a configmap at --config-path=/etc/host-upgrades to copy yum-cron.conf to --host-mount=/run/host-upgrades to CentOS host upgrades.

SpComb commented 6 years ago

Testing with kube shows yum-cron using the configured yum-cron.conf:

2018/05/23 10:31:04 Load config from --config-path=/etc/host-upgrades
2018/05/23 10:31:04 Copying configs to --host-mount=/run/host-upgrades
2018/05/23 10:31:04 hosts/ubuntu probe mismatch: CentOS Linux 7 (Core)
2018/05/23 10:31:04 hosts/centos probe success: systemd.HostInfo{KernelName:"Linux", Hostname:"localhost.localdomain", OperatingSystemPrettyName:"CentOS Linux 7 (Core)", KernelVersion:"#1 SMP Wed May 9 18:05:47 UTC 2018", KernelRelease:"3.10.0-862.2.3.el7.x86_64"}
2018/05/23 10:31:04 Probed host: hosts.HostInfo{OperatingSystem:"CentOS", OperatingSystemRelease:"7", Kernel:"Linux", KernelRelease:"3.10.0-862.2.3.el7.x86_64"}
2018/05/23 10:31:04 hosts/centos: using copied yum-cron.conf at /run/host-upgrades/yum-cron.conf
2018/05/23 10:31:04 Using --kube-namespace=kube-system --kube-daemonset=host-upgrades --kube-node=localhost.localdomain
2018/05/23 10:31:04 kube/lock kube-system/daemonsets/host-upgrades: get
2018/05/23 10:31:04 kube/lock kube-system/daemonsets/host-upgrades: test pharos-host-upgrades.kontena.io/lock=: free
2018/05/23 10:31:04 Using kube lock kube-system/daemonsets/host-upgrades (acquired=false, value=)
2018/05/23 10:31:04 Using --schedule="0 * * * *", first upgrade at: 2018-05-23 10:32:00 +0000 UTC (in 55.058802541s)

2018/05/23 10:32:00 Acquiring kube lock...
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: wait
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: get
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: test pharos-host-upgrades.kontena.io/lock=: free
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: acquire
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: set pharos-host-upgrades.kontena.io/lock=localhost.localdomain
2018/05/23 10:32:00 kube/lock kube-system/daemonsets/host-upgrades: update
2018/05/23 10:32:00 Running host upgrades...
2018/05/23 10:32:00 hosts/centos upgrade: /usr/sbin/yum-cron
2018/05/23 10:32:00 systemd/exec host-upgrades.service: cmd=[/usr/sbin/yum-cron /run/host-upgrades/yum-cron.conf]
2018/05/23 10:32:00 systemd/exec host-upgrades.service: reset
2018/05/23 10:32:00 systemd/exec host-upgrades.service: start []dbus.Property{dbus.Property{Name:"ExecStart", Value:dbus.Variant{sig:dbus.Signature{str:"a(sasb)"}, value:[]dbus.execStart{dbus.execStart{Path:"/usr/sbin/yum-cron", Args:[]string{"/usr/sbin/yum-cron", "/run/host-upgrades/yum-cron.conf"}, UncleanIsFailure:false}}}}, dbus.Property{Name:"Type", Value:dbus.Variant{sig:dbus.Signature{str:"s"}, value:"oneshot"}}}
2018/05/23 10:32:00 systemd/exec host-upgrades.service: wait
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.269078 +0000 UTC: exiting because "Download Only" specified
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.269325 +0000 UTC: The following updates will be downloaded on localhost.localdomain:
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.269511 +0000 UTC: ================================================================================
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.269686 +0000 UTC: Package                 Arch      Version                     Repository  Size
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.269861 +0000 UTC: ================================================================================
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.270034 +0000 UTC: Installing:
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.270212 +0000 UTC: kernel                  x86_64    3.10.0-862.3.2.el7          updates     46 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.270384 +0000 UTC: Updating:
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.270555 +0000 UTC: NetworkManager          x86_64    1:1.10.2-14.el7_5           updates    1.7 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.270726 +0000 UTC: NetworkManager-libnm    x86_64    1:1.10.2-14.el7_5           updates    1.3 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.2709 +0000 UTC: NetworkManager-team     x86_64    1:1.10.2-14.el7_5           updates    161 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271087 +0000 UTC: NetworkManager-tui      x86_64    1:1.10.2-14.el7_5           updates    235 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271259 +0000 UTC: ca-certificates         noarch    2018.2.22-70.0.el7_5        updates    392 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271442 +0000 UTC: centos-release          x86_64    7-5.1804.el7.centos.2       updates     24 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271617 +0000 UTC: dhclient                x86_64    12:4.2.5-68.el7.centos.1    updates    284 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271788 +0000 UTC: dhcp-common             x86_64    12:4.2.5-68.el7.centos.1    updates    175 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.271962 +0000 UTC: dhcp-libs               x86_64    12:4.2.5-68.el7.centos.1    updates    131 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272133 +0000 UTC: e2fsprogs               x86_64    1.42.9-12.el7_5             updates    699 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272305 +0000 UTC: e2fsprogs-libs          x86_64    1.42.9-12.el7_5             updates    167 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272474 +0000 UTC: iptables                x86_64    1.4.21-24.1.el7_5           updates    432 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272645 +0000 UTC: kernel-tools            x86_64    3.10.0-862.3.2.el7          updates    6.2 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272818 +0000 UTC: kernel-tools-libs       x86_64    3.10.0-862.3.2.el7          updates    6.2 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.272992 +0000 UTC: libcom_err              x86_64    1.42.9-12.el7_5             updates     41 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.273173 +0000 UTC: libgcc                  x86_64    4.8.5-28.el7_5.1            updates    101 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.273343 +0000 UTC: libgomp                 x86_64    4.8.5-28.el7_5.1            updates    156 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.27356 +0000 UTC: libss                   x86_64    1.42.9-12.el7_5             updates     45 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.273822 +0000 UTC: libstdc++               x86_64    4.8.5-28.el7_5.1            updates    303 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274019 +0000 UTC: nspr                    x86_64    4.19.0-1.el7_5              updates    127 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274199 +0000 UTC: nss                     x86_64    3.36.0-5.el7_5              updates    835 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274375 +0000 UTC: nss-softokn             x86_64    3.36.0-5.el7_5              updates    315 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274547 +0000 UTC: nss-softokn-freebl      x86_64    3.36.0-5.el7_5              updates    222 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274759 +0000 UTC: nss-sysinit             x86_64    3.36.0-5.el7_5              updates     62 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.274979 +0000 UTC: nss-tools               x86_64    3.36.0-5.el7_5              updates    514 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.275201 +0000 UTC: nss-util                x86_64    3.36.0-1.el7_5              updates     78 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.275379 +0000 UTC: openldap                x86_64    2.4.44-15.el7_5             updates    355 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.275558 +0000 UTC: python-perf             x86_64    3.10.0-862.3.2.el7          updates    6.2 M
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.275755 +0000 UTC: rsyslog                 x86_64    8.24.0-16.el7_5.4           updates    607 k
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.276018 +0000 UTC: Transaction Summary
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.276274 +0000 UTC: ================================================================================
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.27653 +0000 UTC: Install   1 Package
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.287181 +0000 UTC: Upgrade  29 Packages
2018/05/23 10:32:03 systemd/exec host-upgrades.service: journal 2018-05-23 10:32:03.28747 +0000 UTC: Updates downloaded successfully.
2018/05/23 10:32:03 systemd/exec host-upgrades.service: done
2018/05/23 10:32:03 kube/lock kube-system/daemonsets/host-upgrades: get
2018/05/23 10:32:03 kube/lock kube-system/daemonsets/host-upgrades: release
2018/05/23 10:32:03 kube/lock kube-system/daemonsets/host-upgrades: clear pharos-host-upgrades.kontena.io/lock=localhost.localdomain
2018/05/23 10:32:03 kube/lock kube-system/daemonsets/host-upgrades: update
2018/05/23 10:32:03 Schedule run completed in 3.322394161s, next upgrade at: 2018-05-23 10:33:00 +0000 UTC (in 56.677199593s)