見出し画像

CSI Driver for Dell EMC PowerScaleを試す(インストール編)

サービスマネージメントグループの秋元です。
noteでは初めての寄稿となります。主にストレージのサポートとチーム内で利用するシステムの開発を行っています。

以前ブロードバンドタワーの技術ブログでCSI Driver for Dell EMC Isilonについてご紹介させて頂きました。

当時はv1.0.0とリリース直後のご紹介でしたが、その後バージョンアップを重ね現在はv1.6.1(2021年10月現在)がリリースされています。バージョンアップの過程でCSI Driver for Dell EMC IsilonからCSI Driver for Dell EMC PowerScaleへと名称も改められ、ブロードバンドタワーでも検証機を購入しましたので現時点でのインストールの流れやテスト方法についてご紹介したいと思います。

なお、Dell EMC PowerScaleの詳細につきましてはブロードバンドタワーの製品紹介ページがございますので併せてご参照ください。

CSI Driver for Dell EMC PowerScaleとは

CSI Driver for Dell EMC PowerScaleは、Dell EMC PowerScaleストレージアレイを使用した永続的なストレージのプロビジョニングをサポートするCSI(Container Storage Interface)ドライバーです。またDell EMC製品向けのKubernetesでストレージを利用可能にするオープンソース・スイートであるCSM(Container Storage Modules)の一部です。

(※以降CSMドキュメント)

以降のCSI Driver for Dell EMC PowerScaleのインストールについての内容はCSMドキュメントに含まれる下記のページを参照しています。

インストールの必要要件

CSMドキュメントではPowerScale向けのCSI DriverのサポートするOSとコンテナオーケストレーターは下記が挙げられています。

・ Kubernetes 1.20, 1.21, 1.22
・ RHEL 7.x,8.x
・ CentOS 7.8, 7.9

これらの他にもサポートするOSとコンテナオーケストレーターが記載されていますので確認してみてください。

DockerについてはCSMドキュメントのOffline Installerのページに記述が有りましたのでこれに合わせています。

・ docker 19.03+

サポートされるストレージプラットホームは下記となっています。

・ OneFS 8.1, 8.2, 9.0, 9.1, 9.2

今回検証を⾏った環境では仮想マシン3台を⽤意し、CSI Driver for Dell EMC PowerScaleをインストールする為の下準備として、それぞれ下記のバージョンでセットアップを⾏いました。本記事ではKubernetes等のセットアップについては触れませんので、検証環境構築の際には下記のバージョンを参考にしてください。

OS

[root@csips-node1 ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@csips-node1 ~]#

Docker

[root@csips-node1 ~]# docker version
Client: Docker Engine - Community
Version:           19.03.15
API version:       1.40
Go version:        go1.13.15
Git commit:        99e3ed8919
Built:             Sat Jan 30 03:17:57 2021
OS/Arch:           linux/amd64
Experimental:      false
Server: Docker Engine - Community
Engine:
 Version:          19.03.15
 API version:      1.40 (minimum version 1.12)
 Go version:       go1.13.15
 Git commit:       99e3ed8919
 Built:            Sat Jan 30 03:16:33 2021
 OS/Arch:          linux/amd64
 Experimental:     false
containerd:
 Version:          1.4.11
 GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
 Version:          1.0.2
 GitCommit:        v1.0.2-0-g52b36a2
docker-init:
 Version:          0.18.0
 GitCommit:        fec3683
[root@csips-node1 ~]#

Kubernetes

