def upgrade_node(upd, with_testing, env, *args, **kwargs):
upd.print_log('Setup network plugin:')
upd.print_log('Install packages...')
upd.print_log(helpers.remote_install('python-requests', with_testing))
upd.print_log(helpers.remote_install('python-ipaddress', with_testing))
upd.print_log(helpers.remote_install('ipset', with_testing))
upd.print_log(run("""sed -i '/^KUBELET_ARGS/ {s|"\(.*\) --network-plugin=kuberdock"|"\\1"|}' /etc/kubernetes/kubelet"""))
upd.print_log(run("""sed -i '/^KUBELET_ARGS/ {s|"\(.*\) --register-node=false"|"\\1 --register-node=false --network-plugin=kuberdock"|}' /etc/kubernetes/kubelet"""))
upd.print_log(run("mkdir -p {0}/data".format(PLUGIN_DIR)))
upd.print_log(put('/var/opt/kuberdock/node_network_plugin.sh',
PLUGIN_DIR + 'kuberdock',
mode=0755))
upd.print_log(put('/var/opt/kuberdock/node_network_plugin.py',
PLUGIN_DIR + 'kuberdock.py',
mode=0755))
upd.print_log(run('chmod +x {0}'.format(PLUGIN_DIR + 'kuberdock')))
upd.print_log(
run("cat > /etc/systemd/system/kuberdock-watcher.service << 'EOF' {0}"
.format(SERVICE_FILE))
)
run('systemctl daemon-reload')
upd.print_log(run('systemctl reenable kuberdock-watcher'))
评论列表
文章目录