vino/nodelabeler/ds.yaml
Alexander Hughes e72689f456 Add network info node label to ViNO
ViNO will need to be able to "bubble up" information about the
physical hosts and label the nodes appropriately. The target of this
change is to add the VM Bridge Interface IP address as a label.

To accomplish this, this change:
- Adds nodelabeler/main.go containing code based off code from [0]
  this code is responsible for labeling a variable node, with the ip
  address obtained from a variable interface name
- Adds a dockerfile to place the binary created by nodelabeler/main.go
  in a minimal image to be run as a DaemonSet
- Adds a DaemonSet responsible for spawning this container on each
  host. Notably the hostNetwork: true flag is used in order to get
  the correct interface name and IP address.
- Minor changes to go.mod and go.sum as new dependencies are
  introduced by nodelabeler/main.go

[0] https://github.com/vexxhost/node-labeler

Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
Change-Id: Ibdaef6dc08bcfaccbead29eee29787971c2399d0
2021-01-12 23:17:28 +00:00

31 lines
748 B
YAML

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: vino-labeler
namespace: kube-system
spec:
selector:
matchLabels:
name: vino-labeler
template:
metadata:
labels:
name: vino-labeler
spec:
hostNetwork: true
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: labler
image: quay.io/airship/nodelabeler
imagePullPolicy: IfNotPresent
env:
- name: NODE
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: VM_BRIDGE_INTERFACE
value: enp0s3 # hardcoded value, where do we want to obtain this from?
terminationGracePeriodSeconds: 30