[root@csips-node1 ~]# yum list installed | grep kube
cri-tools.x86_64                     1.13.0-0                       @kubernetes
kubeadm.x86_64                       1.22.2-0                       @kubernetes
kubectl.x86_64                       1.22.2-0                       @kubernetes
kubelet.x86_64                       1.22.2-0                       @kubernetes
kubernetes-cni.x86_64                0.8.7-0                        @kubernetes
[root@csips-node1 ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:38:50Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:32:41Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
[root@csips-node1 ~]#

PowerScale OneFS

A200-1# cat /etc/motd
PowerScale OneFS 9.1.0.10
A200-1# uname -r
9.1.0.10
A200-3#

インストールの前提条件

CSMドキュメントでは前提条件として下記の記述があります。

・ Install Kubernetes or OpenShift
・ Install Helm 3
・ Mount propagation is enabled on container runtime that is being used
・ If using Snapshot feature, satisfy all Volume Snapshot requirements

Install Kubernetes or OpenShift

Kubernetesについてはインストールが終わっているものとします。検証環境では下記のようになっていま す。

[root@csips-node1 ~]# kubectl get node
NAME          STATUS   ROLES                  AGE    VERSION
csips-node1   Ready    control-plane,master   5d2h   v1.22.2
csips-node2   Ready    <none>                 5d2h   v1.22.2
csips-node3   Ready    <none>                 5d2h   v1.22.2
[root@csips-node1 ~]# kubectl describe node | grep -A1 Internal
 InternalIP:  172.16.26.24
 Hostname:    csips-node1
--
 InternalIP:  172.16.26.25
 Hostname:    csips-node2
--
 InternalIP:  172.16.26.26
 Hostname:    csips-node3
[root@csips-node1 ~]#

Install Helm 3

手順通りに進めます。

 [root@csips-node1 ~]# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
..snip..
[root@csips-node1 ~]# helm version
version.BuildInfo{Version:"v3.7.1", GitCommit:"1d11fcb5d3f3bf00dbe6fe31b8412839a96b3dc4", GitTreeState:"clean", GoVersion:"go1.16.9"}
[root@csips-node1 ~]#

Mount propagation is enabled on container runtime that is being used

ここに関しては特に記述がありませんがDockerはsystemdでデーモンを管理している為systemdがマウント情報を伝播してくれる必要があります。以前ご紹介した手順ではsystemdのunitファイルに明示的にMountFlagsを追加しています。

[root@node1 ~]# for i in 172.16.26.{24..26};do ssh $i \
"sed -i '/\[Service\]/ aMountFlags=shared' /etc/systemd/system/multiuser.target.wants/docker.service";done

CentOS 7.9ではsystemdのMountFlagsのdefault値はsharedの為、今回はunitファイルへの設定は無しで進めます。systemdのMountFlagsについての情報についてはman systemd.execに情報があるので引用しておきます。

       MountFlags=
          Takes a mount propagation flag: shared, slave or private, which control whether mounts in the file
          system namespace set up for this unit's processes will receive or propagate mounts or unmounts. See
          mount(2) for details. Defaults to shared. Use shared to ensure that mounts and unmounts are
          propagated from the host to the container and vice versa. Use slave to run processes so that none of
          their mounts and unmounts will propagate to the host. Use private to also ensure that no mounts and
          unmounts from the host will propagate into the unit processes' namespace. Note that slave means that
          file systems mounted on the host might stay mounted continuously in the unit's namespace, and thus
          keep the device busy. Note that the file system namespace related options (PrivateTmp=,
          PrivateDevices=, ProtectSystem=, ProtectHome=, ReadOnlyDirectories=, InaccessibleDirectories= and
          ReadWriteDirectories=) require that mount and unmount propagation from the unit's file system
          namespace is disabled, and hence downgrade shared to slave.

If using Snapshot feature, satisfy all Volume Snapshot requirements

gitレポジトリにあるvalues.yamlではsnapshot機能が有効にされている状態です。手順通り進めます。

(Optional) Volume Snapshot Requirements
Installation example

[root@csips-node1 ~]# git clone https://github.com/kubernetes-csi/external-snapshotter/
..snip..
[root@csips-node1 ~]# cd ./external-snapshotter
[root@csips-node1 external-snapshotter]# kubectl create -f client/config/crd
customresourcedefinition.apiextensions.k8s.io/volumesnapshotclasses.snapshot.storage.k8s.io created
customresourcedefinition.apiextensions.k8s.io/volumesnapshotcontents.snapshot.storage.k8s.io created
customresourcedefinition.apiextensions.k8s.io/volumesnapshots.snapshot.storage.k8s.io created
[root@csips-node1 external-snapshotter]# kubectl create -f deploy/kubernetes/snapshot-controller
serviceaccount/snapshot-controller created
clusterrole.rbac.authorization.k8s.io/snapshot-controller-runner created
clusterrolebinding.rbac.authorization.k8s.io/snapshot-controller-role created
role.rbac.authorization.k8s.io/snapshot-controller-leaderelection created
rolebinding.rbac.authorization.k8s.io/snapshot-controller-leaderelection created
deployment.apps/snapshot-controller created
[root@csips-node1 external-snapshotter]#

手順ではgit checkoutしていますがmasterブランチしかない為飛ばしています。

Install the Driver

CSI Driverインストールしてテストを行う際の最終的な構成イメージはこのような感じになります。

画像1

イメージ内の略語は下記となります。

・ sts: StatefulSet
・ pvc: PersistentVolumeClaim
・ pv: PersistentVolume
・ sc: StorageClass
・ vsc: VolumeSnapshotClass
・ crd: CustomResourceDefinition

手順通りにインストールを進めます。

Step 1.

レポジトリをgit cloneします。

[root@csips-node1 external-snapshotter]# cd
[root@csips-node1 ~]#git clone https://github.com/dell/csi-powerscale.git
[root@csips-node1 ~]# cd csi-powerscale
[root@csips-node1 csi-powerscale]#

Step 2.

namespaceを作成します。CSMドキュメントではisilonとしていますが、今回はpowerscaleとして進めます。

[root@csips-node1 csi-powerscale]# kubectl create namespace powerscale
namespace/powerscale created
[root@csips-node1 csi-powerscale]#

Step 3.

接続するPowerScaleについての情報を収集します。下記のものが挙げられています。

・IP address
・IsiPath
・username
・password

これらのパラメーターは後述するsecret.yamlに記述します。

Step 4.

環境に合わせて設定を変更する為helm/csi-isilon/values.yamlをコピーします。今回はwork/my-powerscale-settings.yamlとしてコピーしています。

[root@csips-node1 csi-powerscale]# mkdir work
[root@csips-node1 csi-powerscale]# cp helm/csi-isilon/values.yaml work/my-powerscale-settings.yaml

Step 5.

my-powerscale-settings.yamlを環境に合わせて変更します。今回は変更箇所は無い為そのまま利用します。変更可能なパラメーターはCSMドキュメントに記載されているので確認してください。

Step 6.

secret.yamlを設定します。今回はwork/secret.yamlにコピーしています。

[root@csips-node1 csi-powerscale]# cp samples/secret/secret.yaml work/secret.yaml
[root@csips-node1 csi-powerscale]# sed -i '/cluster2/,$d' work/secret.yaml
[root@csips-node1 csi-powerscale]# sed -ri 's/clusterName: .+$/clusterName: "A200"/' work/secret.yaml
[root@csips-node1 csi-powerscale]# sed -ri 's/username: .+$/username: "root"/' work/secret.yaml
[root@csips-node1 csi-powerscale]# sed -ri 's/password: .+$/password: "********"/' work/secret.yaml
[root@csips-node1 csi-powerscale]# sed -ri 's/endpoint: .+$/endpoint: "172.16.27.149"/' work/secret.yaml
[root@csips-node1 csi-powerscale]# 

CSI Driver for Dell EMC PowerScale v1.6.1は複数のPowerScaleクラスタに対応している為、サンプルのsecret.yamlは複数クラスタの設定が入っています。今回は1つのクラスタのみ使用する為2つ目の設定は削除しています。

Secretを登録します。

[root@csips-node1 csi-powerscale]# kubectl create secret generic isilon-creds -n powerscale \
> --from-file=config=work/secret.yaml -o yaml --dry-run=client | kubectl apply -f -
secret/isilon-creds created
[root@csips-node1 csi-powerscale]#

namespaceとsecretファイルのパスを変更しています。登録するSecretの名前を変更するとCSI Driverのインストールでエラーとなった為CSMドキュメントにあるisilon-credsのままとしています。

Step 7.

OneFS APIサーバの証明書を検証する場合はOneFS CA証明書をインストールします。今回は検証の為空のSecretを作成します。work/empty-secret.yamlにコピーして、namespaceを調整しています。

[root@csips-node1 csi-powerscale]# cp samples/secret/empty-secret.yaml work/empty-secret.yaml
[root@csips-node1 csi-powerscale]# sed -ri 's/namespace: isilon/namespace: powerscale/' work/empty-secret.yaml
[root@csips-node1 csi-powerscale]# kubectl create -f work/empty-secret.yaml
secret/isilon-certs-0 created
[root@csips-node1 csi-powerscale]#

事前作業

Step 8.のCSI Driverのインストールの前に下記の設定を行います。

PowerScale上にIsiPathのディレクトリを作成

A200-1# mkdir /ifs/data/csi
A200-1# ls -l /ifs/data | grep csi
drwxr-xr-x     2 root    wheel          0 Oct 14 16:19 csi

NFS service, SnapshotIQ, SmartQuotasの有効化

SnapshotIQおよびSmartQuotasをご利用の場合は別途ライセンス費用が必要となります。詳細についてはブロードバンドタワーまでご連絡ください。

Kubernetes/corednsへのhostsの追加

今回の検証環境は各hostのhostnameが名前解決できる環境ではありません。この様な環境ではCSI Driverのインストールでisilon-nodeのステータスがCrashBackOffとなりエラーが発生しisilon-nodeは正常に起動することができません。この為、Kubernetsの内部で利用されるDNSであるcorednsにhostsとして登録することで名前解決しています。

[root@csips-node1 csi-powerscale]# kubectl get cm -n kube-system coredns -o yaml > work/coredns.yaml
[root@csips-node1 csi-powerscale]# sed -i '/resourceVersion/d' work/coredns.yaml
[root@csips-node1 csi-powerscale]# vim work/coredns.yaml

下記のように編集してhostsを登録します。

apiVersion: v1
data:
 Corefile: |
   .:53 {
       errors
       health {
          lameduck 5s
       }
       hosts {
          172.16.26.24 csips-node1
          172.16.26.25 csips-node2
          172.16.26.26 csips-node3
       }
       ready
       kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
          ttl 30
       }
       prometheus :9153
       forward . /etc/resolv.conf {
          max_concurrent 1000
       }
       cache 30
       loop
       reload
       loadbalance
   }
kind: ConfigMap
metadata:
 creationTimestamp: "2021-10-20T00:40:39Z"
 name: coredns
 namespace: kube-system
 uid: 47b2e9c9-3e0d-4283-b6be-a424782f36d8

corednsに設定を反映させます。

[root@csips-node1 csi-powerscale]# kubectl apply -f work/coredns.yaml
Warning: resource configmaps/coredns is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
configmap/coredns configured
[root@csips-node1 csi-powerscale]#

上記のWarningのメッセージについてはlast-applied-configurationが自動で補完される為無視できます。

Step 8.

CSI Driverをインストールします。namespaceと設定ファイルを調整しています。

[root@csips-node1 csi-powerscale]# cd dell-csi-helm-installer && \
> ./csi-install.sh --namespace powerscale --values ../work/my-powerscale-settings.yaml
------------------------------------------------------
> Installing CSI Driver: csi-isilon on 1.22
------------------------------------------------------
------------------------------------------------------
> Checking to see if CSI Driver is already installed
------------------------------------------------------
------------------------------------------------------
> Verifying Kubernetes and driver configuration
------------------------------------------------------
|- Kubernetes Version: 1.22
|
|- Driver: csi-isilon
|
|- Verifying Kubernetes version
 |
 |--> Verifying minimum Kubernetes version                         Success
 |
 |--> Verifying maximum Kubernetes version                         Success
|
|- Verifying that required namespaces have been created             Success
|
|- Verifying that required secrets have been created                Success
|
|- Verifying that optional secrets have been created                Success
|
|- Verifying alpha snapshot resources
 |
 |--> Verifying that alpha snapshot CRDs are not installed         Success
|
|- Verifying snapshot support
 |
 |--> Verifying that snapshot CRDs are available                   Success
 |
 |--> Verifying that the snapshot controller is available          Success
|
|- Verifying helm version                                           Success
|
|- Verifying helm values version                                    Success

------------------------------------------------------
> Verification Complete - Success
------------------------------------------------------
|
|- Installing Driver                                                Success
 |
 |--> Waiting for Deployment isilon-controller to be ready         Success
 |
 |--> Waiting for DaemonSet isilon-node to be ready                Success
------------------------------------------------------
> Operation complete
------------------------------------------------------
[root@csips-node1 dell-csi-helm-installer]#

Certificate validation for OneFS REST API calls

今回は利用しない為飛ばします。

Storage Classes

CSI Driver for Dell EMC PowerScale version 1.5以降からはDriverのインストールでStorageClassは作成されない為手動で設定します。

[root@csips-node1 dell-csi-helm-installer]# cd /root/csi-powerscale
[root@csips-node1 csi-powerscale]# kubectl apply -f samples/storageclass/isilon.yaml
storageclass.storage.k8s.io/isilon created
[root@csips-node1 csi-powerscale]#

