Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Publish 'fieldbus' host taints to the ConfigDB (#15)
Browse files Browse the repository at this point in the history
Define the taint `factoryplus.app.amrc.co.uk/fieldbus` to indicate 'this
host has special/limited hardware and should not be used for running
general floating workloads'. The value associated with the taint should
be a string identifying the reason for the taint being applied (these
are a matter of local policy).

If a host has such a taint, publish it to the ConfigDB. This will allow
the Manager to help users select appropriate hosts to deploy Edge Agents
to.
  • Loading branch information
amrc-benmorrow authored Feb 5, 2024
2 parents d7230e4 + 59ed383 commit c2ca45a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import { Edge } from "./uuids.js";
const debug = new Debug();

const LABELS = {
host: "kubernetes.io/hostname",
control: "node-role.kubernetes.io/control-plane",
host: "kubernetes.io/hostname",
control: "node-role.kubernetes.io/control-plane",
specialised: "factoryplus.app.amrc.co.uk/specialised",
};

export class Nodes {
Expand Down Expand Up @@ -47,11 +48,16 @@ export class Nodes {
value: obj => {
const meta = obj.metadata;
const info = obj.status.nodeInfo;
const specialised = obj.spec.taints
?.filter(t => t.key == LABELS.specialised)
?.map(t => t.value)
?.[0];
return {
hostname: meta.labels[LABELS.host],
arch: info.architecture,
k8s_version: info.kubeletVersion,
control_plane: meta.labels[LABELS.control] == "true",
specialised,
};
},
equal: deep_equal,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "acs-edge-sync",
"version": "0.0.2",
"version": "0.0.3",
"description": "",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit c2ca45a

Please sign in to comment.