Git Product home page Git Product logo

label-nodes's Introduction

Label Nodes

Label Nodes is a tool designed to help users label Kubernetes nodes that are managed by Amazon Elastic Kubernetes Service (EKS). EKS does not allow users to set the kubernetes.io labels for managed node groups. Instead, users can set some other label and use the label-nodes project to set the appropriate *.kubernetes.io/ label.

Issue references:

How it Works

The Label Nodes tool works by using the Kubernetes API to get a list of nodes in the cluster. The tool then updates the selected node's labels to include the node-role.kubernetes.io/ label with the specified category and value using predefined source label

Installation

Local

To install Label Nodes, follow these steps:

  1. Clone the repository:
git clone https://github.com/enver/label-nodes.git
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up your Kubernetes configuration file (if you haven't already):
export KUBECONFIG=<path-to-your-kubeconfig-file>

Customize

To customize the installation set

  • INTERVAL_SECONDS - Interval at which the application runs and scans for new nodes (default 60)
  • SOURCE_LABEL_PREFIX - Source label prefix to be used for reading role (or any other information) (default node-role.kubernetes/)
  • DESTINATION_LABEL_PREFIX - Destination label prefix (default node-role.kubernetes.io/)

Docker

The docker image can be found here

There is a helm chart to help you deploy to the Kubernetes cluster.

Usage

To use Label Nodes, follow these steps:

Run the label-nodes.py script:

python label-nodes.py

Example

Create managed EKS node group and set role label node-role.kubernetes/foo=true. Once label-nodes is deployed it will set node-role.kubernetes.io/foo=true to all running nodes where node-role.kubernetes/foo=true exists. Then kubectl get nodes will show node role

# kubectl get nodes                               โ†“
NAME                                   STATUS   ROLES             AGE     VERSION
ip-1-2-3-4.<region>.compute.internal   Ready    foo                1m     v1.2.3
....

Verify that the label has been applied to the node by running the kubectl describe node command.

Contributing

If you would like to contribute to Label Nodes, please fork the repository and submit a pull request with your changes. Contributions are always welcome!

License

Label Nodes is licensed under the MIT license. See the LICENSE file for more details.

label-nodes's People

Contributors

enver avatar

Watchers

 avatar

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.