Volume Snapshot Class

CSI Driver for Dell EMC PowerScale version 1.6以降からはDriverのインストールでVolumeSnapshotClassは作成されない為手動で設定します。

[root@csips-node1 csi-powerscale]# kubectl apply -f samples/volumesnapshotclass/isilon-volumesnapshotclass-v1.yaml
volumesnapshotclass.snapshot.storage.k8s.io/isilon-snapclass created
[root@csips-node1 csi-powerscale]#

インストール状況確認

CSI Driver

[root@csips-node1 csi-powerscale]# kubectl get csidriver
NAME                     ATTACHREQUIRED   PODINFOONMOUNT   STORAGECAPACITY   TOKENREQUESTS   REQUIRESREPUBLISH   MODES                  AGE
csi-isilon.dellemc.com   true             true             false             <unset>         false               Persistent,Ephemeral   2m4s
[root@csips-node1 csi-powerscale]# 
[root@csips-node1 csi-powerscale]# kubectl get csidriver -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
 kind: CSIDriver
 metadata:
   annotations:
     meta.helm.sh/release-name: isilon
     meta.helm.sh/release-namespace: powerscale
   creationTimestamp: "2021-10-20T01:02:15Z"
   labels:
     app.kubernetes.io/managed-by: Helm
   name: csi-isilon.dellemc.com
   resourceVersion: "2588"
   uid: b4394056-8feb-44a5-90d0-148bad039ba1
 spec:
   attachRequired: true
   fsGroupPolicy: ReadWriteOnceWithFSType
   podInfoOnMount: true
   requiresRepublish: false
   storageCapacity: false
   volumeLifecycleModes:
   - Persistent
   - Ephemeral
kind: List
metadata:
 resourceVersion: ""
 selfLink: ""
[root@csips-node1 csi-powerscale]#

StorageClass

