synology-csi
最終更新日:January 29, 2023

synology-csi #

準備 #

CSI Driverを取得 #

git clone https://github.com/SynologyOpenSource/synology-csi
cd synology-csi
cp config/client-info-template.yml config/client-info.yml

Synology DS220+ への接続情報を設定 #

  • config/client-info.yml
    ---
    clients:
      - host: 192.168.1.1
        port: 5000
        https: false
        username: username
        password: password
      - host: 192.168.1.2
        port: 5000
        https: false
        username: username
        password: password
    
    ---
    clients:
      - host: 192.168.50.xxx (Synology DS220+ のIPアドレス)
        port: 5001
        https: true
        username: xxxxxxxxxx (Synology DS220+ のユーザー)
        password: xxxxxxxxxx (Synology DS220+ のパスワード)
    

StrageClassの情報を設定 #

  • deploy/kubernetes/v1.20/storage-class.yml
    metadata:
      name: synology-iscsi-storage
      # annotations:
      #   storageclass.kubernetes.io/is-default-class: "true"
    provisioner: csi.san.synology.com
    # if all params are empty, synology CSI will choose an available location to create volume
    # parameters:
    #   dsm: '1.1.1.1'
    #   location: '/volume1'
    #   fsType: 'ext4'
    reclaimPolicy: Retain
    allowVolumeExpansion: true
    
    metadata:
      name: synology-iscsi-storage
      annotations:
        storageclass.kubernetes.io/is-default-class: "true"
    provisioner: csi.san.synology.com
    # if all params are empty, synology CSI will choose an available location to create volume
    parameters:
      dsm: '192.168.50.xxx' (Synology DS220+ のIPアドレス)
      location: '/volume3' (Synology DS220+ に作成したCluster専用のVolume)
      fsType: 'ext4' (ClusterからVolumeをマウントする時のファイルシステム)
    reclaimPolicy: Retain
    allowVolumeExpansion: true
    

VolumeSnapshotClassesの情報を設定 #

  • deploy/kubernetes/v1.20/snapshotter/volume-snapshot-class.yml
    metadata:
      name: synology-snapshotclass
      annotations:
        storageclass.kubernetes.io/is-default-class: "false"
    driver: csi.san.synology.com
    deletionPolicy: Delete
    
    metadata:
      name: synology-snapshotclass
      namespace: synology-csi
      annotations:
        storageclass.kubernetes.io/is-default-class: "false"
    driver: csi.san.synology.com
    deletionPolicy: Delete
    

インストール #

Synology CSI Driver for Kubernetesをビルド #

  • Synology CSI Driver for Kubernetesをビルドします。
./scripts/deploy.sh build

Synology CSI Driver for Kubernetesをインストール #

  • Synology CSI Driver for Kubernetesをインストールします。
./scripts/deploy.sh install --all