项目作者: MnrGreg

项目描述 :
Krew plugin to restart Kubernetes Nodes sequentially and gracefully
高级语言: Shell
项目地址: git://github.com/MnrGreg/kubectl-node-restart.git
创建时间: 2020-02-15T05:00:47Z
项目社区:https://github.com/MnrGreg/kubectl-node-restart

开源协议:Other

下载


kubectl-node-restart

kubectl-node-restart is a kubectl plugin that sequentially and gracefully performs a rolling restart of Nodes within a Kubernetes cluster

using kubectl-node-restart plugin

Installing

  • install krew using instructions here
  • run kubectl krew update
  • run kubectl krew install node-restart

installing kubectl-node-restart plugin

Usage

  • perform rolling restart of all nodes in a cluster
  1. kubectl node-restart [--context cluster] all
  • restart only specific nodes selected through labels
  1. kubectl node-restart --selector node-role.kubernetes.io/master
  • execute a command prior to reboot labels
  1. kubectl node-restart all --command "echo 'hello world'"
  • perform a dry-run
  1. kubectl node-restart all --dry-run
  • restart node(s) without first draining
  1. kubectl node-restart all --force
  • add a delay of 120seconds between node restarts
  1. kubectl node-restart all --sleep 120
  • Pull the Alpine image from a private registry
  1. kubectl node-restart all --registry myregistry.local/library/alpine:3.9