From dc105fdcfa825d56aa717bf8d129dd5f0d3287d6 Mon Sep 17 00:00:00 2001 From: portdirect Date: Mon, 8 Jan 2018 17:45:33 -0500 Subject: [PATCH] CephFS: support for OSH This PS adds support for CephFS in OSH. Change-Id: I54d5302b89f04cc30f151c8db59f476f02be5652 --- .zuul.yaml | 3 + .../bin/_ceph-cephfs-client-key.sh.tpl | 43 +++++ .../_ceph-namespace-client-key-cleaner.sh.tpl | 2 +- .../bin/_ceph-namespace-client-key.sh.tpl | 18 +- ceph/templates/bin/_cephfs-provisioner.sh.tpl | 21 +++ ceph/templates/configmap-bin.yaml | 4 + .../deployment-cephfs-provisioner.yaml | 175 ++++++++++++++++++ .../templates/deployment-rbd-provisioner.yaml | 2 +- ceph/templates/job-cephfs-client-key.yaml | 127 +++++++++++++ .../job-namespace-client-key-cleaner.yaml | 4 +- ceph/templates/job-namespace-client-key.yaml | 16 +- ceph/templates/job-storage-admin-keys.yaml | 2 +- ceph/templates/storageclass-cephfs.yaml | 34 ++++ ceph/templates/storageclass.yaml | 22 +-- ceph/values.yaml | 62 +++++-- doc/source/install/developer/all-in-one.rst | 4 + doc/source/install/multinode.rst | 5 +- doc/source/troubleshooting/index.rst | 1 + .../troubleshooting/ubuntu-hwe-kernel.rst | 20 ++ tools/deployment/developer/04-ceph.sh | 1 + .../developer/05-ceph-ns-activate.sh | 1 + .../developer/10-ceph-radosgateway.sh | 1 + 22 files changed, 519 insertions(+), 49 deletions(-) create mode 100644 ceph/templates/bin/_ceph-cephfs-client-key.sh.tpl create mode 100644 ceph/templates/bin/_cephfs-provisioner.sh.tpl create mode 100644 ceph/templates/deployment-cephfs-provisioner.yaml create mode 100644 ceph/templates/job-cephfs-client-key.yaml create mode 100644 ceph/templates/storageclass-cephfs.yaml create mode 100644 doc/source/troubleshooting/ubuntu-hwe-kernel.rst diff --git a/.zuul.yaml b/.zuul.yaml index b1f9b676f7..ae076edf44 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -51,6 +51,8 @@ name: openstack-helm-dev-deploy vars: zuul_osh_infra_relative_path: ../openstack-helm-infra/ + pre-run: + - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-upgrade-host.yaml run: tools/gate/playbooks/dev-deploy.yaml post-run: ../openstack-helm-infra/tools/gate/playbooks/osh-infra-collect-logs.yaml required-projects: @@ -63,6 +65,7 @@ zuul_osh_infra_relative_path: ../openstack-helm-infra/ name: openstack-helm-legacy pre-run: + - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-upgrade-host.yaml - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-docker.yaml - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-build.yaml - ../openstack-helm-infra/tools/gate/playbooks/osh-infra-deploy-k8s.yaml diff --git a/ceph/templates/bin/_ceph-cephfs-client-key.sh.tpl b/ceph/templates/bin/_ceph-cephfs-client-key.sh.tpl new file mode 100644 index 0000000000..26868c2773 --- /dev/null +++ b/ceph/templates/bin/_ceph-cephfs-client-key.sh.tpl @@ -0,0 +1,43 @@ +#!/bin/bash + +{{/* +Copyright 2017 The Openstack-Helm Authors. + +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 -ex + +CEPH_CEPHFS_KEY=$(kubectl get secret ${PVC_CEPH_CEPHFS_STORAGECLASS_ADMIN_SECRET_NAME} \ + --namespace=${PVC_CEPH_CEPHFS_STORAGECLASS_DEPLOYED_NAMESPACE} \ + -o json ) + +ceph_activate_namespace() { + kube_namespace=$1 + secret_type=$2 + secret_name=$3 + ceph_key=$4 + { + cat <`__ is required to use CephFS. + System Requirements ------------------- diff --git a/doc/source/install/multinode.rst b/doc/source/install/multinode.rst index 1b450b6ab2..188fa79add 100644 --- a/doc/source/install/multinode.rst +++ b/doc/source/install/multinode.rst @@ -28,6 +28,10 @@ documentation as we explore these options further. The installation procedures below, will take an administrator from a new ``kubeadm`` installation to Openstack-Helm deployment. +.. warning:: Until the Ubuntu kernel shipped with 16.04 supports CephFS + subvolume mounts by default the `HWE Kernel + <../troubleshooting/ubuntu-hwe-kernel.rst>`__ is required to use CephFS. + Kubernetes Preparation ====================== @@ -581,4 +585,3 @@ The following shows a set of example hosts and the values fed into the configmap DEFAULT: vcpu_pin_set: "0-31" cpu_allocation_ratio: 3.0 - diff --git a/doc/source/troubleshooting/index.rst b/doc/source/troubleshooting/index.rst index be2ff1952e..1d4e1a80ad 100644 --- a/doc/source/troubleshooting/index.rst +++ b/doc/source/troubleshooting/index.rst @@ -9,6 +9,7 @@ Sometimes things go wrong. These guides will help you solve many common issues w database persistent-storage + ubuntu-hwe-kernel Getting help ============ diff --git a/doc/source/troubleshooting/ubuntu-hwe-kernel.rst b/doc/source/troubleshooting/ubuntu-hwe-kernel.rst new file mode 100644 index 0000000000..83b5cff54e --- /dev/null +++ b/doc/source/troubleshooting/ubuntu-hwe-kernel.rst @@ -0,0 +1,20 @@ +================= +Ubuntu HWE Kernel +================= + +To make use of CephFS in Ubuntu the HWE Kernel is required, until the issue +described `here `_ +is fixed. + +Installation +============ + +To deploy the HWE kernel, prior to deploying Kubernetes and OpenStack-Helm +the following commands should be run on each node: + +.. code-block:: shell + + #!/bin/bash + sudo -H apt-get update + sudo -H apt-get install -y linux-generic-hwe-16.04 + sudo -H reboot now diff --git a/tools/deployment/developer/04-ceph.sh b/tools/deployment/developer/04-ceph.sh index 4e86733864..e5f8840f5a 100755 --- a/tools/deployment/developer/04-ceph.sh +++ b/tools/deployment/developer/04-ceph.sh @@ -31,6 +31,7 @@ helm install --namespace=ceph ${WORK_DIR}/ceph --name=ceph \ --set deployment.storage_secrets=true \ --set deployment.ceph=true \ --set deployment.rbd_provisioner=true \ + --set deployment.cephfs_provisioner=true \ --set deployment.client_secrets=false \ --set deployment.rgw_keystone_user_and_endpoints=false \ --set bootstrap.enabled=true \ diff --git a/tools/deployment/developer/05-ceph-ns-activate.sh b/tools/deployment/developer/05-ceph-ns-activate.sh index 7028bb9f6c..f4347fb40f 100755 --- a/tools/deployment/developer/05-ceph-ns-activate.sh +++ b/tools/deployment/developer/05-ceph-ns-activate.sh @@ -31,6 +31,7 @@ helm install --namespace=openstack ${WORK_DIR}/ceph --name=ceph-openstack-config --set deployment.storage_secrets=false \ --set deployment.ceph=false \ --set deployment.rbd_provisioner=false \ + --set deployment.cephfs_provisioner=false \ --set deployment.client_secrets=true \ --set deployment.rgw_keystone_user_and_endpoints=false \ --values=${WORK_DIR}/tools/overrides/mvp/ceph.yaml diff --git a/tools/deployment/developer/10-ceph-radosgateway.sh b/tools/deployment/developer/10-ceph-radosgateway.sh index 723186a3b1..8f4be8ea27 100755 --- a/tools/deployment/developer/10-ceph-radosgateway.sh +++ b/tools/deployment/developer/10-ceph-radosgateway.sh @@ -31,6 +31,7 @@ helm install --namespace=openstack ${WORK_DIR}/ceph --name=radosgw-openstack \ --set deployment.storage_secrets=false \ --set deployment.ceph=false \ --set deployment.rbd_provisioner=false \ + --set deployment.cephfs_provisioner=false \ --set deployment.client_secrets=false \ --set deployment.rgw_keystone_user_and_endpoints=true \ --values=${WORK_DIR}/tools/overrides/mvp/ceph.yaml