/oc-plugin-machine-resize

OpenShift plugin to Resize Machines

Primary LanguageShellApache License 2.0Apache-2.0

OpenShift plugin to Resize Machines

oc plugin to resize a Machine on OpenShift cluster.

!!! tldr "Important Note" - All steps described here will follow the safety way to resize a Machine in OCP 4.x. - This is not a official documentation and this plugin was tested on version 4.9

Install

Download the script:

curl -s https://github.com/mtulio/oc-plugin-machine-resize/blob/master/oc-machine_resize \
    -o /usr/local/bin/oc-machine_resize

Grant permissions to run:

chmod u+x /usr/local/bin/oc-machine_resize

Test it:

oc machine-resize -h

Commands

help

--help

list machines

--list-machines | -l

resize machine

--machine-name <machine_to_resize> --size <new_machine_size> [--force|--continue]

Extra args:

  • --force : force to skip healthy checks. Eg if node holds a etcd leader pod
  • --continue : continue to stop from broken script. Eg when node was already cordoned/stopped, and not resize from cloud provider. It will skip the initial sanity checks (Eg: Ready node)

Usage

  • list current machines
oc machine-resize -l
  • resize a nachine
oc machine-resize -N mrb-gptgl-master-1 -s m5.xlarge
  • resize a nachine that holds the etcd leader pod
oc machine-resize -N mrb-gptgl-master-0 -s m5.xlarge --force

Cast: resizing master node that host the etcd leader pod

asciicast

Cast: resizing the node on Azure

asciicast

ToDo Next

  • support new platforms: Azure
  • increase the final healthy checks:
    • check if COs are not degraded
    • check apiserver, etcd pods
    • check etcd cluster: health ndoes, leaders, etc
    • firing alarms?