akslifecycle

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

README

akslifecycle




This repository provides a command-line interface (CLI) to manage the lifecycle of Azure Kubernetes Service (AKS) node pools. The node pools are defined in a config.yml file. The CLI tool can start and stop these node pools according to a defined schedule, which is also specified in the config.yml file.

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

git clone https://github.com/muandane/akslifecycle.git
cd akslifecycle
go build

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 Apache license

Show your support

Leave a ⭐ if you like this project


Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL