#!/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. set -xe : ${CEPH_OSD_DATA_DEVICE:="/dev/loop100"} : ${POD_NETWORK_CIDR:="10.244.0.0/16"} : ${OSH_INFRA_HELM_REPO:="../openstack-helm-infra"} : ${OSH_INFRA_VALUES_OVERRIDES_PATH:="../openstack-helm-infra/values_overrides"} NUMBER_OF_OSDS="$(kubectl get nodes -l ceph-osd=enabled --no-headers | wc -l)" #NOTE: Deploy command [ -s /tmp/ceph-fs-uuid.txt ] || uuidgen > /tmp/ceph-fs-uuid.txt CEPH_FS_ID="$(cat /tmp/ceph-fs-uuid.txt)" #NOTE(portdirect): to use RBD devices with Ubuntu kernels < 4.5 this # should be set to 'hammer' . /etc/os-release if [ "x${ID}" == "xcentos" ] || \ ([ "x${ID}" == "xubuntu" ] && \ dpkg --compare-versions "$(uname -r)" "lt" "4.5"); then CRUSH_TUNABLES=hammer else CRUSH_TUNABLES=null fi # Most of PV fields are immutable and in case of CSI RBD plugin they refer # to secrets which were used for RBD provisioner and RBD attacher. These fields # can not be updated later. # So for testing purposes we assume legacy Ceph cluster is deployed with # the following secret names for the CSI plugin # - rook-csi-rbd-provisioner # - rook-csi-rbd-node # These exact secret names are used by Rook by default for CSI plugin and # and after migration PVs will be adopted by the new Rook Ceph cluster. # # Alternatively if we deploy legacy Ceph cluster with the default values # then we could later force Rook to use same CSI secret names as used for # legacy cluster. For example pvc-ceph-conf-combined-storageclass secret # name is used by default in legacy charts. # # Same is for CSI provisioner drivername option. For testing we deploy # legacy cluster with the drivername set to rook-ceph.rbd.csi.ceph.com # while default value is ceph.rbd.csi.ceph.com. # This is also for the sake of smooth adoption of PVs. tee /tmp/ceph.yaml <