# Expand and Shrink Cluster
Expanding a Kubernetes cluster adds more resources and High Availability to your cluster for example expanding from 1 K8s master host to 3 k8s masters hosts adds High Availability protection to the Kubernetes cluster. Shrinking a Kubernetes cluster is also preferred when an existing cluster resource are needed for use elsewhere to manage effective usage of on-demand resources.
In HPE Ezmeral Runtime Enterprise 5.6.x you expand and shrink your Internal Kubernetes Clusters and not the imported clusters that are managed by the platform. In the RA we an automated approach to expand or shrink your exiting Kubernetes cluster. The high-level flow of the automated process is as follows:
Below Figure shows the high-level flow of the Cluster Modification Functionality.
# Pre-Requisites
Refer to Installer Machine section to set up the required python and ansible environment.
Python module 'requests'.
The hosts to be added or removed from the cluster must be in the available list of HOSTS.
An existing compute clusters.
# Procedure
- Enter the console username and password in the config_secrets.json file
> ansible-vault edit config_secrets.json
- Enter the config details in the user_input.json file
> vi user_input.json
- Run the python script expand_shrink.py
> python expand_shrink.py