diff --git a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml index 13cdf59a..246832a8 100644 --- a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml @@ -78,6 +78,13 @@ template: serverGroup: id: {{ . }} {{- end }} + {{- with mergeOverwrite .Values.machineMetadata .Values.controlPlane.machineMetadata }} + serverMetadata: + {{- range $k, $v := . }} + - key: {{ quote $k }} + value: {{ quote $v }} + {{- end }} + {{- end }} {{- end }} {{- define "openstack-cluster.controlplane.mt.checksum" -}} diff --git a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml index f505d8fe..5e2d3a4f 100644 --- a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml @@ -74,6 +74,13 @@ template: serverGroup: id: {{ . }} {{- end }} + {{- with mergeOverwrite $ctx.Values.machineMetadata $nodeGroup.machineMetadata }} + serverMetadata: + {{- range $k, $v := . }} + - key: {{ quote $k }} + value: {{ quote $v }} + {{- end }} + {{- end }} {{- end }} {{- define "openstack-cluster.nodegroup.mt.checksum" -}} diff --git a/charts/openstack-cluster/values.yaml b/charts/openstack-cluster/values.yaml index 087f103c..a2ebabe0 100644 --- a/charts/openstack-cluster/values.yaml +++ b/charts/openstack-cluster/values.yaml @@ -25,6 +25,9 @@ machineImageId: # The name of the SSH key to inject into cluster machines machineSSHKeyName: +# Global metadata items to add to each machine +machineMetadata: {} + # The prefix used for project labels and annotations projectPrefix: capi.stackhpc.com @@ -246,6 +249,8 @@ controlPlane: # The volume availability zone to use # If not specified, the machine availability zone is used # availabilityZone: + # Specific metadata for control plane nodes + machineMetadata: {} # The ID of the server group to use for control plane machines serverGroupId: # Labels to apply to the node objects in Kubernetes that correspond to control plane machines @@ -380,6 +385,9 @@ nodeGroupDefaults: # The volume availability zone to use # If not specified, the machine availability zone is used # availabilityZone: + # Specific metadata for worker nodes + # Can also be specified for each node group + machineMetadata: {} # The ID of the server group to use for machines in the node group serverGroupId: # Labels to apply to the node objects in Kubernetes that correspond to machines in the node group