[root@csips-node1 csi-powerscale]# kubectl get storageclass
NAME     PROVISIONER              RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
isilon   csi-isilon.dellemc.com   Delete          Immediate           true                   50s
[root@csips-node1 csi-powerscale]# 
[root@csips-node1 csi-powerscale]# kubectl get storageclass -o yaml
apiVersion: v1
items:
- allowVolumeExpansion: true
 apiVersion: storage.k8s.io/v1
 kind: StorageClass
 metadata:
   annotations:
     kubectl.kubernetes.io/last-applied-configuration: |
       {"allowVolumeExpansion":true,"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{},"name":"isilon"},"parameters":{"AccessZone":"System","IsiPath":"/ifs/data/csi","RootClientEnabled":"false"},"provisioner":"csi-isilon.dellemc.com","reclaimPolicy":"Delete","volumeBindingMode":"Immediate"}
   creationTimestamp: "2021-10-20T01:03:24Z"
   name: isilon
   resourceVersion: "2854"
   uid: e345e7e3-2dce-4bd5-8b8e-89c2902534d3
 parameters:
   AccessZone: System
   IsiPath: /ifs/data/csi
   RootClientEnabled: "false"
 provisioner: csi-isilon.dellemc.com
 reclaimPolicy: Delete
 volumeBindingMode: Immediate
kind: List
metadata:
 resourceVersion: ""
 selfLink: ""

VolumeSnapshotClass

[root@csips-node1 csi-powerscale]# kubectl get volumesnapshotclass
NAME               DRIVER                   DELETIONPOLICY   AGE
isilon-snapclass   csi-isilon.dellemc.com   Delete           67s
[root@csips-node1 csi-powerscale]# 
[root@csips-node1 csi-powerscale]# kubectl get volumesnapshotclass -o yaml
apiVersion: v1
items:
- apiVersion: snapshot.storage.k8s.io/v1
 deletionPolicy: Delete
 driver: csi-isilon.dellemc.com
 kind: VolumeSnapshotClass
 metadata:
   annotations:
     kubectl.kubernetes.io/last-applied-configuration: |
       {"apiVersion":"snapshot.storage.k8s.io/v1","deletionPolicy":"Delete","driver":"csi-isilon.dellemc.com","kind":"VolumeSnapshotClass","metadata":{"annotations":{},"name":"isilon-snapclass"},"parameters":{"IsiPath":"/ifs/data/csi"}}
   creationTimestamp: "2021-10-20T01:03:31Z"
   generation: 1
   name: isilon-snapclass
   resourceVersion: "2870"
   uid: cb3bec32-351d-4a0e-81c3-804903fc0adc
 parameters:
   IsiPath: /ifs/data/csi
kind: List
metadata:
 resourceVersion: ""
 selfLink: ""
[root@csips-node1 csi-powerscale]#

Pods

[root@csips-node1 csi-powerscale]# kubectl get pods -n powerscale
NAME                                 READY   STATUS    RESTARTS   AGE
isilon-controller-78c448d77b-75c4h   5/5     Running   0          5d5h
isilon-controller-78c448d77b-jthss   5/5     Running   0          5d5h
isilon-node-p95s4                    2/2     Running   0          5d5h
isilon-node-qm8jd                    2/2     Running   0          5d5h
[root@csips-node1 csi-powerscale]#

ここまででCSI Driver for Dell EMC PowerScaleのインストールは終了です。
構成イメージとしてはこのような感じになっています。

画像2

CSMドキュメントにはテストシナリオが用意されています。

Test PowerScale CSI Driver

・ Creating a storage class
・ Creating a volume
・ Attach the volume to Host
・ Create Snapshot
・ Create Volume from Snapshot
・ Delete Snapshot
・ Create a new volume from existing volume(volume clone)
・ To Unattach the volume from Host
・ To delete the volume

次回は上記のテストがどのような動作となるかPowerScale側の挙動も含めご紹介したいと思います。

みんなにも読んでほしいですか?

オススメした記事はフォロワーのタイムラインに表示されます!

X(旧Twitter)でも情報を発信しております。ぜひフォローお願いします!