nkml

command module
v0.0.0-...-7e1521f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 25 Imported by: 0

README

nkml

Node Kernel Module Labeler - label Kubernetes nodes according to their kernel modules.

ci Docker Pulls

Usage

Apply the example configuration

kubectl apply -f https://raw.githubusercontent.com/leonnicolas/nkml/main/example.yaml

to label nodes with regard to the WireGuard kernel module.

Configure the Labeler
Usage of ./nkml:
      --hostname string         Hostname of the node on which this process is running
      --kubeconfig string       path to kubeconfig
  -m, --label-mod strings       list of strings, kernel modules matching a string will be used as labels with values true, if found
      --label-prefix string     prefix for labels (default "nkml.squat.ai")
      --listen-address string   listen address for prometheus metrics server (default ":8080")
      --log-level string        Log level to use. Possible values: all, debug, info, warn, error, none (default "info")
      --no-clean-up             Will not attempt to clean labels before shutting down
      --update-time duration    renewal time for labels in seconds (default 10s)

Note: to check kernel modules, nkml needs access to the file /proc/modules.

Label Kernel Modules

You can label your nodes according to their kernel modules. Use the --label-mod flag to pass a list of strings. If a kernel module found in /proc/modules matches one of the input strings, then the node will be given a label of the format:

<label prefix>/<module name>=true	

for example:

nkml.squat.ai/wireguard=true	

If the module is not found, the flag's value will be set to false.

Outside the cluster
docker run --rm -v ~/.kube:/mnt leonnicolas/nkml --kubeconfig /mnt/k3s.yaml --label-mod="wireguard,fantasy" --hostname example_host

Images

Images can be found on Docker Hub leonnicolas/nkml and GitHub Container Registry ghcr.io/leonnicolas/nkml.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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