Add ISCSI Multipath support when enable_iscsi true

When using iscsi in both cinder and nova multipath tooling access is not
currently available. This commit provides the host system access to
configure and control multipath.
This commit has been tested in our own production systems however this
is my first commit into Openstack-Helm so please review carefully and
provide me guidance on what I might be able to do better.

Change-Id: I4f017f67a5d80b9c931e2ee1653062aa503a7fd9
This commit is contained in:
Karl Kloppenborg 2021-04-05 14:39:40 +00:00
parent 34c3cd4adf
commit d2e2d58a5f
12 changed files with 131 additions and 2 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Cinder
name: cinder
version: 0.1.13
version: 0.1.14
home: https://docs.openstack.org/cinder/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png
sources:

View File

@ -0,0 +1,18 @@
#!/bin/bash
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
chroot /mnt/host-rootfs /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" \
multipath "${@:1}"

View File

@ -0,0 +1,18 @@
#!/bin/bash
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
chroot /mnt/host-rootfs /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" \
multipathd "${@:1}"

View File

@ -24,6 +24,10 @@ data:
{{- if .Values.conf.enable_iscsi }}
iscsiadm: |
{{ tuple "bin/_iscsiadm.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
multipath: |
{{ tuple "bin/_multipath.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
multipathd: |
{{ tuple "bin/_multipathd.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.images.local_registry.active }}
image-repo-sync.sh: |

View File

@ -248,6 +248,22 @@ spec:
- name: cinder-bin
mountPath: /usr/local/sbin/iscsiadm
subPath: iscsiadm
- name: cinder-bin
mountPath: /usr/local/sbin/multipath
subPath: multipath
- name: cinder-bin
mountPath: /usr/local/sbin/multipathd
subPath: multipathd
- name: etcmultipath
mountPath: /etc/multipath
{{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }}
mountPropagation: Bidirectional
{{- end }}
- name: sys
mountPath: /sys
{{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }}
mountPropagation: HostToContainer
{{- end }}
{{- end }}
{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.volume.api.internal "path" "/etc/cinder/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
@ -304,6 +320,12 @@ spec:
path: /etc/iscsi
- name: usrlocalsbin
emptyDir: {}
- name: etcmultipath
hostPath:
path: /etc/multipath
- name: sys
hostPath:
path: /sys
{{- end }}
{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}
{{- dict "enabled" .Values.manifests.certificates "name" .Values.secrets.tls.volume.api.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Nova
name: nova
version: 0.1.16
version: 0.1.17
home: https://docs.openstack.org/nova/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
sources:

View File

@ -0,0 +1,18 @@
#!/bin/bash
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
chroot /mnt/host-rootfs /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" \
multipath "${@:1}"

View File

@ -0,0 +1,18 @@
#!/bin/bash
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
chroot /mnt/host-rootfs /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" \
multipathd "${@:1}"

View File

@ -24,6 +24,10 @@ data:
{{- if .Values.conf.enable_iscsi }}
iscsiadm: |
{{ tuple "bin/_iscsiadm.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
multipath: |
{{ tuple "bin/_multipath.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
multipathd: |
{{ tuple "bin/_multipathd.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.images.local_registry.active }}
image-repo-sync.sh: |

View File

@ -384,6 +384,24 @@ spec:
- name: nova-bin
mountPath: /usr/local/sbin/iscsiadm
subPath: iscsiadm
- name: runlock
mountPath: /run/lock
- name: nova-bin
mountPath: /usr/local/sbin/multipath
subPath: multipath
- name: nova-bin
mountPath: /usr/local/sbin/multipathd
subPath: multipathd
- name: etcmultipath
mountPath: /etc/multipath
{{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }}
mountPropagation: Bidirectional
{{- end }}
- name: sysblock
mountPath: /sys/block
{{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }}
mountPropagation: HostToContainer
{{- end }}
{{- end }}
{{- if ( has "tungstenfabric" .Values.network.backend ) }}
- name: tf-plugin-shared
@ -503,6 +521,13 @@ spec:
path: /dev
- name: usrlocalsbin
emptyDir: {}
- name: etcmultipath
hostPath:
path: /etc/multipath
- name: sysblock
hostPath:
path: /sys/block
{{- end }}
{{- if ( has "tungstenfabric" .Values.network.backend ) }}
- name: tf-plugin-shared

View File

@ -14,3 +14,4 @@ cinder:
- 0.1.11 Update RBAC apiVersion from /v1beta1 to /v1
- 0.1.12 Update volume type creation bootstrap logic
- 0.1.13 Add NFS cinder backup override
- 0.1.14 Add Multipathd support for ISCSI backed volumes

View File

@ -17,3 +17,4 @@ nova:
- 0.1.14 BUG for deploying multiple compute nodes
- 0.1.15 Mount /dev/pts in Nova compute container
- 0.1.16 Use first IP address for migration
- 0.1.17 Add multipathd support for ISCSI backed volume VMs