Rancher 2.0にRook-Crephを取り付けます


バージョン#バージョン#
Rancher 2.2.6Rook Release-1.0
リファレンスドキュメント
  • 公式ドキュメントhttps://rook.io/docs/rook/v1.0
  • kubernetes配備rook+cephストレージシステムhttps://blog.csdn.net/networken/article/details/85772418
  • Rancher 2 rookを使用してcephストレージクラスを構築https://www.jianshu.com/p/f353b71ec58e

  • インストール
    1 rancherのclusterを構成する.ymlファイル、公式ドキュメントに従いますhttps://rook.io/docs/rook/v1.0/flexvolume.htmlを選択してflexvolumeのパスを設定し、clusterを変更します.yml.
    services:
      ...
      kubelet:
        image: ""
        extra_args: 
          volume-plugin-dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
        extra_binds: 
          - /usr/libexec/kubernetes/kubelet-plugins/volume/exec:/usr/libexec/kubernetes/kubelet-plugins/volume/exec

    変更後にrke upまたは./を使用rke_linux-amd 64 up kubernetesを再構成します.この構成はrancherの使用に影響を与える可能性がありますので、生産環境に注意してください.
    2 Rook commonとoperatorをインストールするにはhelmのインストール方法またはkubectlのインストール方法を選択します.
  • helm
  • を使用
    helmとtillerをインストールし、rancherのアプリケーションストアに参加します.https://charts.rook.io/releaseを選択します.
  • kubectl
  • を使用
    まずgit cloneでrookをダウンロードし、checkoutをstableのバージョンにします.現在はRelease-1.0です.rook/cluster/examples/kubernetes/ceph/に入り、以下のコマンドを実行します.kube_config_cluster.ymlはrancherのk 8 sクラスタに外部アクセスするために必要なプロファイルです.
    kubectl --kubeconfig=kube_config_cluster.yml create -f common.yaml
    kubectl --kubeconfig=kube_config_cluster.yml create -f operator.yaml 

    実行が完了すると、rancherでrook-cephネーミングスペースをdefault(または他のアイテム)に変更すると、rook-ceph-agent、rook-ceph-operator、rook-discoverが表示されます.3 Rook clusterをインストールします.
  • Release1.0バージョンでは、dashboardの500エラーの問題を解決し、ceph/ceph:v 14にimageを変更する必要があります.2.2-20190722
  • 著者らは、cephにすべてのノードのすべての空間を直接使用させ、directoriesを注釈した.実際に適用する場合、必要に応じて
  • を構成することができる.
      storage: # cluster level storage configuration and selection
        useAllNodes: true
        useAllDevices: true
        deviceFilter:
        location:
        config:
          # The default and recommended storeType is dynamically set to bluestore for devices and filestore for directories.
          # Set the storeType explicitly only if it is required not to use the default.
          # storeType: bluestore
          # metadataDevice: "md0" # specify a non-rotational storage so ceph-volume will use it as block db device of bluestore.
          # databaseSizeMB: "1024" # uncomment if the disks are smaller than 100 GB
          # journalSizeMB: "1024"  # uncomment if the disks are 20 GB or smaller
          # osdsPerDevice: "1" # this value can be overridden at the node or device level
          # encryptedDevice: "true" # the default value for this option is "false"
    # Cluster level list of directories to use for filestore-based OSD storage. If uncommented, this example would create an OSD under the dataDirHostPath.
    #    
        directories:
        - path: /var/lib/rook
  • のインストールが完了すると、3ノードの負荷は図
  • のようになる.
  • ストレージクラス
  • を追加
    kubectl --kubeconfig=kube_config_cluster.yml create -f storageclass.yaml 
  • ingressを追加し、dashboardにアクセスします.dashboardのパスワードリソース-暗号文のrook-ceph-dashboard-passwordエントリ
  • 4 busyboxテストを確立して、ハードディスクをマウントして、サービスが正常に起動したことを見ることができて、ceph-dashboardの下のblockの下のImagesは相応のpvc 5があって最後にrancherクラスタレベルのメニューの中でストレージ-ストレージクラスに入って、rook-ceph-blockをデフォルトに設定します