Skip to content

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

akslifecycle


License: GPL v3

This repository provides a command-line interface (CLI) to manage scheduled start/stop lifecycle operations for Azure Kubernetes Service (AKS) node pools.\n\n> **Status: maintenance.** Kept public as an existing Omnivya engineering project; it is not currently promoted as a flagship repository.

Getting Started

To get started with this CLI tool, you need to have the following prerequisites:

  • Azure CLI: You need to have the Azure CLI installed and configured on your machine. You can check your Azure CLI version by running az --version in your terminal. If you need to install or upgrade, refer to the Azure CLI installation guide.
  • Go: This project is written in Go, so you need to have Go installed on your machine. You can download Go from the official Go website.
  • You need to export these env variables:
    • AZURE_SUBSCRIPTION_ID: This is the ID of your Azure subscription.
    • AZURE_CLIENT_ID: This is the ID of your Azure Active Directory (AD) app registration.
    • AZURE_TENANT_ID: This is the ID of your Azure AD tenant.
    • AZURE_CLIENT_SECRET: This is the secret of your Azure AD app registration.

Installation

Build from source

git clone https://github.com/Simplifi-ED/akslifecycle.git
cd akslifecycle
go build

Using Docker image

docker run -d \
-e AZURE_SUBSCRIPTION_ID=<your-subscription-id> \
-e AZURE_CLIENT_ID=<your-client-id> \
-e AZURE_TENANT_ID=<your-tenant-id> \
-e AZURE_CLIENT_SECRET=<your-client-secret> \
-v ./config.yml:/app/config.yml \
--name akslifecycle \
ghcr.io/simplifi-ed/akslifecycle:0.0.2 \
-c config.yml

or using a docker compose:

version: '3.8'
services:
  akslifecycle:
    image: ghcr.io/simplifi-ed/akslifecycle:0.0.2  
    volumes:
      - ./config.yml:/app/config.yml
    environment:
    - AZURE_SUBSCRIPTION_ID=<your-subscription-id>
    - AZURE_CLIENT_ID=<your-client-id>
    - AZURE_TENANT_ID=<your-tenant-id>
    - AZURE_CLIENT_SECRET=<your-client-secret>
    command: ["/app/akslifecycle", "-c", "config.yml"]

Usage

Before using the CLI tool, you need to define your node pools and the schedule for starting and stopping them in the config.yml file. Here is an example of what the config.yml file might look like:

resources:
- ResourceGroupName: rg-1
  ClusterName: cluster-1
  NodePools:
  - nodepool1
  startSchedule: "0 8 * * 1-5"
  stopSchedule: "0 18 * * 1-5"
- ResourceGroupName: rg-2
  ClusterName: cluster-2
  NodePools:
  - nodepool2
  startSchedule: "0 9 * * 1-5"
  stopSchedule: "0 19 * * 1-5"

In this example, nodepool1 is scheduled to start at 8:00 and stop at 18:00, while nodepool2 is scheduled to start at 9:00 and stop at 19:00. The schedules are defined in cron format.

To start the CLI tool, run the akslifecycle executable:

./akslifecycle

This will start the CLI tool, which will then start and stop the node pools according to the schedule defined in the config.yml file.

License

This project is licensed under the GNU General Public License v3.0. See LICENSE.

Show your support

Leave a ⭐ if you like this project


About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages