Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure kubelet gets restarted after package version change #525

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions manifests/packages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -377,29 +377,35 @@
}
}

if $create_repos and $facts['os']['family'] == 'Debian' {
package { $kube_packages:
ensure => $kubernetes_package_version,
require => Class['Apt::Update'],
}
if $pin_packages {
file { '/etc/apt/preferences.d/kubernetes':
mode => '0444',
owner => 'root',
group => 'root',
content => template('kubernetes/kubernetes_apt_package_pins.erb'),
if $create_repos {
case $facts['os']['family'] {
'Debian': {
package { $kube_packages:
ensure => $kubernetes_package_version,
require => Class['apt::update'],
}
if $pin_packages {
file { '/etc/apt/preferences.d/kubernetes':
mode => '0444',
owner => 'root',
group => 'root',
content => template('kubernetes/kubernetes_apt_package_pins.erb'),
}
} else {
file { '/etc/apt/preferences.d/kubernetes':
ensure => absent,
}
}
}
} else {
file { '/etc/apt/preferences.d/kubernetes':
ensure => absent,
'RedHat': {
package { $kube_packages:
ensure => $kubernetes_package_version,
}
if $pin_packages {
fail('package pinning is not implemented on this platform')
}
}
}
} else {
package { $kube_packages:
ensure => $kubernetes_package_version,
}
if $pin_packages {
fail('package pinning is not implemented on this platform')
default: { notify { "The OS family ${facts['os']['family']} is not supported by this module. ${kube_packages} NOT installed": } }
}
}
}
5 changes: 3 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
}

service { 'kubelet':
enable => true,
require => Exec['kubernetes-systemd-reload'],
ensure => running,
enable => true,
subscribe => [Exec['kubernetes-systemd-reload'], Package['kubelet']],
}
}