Skip to content

ronakforgit/castai_node_rotator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAST AI Node Rotation Script

This project contains a Python script to rotate CAST AI managed nodes in a Kubernetes cluster. The script is responsible for cordoning, draining, and deleting nodes. It includes safeguards to ensure services are not disrupted, particularly when all replicas of a controller are on a single node.

Features

(Current)

  • Cordon nodes to prevent new pods from being scheduled.
  • Check if all replicas of any controller reside on a single node.
  • Evict one replica to another node if necessary, ensuring it becomes healthy and serves traffic.
  • Drain nodes by safely evicting all remaining pods.

(Next):

  • Log movements in Kubernetes events.
  • Package the script using Docker and deploy as a Kubernetes CronJob.
  • Create e2e tests to ensure the script works as expected.

Getting Started

Prerequisites

  • Python 3.9 or higher
  • Docker
  • Kubernetes cluster
  • kubectl configured to interact with your Kubernetes cluster

Installation

  1. Clone the Repository:

    git clone https://github.com/your-organization/your-repo.git
    cd your-repo
  2. Set Up a Virtual Environment:

python3 -m venv venv
source venv/bin/activate
  1. Install Dependencies:
pip install -r requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.0%
  • Smarty 9.7%
  • Dockerfile 4.8%
  • Makefile 2.7%
  • Shell 1.8%