This is K8s node controller which watches a list of nodes and if new node with specific OS is added (customizable via TARGET_OS
) it gets labelled with customizable label (LABEL_KEY
) with value (LABEL_VALUE
)
manifest.yaml
contains definitions for ServiceAccount, ClusterRole, ClusterRoleBinding and Deployment of controller.
To create all those in your cluster, run kubectl apply -f manifest.yaml
To test node package, run make test
.
To build it locally use make build
. Binary will be placed in current-directory/bin/node-controller
.
To build docker image locally use make container
. Container will be tagged node-controller:latest
However, in manifest.yaml
deployment expects hidalgopl/node-controller:latest
image. Retag it, push it to docker hub and edit deployment.Image if you want to use it in your cluster.
Env name | Description | default |
---|---|---|
TARGET_OS | Tells controller for which OSImage should watch | Container Linux |
LABEL_KEY | Tells controller which label it should set | kubermatic.io/uses-container-linux |
LABEL_VALUE | Tells controller what value should be set for label | true |
Big part is shameless copy of go-client example workqueue.