GithubHelp home page GithubHelp logo

aks_node_restart's Introduction

Script performing rolling restart of all nodes in an AKS cluster (Virtual Machine Scale Sets)

A simple bash scripts that deallocates and starts all virtual machines that are represented as nodes within the cluster.

The script will perform the following actions in detail:

  • cordon node (disable scheduling)
  • drain node (if --force is not specified)
  • deallocate the node in the VMSS
  • start the node in the VMSS
  • (if --restart is specified the node is only restarted)
  • uncordon the node

Usage

Usage: ./node_restart.sh [<options>]

-n|--node <node>                    The name of a node to restart.
                                    By default, a rolling restart of all nodes
                                    is performed.

--resource-group <group-name>       The resource group of the cluster.
                                    Can also be set by RESOURCE_GROUP
                                    Default: <set your default here, to avoid having to specify in the common case>

--cluster-name <cluster-name>       The name of the cluster.
                                    Can also be set by CLUSTER_NAME
                                    Default: <set your default here>

--region <azure-region>             The Azure region in which the cluster is.
                                    Can also be set by REGION
                                    Default: <set your default here>

-f|--force                          Restart node(s) without first draining.
                                    Useful if draining a node fails.

-d|--dry-run                        Just print what to do; don't actually do it


-r|--restart                        Only restart (instead of deallocate/start)

-h|--help                           Print usage and exit.

Known Issues

Due to a known bug, the ProviderID may not be set on the node within the AKS Cluster. Since this is used by this script to determine the VMSS and the instance_id, nodes not having the ProviderID will be skipped and a warning is issued.

Thanks

Heavily based on this script .

aks_node_restart's People

Contributors

dbaur avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.