Code Monkey home page Code Monkey logo

kindscaler's Introduction

KindScaler: Node Management for KinD Clusters

KinD is a solution that allows to quickly create local Kubernetes clusters, ideal for development or testing tasks. However, once these clusters are created, KinD does not have built-in features to modify the cluster configuration by adding or removing nodes, whether they are control-planes or workers, and the entire cluster would need to be regenerated from scratch.

KindScaler comes to facilitate this task. After dissecting how KinD creates and adds different nodes and roles to the cluster, this bash script has been created and allows to add both workers and control planes.

How-to

./kindscaler.sh <clustername> -r <control-plane|worker> -c <count>

For example, adding 3 workers to cluster kind:

$kind create cluster --config cluster.yaml
Creating cluster "kind" ...
 โœ“ Ensuring node image (kindest/node:v1.28.0) ๐Ÿ–ผ
 โœ“ Preparing nodes ๐Ÿ“ฆ ๐Ÿ“ฆ ๐Ÿ“ฆ  
 โœ“ Writing configuration ๐Ÿ“œ 
 โœ“ Starting control-plane ๐Ÿ•น 
 โœ“ Installing CNI ๐Ÿ”Œ 
 โœ“ Installing StorageClass ๐Ÿ’พ 
 โœ“ Joining worker nodes ๐Ÿšœ 
Set kubectl context to "kind-kind"                                                                                                                          
You can now use your cluster with:                                                                                                                          
                                                                                                                                                            
kubectl cluster-info --context kind-kind                                                                                                                    
                                                                                                                                                            
Not sure what to do next? ๐Ÿ˜…  Check out https://kind.sigs.k8s.io/docs/user/quick-start/                                                                     
                                                                                                                                                            
$kubectl get nodes                                                                                                   
NAME                 STATUS   ROLES           AGE   VERSION
kind-control-plane   Ready    control-plane   34s   v1.28.0
kind-worker          Ready    <none>          13s   v1.28.0
kind-worker2         Ready    <none>          8s    v1.28.0
                                                                                                                                                            
$./kindscaler.sh kind -r worker -c 3
Adding kind-worker3 node to kind cluster... Done!
Adding kind-worker4 node to kind cluster... Done!
Adding kind-worker5 node to kind cluster... Done!
                                                                                                                                                            
$kubectl get nodes
NAME                 STATUS   ROLES           AGE    VERSION
kind-control-plane   Ready    control-plane   109s   v1.28.0
kind-worker          Ready    <none>          88s    v1.28.0
kind-worker2         Ready    <none>          83s    v1.28.0
kind-worker3         Ready    <none>          49s    v1.28.0
kind-worker4         Ready    <none>          36s    v1.28.0
kind-worker5         Ready    <none>          7s     v1.28.0

Deleting nodes

kubectl delete node <nodename>
docker stop <container>
docker container rm <container>

kindscaler's People

Contributors

lobuhi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

trozet

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.