Skip to end of banner
Go to start of banner

Manage do_not_scale_down Kubernetes tag

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

This Jenkins job allows you to manage Kubernetes tags, specifically the "do_not_scale_down" label, in a project.

The job provides functionality to get tags, add a tag, and delete a tag from a specified Kubernetes namespace.

Main purpose

The main purpose of this job is to control the shutdown behavior of the namespace based on the presence of the "do_not_scale_down" tag. When the "do_not_scale_down" tag is assigned to a namespace, it prevents the namespace from being shut down during nights and weekends.

Additionally, the tag will be automatically removed on Mondays.

Job Parameters

The job requires the following parameters to be provided when running:

  1. action: Choose the action to be performed with the "do_not_scale_down" label. Valid choices are "get", "add", and "delete".
  2. clusterName: Select the target cluster where the Kubernetes namespace is located.
  3. projectName: Select the target project where the Kubernetes namespace is located.

Actions

  1. Get: Retrieves the tags from the specified Kubernetes namespace and displays them. If the "do_not_scale_down" tag exists, it will be added to the job description for reference.   

  2. Add: Adds the "do_not_scale_down" tag to the specified Kubernetes namespace.

  3. Delete: Removes the "do_not_scale_down" tag from the specified Kubernetes namespace.

Usage

  1. Select the Jenkins job and click on "Build with Parameters" to provide the required input.

  2. Choose the desired action from the available options: "get", "add", or "delete".

  3. Select the target cluster by choosing the appropriate option from the "clusterName" parameter dropdown.

  4. Select the target project by choosing the appropriate option from the "projectName" parameter dropdown.

  5. Click on "Build" to execute the job with the provided parameters

Examples

  1. Get action:

    • action: get
    • clusterName: dev
    • projectName: unam

    This will retrieve the tags from the Kubernetes namespace in the "unam" project of the "dev" cluster. If the "do_not_scale_down" tag exists, it will be displayed in the job description.

  2. Add action:

    • action: add
    • clusterName: dev
    • projectName: unam

    This will add the "do_not_scale_down" tag to the Kubernetes namespace in the "unam" project of the "dev" cluster.

  3. Delete action:

    • action: delete
    • clusterName: dev
    • projectName: unam

    This will remove the "do_not_scale_down" tag from the Kubernetes namespace in the "unam" project of the "dev" cluster.


  • No labels