kubernetes operator to auto label/taint/annotate node based on a CRD.
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.
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.
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
node-labeler-operator is using a CRD for its configuration. Here is a description of an object:
apiVersion: labeler.barpilot.io/v1alpha1kind: Labelermetadata:
name: examplelabels:
operator: node-labeler-operatorspec:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostnameoperator: Invalues:
- minikube
- key: beta.kubernetes.io/osoperator: Invalues:
- linux
- matchExpressions:
- key: another-node-label-keyoperator: Existsmerge:
labels:
minikube: "true"annotations:
node-labeler-operator: workstaints:
- key: dedicatedvalue: fooeffect: PreferNoSchedulefor more information about nodeSelectorTerms have a look at: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
- VM on private cloud provider.
Nodes are removed on shutdown and so lose theirs attributes.
- Node selection
- Adding attributes
- Labels
- Annotations
- Taints
- Removing attributes
- Overwrite attributes