Sign inSign up

barpilot/node-labeler-operator

By barpilot

•Updated over 7 years ago

kubernetes operator to manage node metadata (labels/taints/annotations...) based on other labels

Image
0

2.0K

barpilot/node-labeler-operator repository overview

⁠node-labeler-operator

kubernetes operator to auto label/taint/annotate node based on a CRD.

GitHub release Travis Go Report Card Docker Build Status

NOTE: This is an alpha-status project. We do regular tests on the code and functionality, but we can not assure a production-ready stability.

⁠Requirements

node-labeler-operator is meant to be run on Kubernetes 1.8+. All dependecies have been vendored, so there's no need to any additional download.

⁠Usage

⁠Installation

In order to create node-labeler-operator inside a Kubernetes cluster, the operator has to be deployed. It can be done with a deployment.

kubectl run node-labeler-operator --image=barpilot/node-labeler-operator --namespace=kube-system
⁠Configuration

node-labeler-operator is using a CRD⁠ for its configuration. Here is a description of an object:

apiVersion: labeler.barpilot.io/v1alpha1
kind: Labeler
metadata:
  name: example
  labels:
    operator: node-labeler-operator
spec:
  nodeSelectorTerms:
  - matchExpressions:
    - key: kubernetes.io/hostname
      operator: In
      values:
      - minikube
    - key: beta.kubernetes.io/os
      operator: In
      values:
      - linux
  - matchExpressions:
    - key: another-node-label-key
      operator: Exists
  merge:
    metadata:
      labels:
        mylabel: "true"
      annotations:
        node-labeler-operator: works
    spec:
      taints:
        - key: dedicated
          value: foo
          effect: PreferNoSchedule
    status:
      capacity:
        example.com/dongle: "4"
        example.com/token: "1"

for more information about nodeSelectorTerms have a look at: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/⁠

⁠Cases
  • VM on private cloud provider.
    Nodes are removed on shutdown and so lose theirs attributes.

⁠Features

  • Node selection
  • Adding attributes
    • Labels
    • Annotations
    • Taints
    • Status
  • Removing attributes
  • Overwrite attributes

Tag summary

Content type

Image

Digest

Size

11.4 MB

Last updated

over 8 years ago

docker pull barpilot/node-labeler-operator