Puppet Class: kubeinstall::calico::veth_mtu
- Defined in:
- manifests/calico/veth_mtu.pp
Summary
Configure Calico MTUOverview
Configure Calico MTU see # docs.projectcalico.org/networking/mtu#determine-mtu-size
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'manifests/calico/veth_mtu.pp', line 8
class kubeinstall::calico::veth_mtu (
Integer $mtu = $kubeinstall::calico_mtu,
) {
unless $mtu == $facts['kubectl_calico_veth_mtu'] {
$veth_mtu = {
'data' => {
'veth_mtu' => "${mtu}", # lint:ignore:only_variable_string
}
}
$mtu_patch = to_json($veth_mtu)
exec {
default:
path => '/usr/bin:/bin:/usr/sbin:/sbin',
environment => [
'KUBECONFIG=/etc/kubernetes/admin.conf',
],
;
'patch-configmap-calico-config':
command => "kubectl -n kube-system patch configmap/calico-config --type merge -p '${mtu_patch}'",
onlyif => 'kubectl -n kube-system get configmap/calico-config',
notify => Exec['restart-daemonset-calico-node'],
;
'restart-daemonset-calico-node':
command => 'kubectl -n kube-system rollout restart daemonset calico-node',
onlyif => 'kubectl -n kube-system get daemonset calico-node',
refreshonly => true,
;
}
}
}
|