From a27476580df2b7b8d178418f85109b01c26e228e Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Fri, 18 Jun 2021 10:32:30 -0500 Subject: [PATCH] Allow labelling of BMHs SIP cluster scheduling relies ultimately on labels on the underlying BareMetalHosts for rack and server name. This change allows operators to optionally add labels to BMHs that are generated by the hostgenerator-m3 function, and gives an example of how to use it. Change-Id: Icc35ef81fc3a9fc6e6e89dc7ba58a385469cdf68 --- manifests/function/hostgenerator-m3/hosttemplate.yaml | 3 +++ manifests/site/test-site/target/catalogues/hosts.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/manifests/function/hostgenerator-m3/hosttemplate.yaml b/manifests/function/hostgenerator-m3/hosttemplate.yaml index 3fb9bba98..9e66aba42 100644 --- a/manifests/function/hostgenerator-m3/hosttemplate.yaml +++ b/manifests/function/hostgenerator-m3/hosttemplate.yaml @@ -47,7 +47,10 @@ template: | kind: BareMetalHost metadata: annotations: + {{- if $host.labels }} labels: + {{ toYaml $host.labels | indent 4 }} + {{- end }} name: {{ $hostName }} spec: online: false diff --git a/manifests/site/test-site/target/catalogues/hosts.yaml b/manifests/site/test-site/target/catalogues/hosts.yaml index e4257c850..dea0abea0 100644 --- a/manifests/site/test-site/target/catalogues/hosts.yaml +++ b/manifests/site/test-site/target/catalogues/hosts.yaml @@ -23,6 +23,8 @@ hosts: oam: 52:54:00:9b:27:4c pxe: 52:54:00:b6:ed:31 hardwareProfile: default # defined in the hostgenerator-m3 function + labels: # optional + airshipit.org/example-label: "label-bmh-like-this" node02: bootMode: legacy macAddress: 52:54:00:b6:ed:02