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 c5d0b10..24e3ae7 100644 --- a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml @@ -13,6 +13,9 @@ template: {{- with .Values.machineSSHKeyName }} sshKeyName: {{ . }} {{- end }} + {{- if or .Values.controlPlane.machineConfigDrive .Values.controlPlane.additionalBlockDevices }} + configDrive: true + {{- end }} {{- if .Values.controlPlane.machineRootVolume.diskSize }} rootVolume: {{ toYaml .Values.controlPlane.machineRootVolume | nindent 6 }} {{- end }} @@ -27,6 +30,24 @@ template: {{- else }} {{- fail "Either controlPlane.machineImageId, controlPlane.machineImage, machineImage or machineImageId is required" }} {{- end }} + {{- with .Values.controlPlane.additionalBlockDevices }} + additionalBlockDevices: + {{- range $name, $blockDevice := . }} + - name: {{ $name }} + sizeGiB: {{ required "size is required for a block device" $blockDevice.size }} + storage: + type: {{ default "Volume" $blockDevice.type }} + {{- if or $blockDevice.volumeType $blockDevice.availabilityZone }} + volume: + {{- with $blockDevice.volumeType }} + type: {{ . }} + {{- end }} + {{- with $blockDevice.availabilityZone }} + availabilityZone: {{ . }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} {{- with .Values.controlPlane.machineNetworking.ports }} ports: {{ toYaml . | nindent 6 }} {{- end }} 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 d18080d..ae191bb 100644 --- a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml @@ -15,6 +15,9 @@ template: {{- with $ctx.Values.machineSSHKeyName }} sshKeyName: {{ . }} {{- end }} + {{- if or $nodeGroup.machineConfigDrive $nodeGroup.additionalBlockDevices }} + configDrive: true + {{- end }} {{- if $nodeGroup.machineRootVolume.diskSize }} rootVolume: {{ toYaml $nodeGroup.machineRootVolume | nindent 6 }} {{- end }} @@ -29,6 +32,24 @@ template: {{- else }} {{- fail "Either nodeGroupDefaults.machineImageId, nodeGroupDefaults.machineImage, machineImageId or machineImage is required" }} {{- end }} + {{- with $nodeGroup.additionalBlockDevices }} + additionalBlockDevices: + {{- range $name, $blockDevice := . }} + - name: {{ $name }} + sizeGiB: {{ required "size is required for a block device" $blockDevice.size }} + storage: + type: {{ default "Volume" $blockDevice.type }} + {{- if or $blockDevice.volumeType $blockDevice.availabilityZone }} + volume: + {{- with $blockDevice.volumeType }} + type: {{ . }} + {{- end }} + {{- with $blockDevice.availabilityZone }} + availabilityZone: {{ . }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} {{- with $nodeGroup.machineNetworking.ports }} ports: {{ toYaml . | nindent 6 }} {{- end }} diff --git a/charts/openstack-cluster/values.yaml b/charts/openstack-cluster/values.yaml index 610c471..214c783 100644 --- a/charts/openstack-cluster/values.yaml +++ b/charts/openstack-cluster/values.yaml @@ -175,6 +175,26 @@ controlPlane: # Labels to apply to the node objects in Kubernetes that correspond to control plane machines nodeLabels: # my.company.org/label: value + # Additional block devices for control plane machines + additionalBlockDevices: {} + # # The key is the name for the block device in the context of the machine + # # It is also used to tag the block device, so that the volume can be identified in instance metadata + # etcd: + # # The size of the block device + # size: 20 + # # The type of the block device + # # If set to "Volume", which is the default, then a Cinder volume is used to back the block device + # # If set to "Local", local ephemeral storage is used to back the block device + # # In both cases, the lifecycle of the device is the same as the machine + # type: Volume + # # The volume type to use + # # If not specified, the default volume type is used + # volumeType: + # # The volume availability zone to use + # # If not specified, the machine availability zone is used + # availabilityZone: + # Indicates whether control plane machines should use config drive or not + machineConfigDrive: false # The time to wait for a node to finish draining before it can be removed nodeDrainTimeout: 5m0s # The time to wait for a node to detach all volumes before it can be removed @@ -283,6 +303,11 @@ nodeGroupDefaults: # By default, nodes get the label "capi.stackhpc.com/node-group=" nodeLabels: # my.company.org/label: value + # Additional block devices for node groups machines + # Options are the same as for controlPlane.additionalBlockDevices above + additionalBlockDevices: {} + # Indicates whether control plane machines should use config drive or not + machineConfigDrive: false # The time to wait for a node to finish draining before it can be removed nodeDrainTimeout: 5m0s # The time to wait for a node to detach all volumes before it can be removed