6.2.3. 既存のバージョンが cns-deploy を使用してデプロイされている場合のアップグレード

6.2.3.1. cns-deploy および Heketi Server のアップグレード

以下のコマンドは、クライアントマシンで実行する必要があります。

  1. 以下のコマンドを実行して、heketi クライアントパッケージおよび cns-deploy パッケージを更新します。

    # yum update cns-deploy -y
    # yum update heketi-client -y
  2. Heketi レジストリーデータベースファイルをバックアップします。

    # heketi-cli db dump > heketi-db-dump-$(date -I).json
  3. 以下のコマンドを実行して、heketi テンプレートを削除します。

    # oc delete templates heketi
  4. 以下のコマンドを実行して、現在の HEKETI_ADMIN_KEY を取得します。

    OCS 管理者は、インフラストラクチャーによって使用されていない限り、ユーザーキーに任意のフレーズを設定することを選択できます。これは、OCSのデフォルトでインストールされているリソースでは使用されません。

    # oc get secret <heketi-admin-secret-name> -o jsonpath='{.data.key}'|base64 -d;echo
  5. 以下のコマンドを実行して、heketi テンプレートをインストールします。

    # oc create -f /usr/share/heketi/templates/heketi-template.yaml
    template "heketi" created
  6. 以下のコマンドを実行して、heketi サービスアカウントに必要な権限を付与します。

    # oc policy add-role-to-user edit system:serviceaccount:<project_name>:heketi-service-account
    # oc adm policy add-scc-to-user privileged -z heketi-service-account

    以下に例を示します。

    # oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account
    # oc adm policy add-scc-to-user privileged -z heketi-service-account
    注記

    Heketi/rhgs-volmanager Pod は heketidb ストレージ Gluster ボリュームを「glusterfs」のボリュームタイプとしてマウントし、PersistentVolume(PV)ではなく heketidb ストレージ Gluster ボリュームを「glusterfs」としてマウントするため、heketi Pod で使用するサービスアカウントは特権が必要です。
    OpenShift の security-context-constraints の規定によると、configMap、downwardAPI、emptyDir、hostPath、nfs、persistentVolumeClaim、secret のタイプではないボリュームをマウントできる機能は、特権付き SCC(Security Context Constraint)のアカウントにだけ付与されます。

  7. 以下のコマンドを実行して、新しい heketi 設定ファイルを生成します。

    # sed -e "s/\${HEKETI_EXECUTOR}/kubernetes/" -e "s#\${HEKETI_FSTAB}#/var/lib/heketi/fstab#" -e "s/\${SSH_PORT}/22/" -e "s/\${SSH_USER}/root/" -e "s/\${SSH_SUDO}/false/" -e "s/\${BLOCK_HOST_CREATE}/true/" -e "s/\${BLOCK_HOST_SIZE}/500/" "/usr/share/heketi/templates/heketi.json.template" > heketi.json
    • BLOCK_HOST_SIZE パラメーターは、gluster-block ボリュームをホストする自動作成された Red Hat Gluster Storage ボリュームのサイズ(GB 単位)を制御します(詳細はhttps://access.redhat.com/documentation/ja-jp/red_hat_openshift_container_storage/3.11/html-single/operations_guide/index#Block_Storageを参照してください)。このデフォルト設定では、より多くの領域が必要になるため、500GB のブロックホスティングボリュームを動的に作成します。
    • または、/usr/share/heketi/templates/heketi.json.template を現在のディレクトリーの heketi.json にコピーし、新規ファイルを直接編集して、各"${VARIABLE}"文字列を必要なパラメーターに置き換えます。

      注記

      JSON フォーマットが厳密に必要とされています(末尾にスペースを入れない、ブール値はすべて小文字など)。

  8. 以下のコマンドを実行して、設定ファイルを保持するためのシークレットを作成します。

    # oc create secret generic <heketi-registry-config-secret> --from-file=heketi.json
    注記

    heketi-registry-config-secret ファイルがすでに存在する場合は、ファイルを削除して以下のコマンドを実行します。

  9. 以下のコマンドを実行して、heketi のデプロイメント設定、サービス、ルートを削除します。

    # oc delete deploymentconfig,service,route heketi-registry
  10. heketi テンプレートを編集します。

    • HEKETI_USER_KEY パラメーターおよび HEKETI_ADMIN_KEY パラメーターを編集します。

      # oc edit template heketi
      parameters:
      - description: Set secret for those creating volumes as type user
        displayName: Heketi User Secret
        name: HEKETI_USER_KEY
        value: <heketiuserkey>
      - description: Set secret for administration of the Heketi service as user admin
        displayName: Heketi Administrator Secret
        name: HEKETI_ADMIN_KEY
        value: <adminkey>
      - description: Set the executor type, kubernetes or ssh
        displayName: heketi executor type
        name: HEKETI_EXECUTOR
        value: kubernetes
      - description: Set the hostname for the route URL
        displayName: heketi route name
        name: HEKETI_ROUTE
        value: heketi-storage
      - displayName: heketi container image name
        name: IMAGE_NAME
        required: true
        value: registry.redhat.io/rhgs3/rhgs-volmanager-rhel7
      - displayName: heketi container image version
        name: IMAGE_VERSION
        required: true
        value: v3.11.8
      - description: A unique name to identify this heketi service, useful for running
          multiple heketi instances
        displayName: GlusterFS cluster name
        name: CLUSTER_NAME
        value: storage
      注記

      クラスターに 1000 を超えるボリュームがある場合は、How to change the default PVS limit in Openshift Container Storage を参照し、アップグレードに進む前に必要なパラメーターを追加します。

    • HEKETI_LVM_WRAPPER および値 /usr/sbin/exec-on-host を指定して、ENV を追加します。

      - description: Heketi can use a wrapper to execute LVM commands, i.e. run commands
      in the host namespace instead of in the Gluster container.
      displayName: Wrapper for executing LVM commands
      name: HEKETI_LVM_WRAPPER
      value: /usr/sbin/exec-on-host
    • HEKETI_DEBUG_UMOUNT_FAILURES という名前で、値が true の ENV を追加します。

      - description: When unmounting a brick fails, Heketi will not be able to cleanup the
      Gluster volume completely. The main causes for preventing to unmount a brick,
      seem to originate from Gluster processes. By enabling this option, the heketi.log
      will contain the output of 'lsof' to aid with debugging of the Gluster processes
      and help with identifying any files that may be left open.
      displayName: Capture more details in case brick unmounting fails
      name: HEKETI_DEBUG_UMOUNT_FAILURES
      required=true
    • HEKETI_CLI_USER という名前で、値が admin の ENV を追加します。
    • HEKETI_CLI_KEYという名前で、ENV HEKETI_ADMIN_KEYに指定されているものと同じ値のENVを追加します。
    • アップグレードするバージョンに応じて、IMAGE_VERSION の下の valuev3.11.5 または v3.11.8 に置き換えます。

      - displayName: heketi container image name
        name: IMAGE_NAME
        required: true
        value: registry.redhat.io/rhgs3/rhgs-volmanager-rhel7
      - displayName: heketi container image version
        name: IMAGE_VERSION
        required: true
        value: v3.11.8
  11. 以下のコマンドを実行して、OpenShift の永続ボリュームを作成するために使用する Heketi サービス、ルート、およびデプロイメント設定をデプロイします。

    # oc process heketi | oc create -f -
    
    service "heketi-registry" created
    route "heketi-registry" created
    deploymentconfig-registry "heketi" created
    注記

    db ワークロード用に、heketidbstorage ボリュームを調整することを推奨します。新たにインストールされた Openshift Container Storage デプロイメントにより、heketidbstorage ボリュームが自動的にチューニングされます。古いデプロイメントの場合は、KCS の記事 Planning to run containerized DB or nosql workloads on Openshift Container Storage? に従って、ボリューム heketidbstorage のボリュームセット操作を実行します。

  12. 以下のコマンドを実行して、コンテナーが実行していることを確認します。

    # oc get pods

    以下は例になります。

    # oc get pods
    NAME                                          READY     STATUS    RESTARTS   AGE
    glusterblock-storage-provisioner-dc-1-ffgs5   1/1       Running   0          3m
    glusterfs-storage-5thpc                       1/1       Running   0          9d
    glusterfs-storage-hfttr                       1/1       Running   0          9d
    glusterfs-storage-n8rg5                       1/1       Running   0          9d
    heketi-storage-4-9fnvz                        2/2       Running   0          8d