From 00cecf16275ac86122369073967d222d5688fe19 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 13 Mar 2017 17:00:10 -0500 Subject: [PATCH] Add support for Cinder fake backend Use Cinder fake backend over Ceph for developer mode. This allows developers to create volumes and get logging information for testing purposes --- cinder/templates/deployment-volume.yaml | 4 +++ cinder/templates/etc/_cinder.conf.tpl | 7 +++++ cinder/values.yaml | 37 +++++++++++++------------ docs/developer/minikube.md | 8 +++++- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml index bd4517eb..84a64b2f 100644 --- a/cinder/templates/deployment-volume.yaml +++ b/cinder/templates/deployment-volume.yaml @@ -67,6 +67,7 @@ spec: mountPath: /etc/cinder/conf/cinder.conf subPath: cinder.conf readOnly: true + {{- if .Values.ceph.enabled }} - name: cephconf mountPath: /etc/ceph/ceph.conf subPath: ceph.conf @@ -75,6 +76,7 @@ spec: mountPath: /etc/ceph/ceph.client.{{ .Values.ceph.cinder_user }}.keyring subPath: ceph.client.{{ .Values.ceph.cinder_user }}.keyring readOnly: true + {{- end }} volumes: - name: pod-etc-cinder emptyDir: {} @@ -83,9 +85,11 @@ spec: - name: cinderconf configMap: name: cinder-etc + {{- if .Values.ceph.enabled }} - name: cephconf configMap: name: cinder-etc - name: cephclientcinderkeyring configMap: name: cinder-etc + {{- end }} diff --git a/cinder/templates/etc/_cinder.conf.tpl b/cinder/templates/etc/_cinder.conf.tpl index cb336d64..26fa476c 100644 --- a/cinder/templates/etc/_cinder.conf.tpl +++ b/cinder/templates/etc/_cinder.conf.tpl @@ -64,6 +64,7 @@ rabbit_ha_queues = true rabbit_hosts = {{ .Values.messaging.hosts }} [rbd1] +volume_backend_name = rbd volume_driver = cinder.volume.drivers.rbd.RBDDriver rbd_pool = {{ .Values.backends.rbd1.pool }} rbd_ceph_conf = /etc/ceph/ceph.conf @@ -78,3 +79,9 @@ rbd_secret_uuid = {{- include "secrets/ceph-client-key" . -}} {{- end }} rbd_secret_uuid = {{ .Values.backends.rbd1.secret }} report_discard_supported = True + +{{- if .Values.backends.fake.enabled }} +[fake] +volume_backend_name = fake +volume_driver = cinder.tests.fake_driver.FakeLoggingVolumeDriver +{{- end }} diff --git a/cinder/values.yaml b/cinder/values.yaml index 22e65603..25e9502c 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -22,6 +22,25 @@ replicas: volume: 1 scheduler: 1 +backends: + enabled: + - rbd1 + rbd1: + secret: null + user: "admin" + pool: "volumes" + fake: + enabled: false + +ceph: + enabled: true + monitors: [] + cinder_user: "admin" + # a null value for the keyring will + # attempt to use the key from + # common/secrets/ceph-client-key + cinder_keyring: null + labels: node_selector_key: openstack-control-plane node_selector_value: enabled @@ -74,23 +93,6 @@ database: cinder_password: password cinder_user: cinder -ceph: - enabled: true - monitors: [] - cinder_user: "admin" - # a null value for the keyring will - # attempt to use the key from - # common/secrets/ceph-client-key - cinder_keyring: null - -backends: - enabled: - - rbd1 - rbd1: - secret: null - user: "admin" - pool: "volumes" - glance: version: 2 @@ -99,7 +101,6 @@ messaging: user: rabbitmq password: password - api: workers: 8 diff --git a/docs/developer/minikube.md b/docs/developer/minikube.md index f1e4fb96..0c7b6ba9 100644 --- a/docs/developer/minikube.md +++ b/docs/developer/minikube.md @@ -189,12 +189,18 @@ To deploy Openstack-Helm in development mode, ensure you've created a minikube-a /var/lib/docker ``` -As a result of this guidence, we recommend creating the following for MariaDB like shown below. +As a result of this guidance, we recommend creating the following for MariaDB like shown below. ``` sudo mkdir -p /data/openstack-helm/mariadb ``` + +### Change Cinder Backend + +Currently, Cinder uses Ceph for the RBD backend out of the box. To avoid Ceph in development mode, developers can use the Cinder 'Fake' backend by both adding the `fake` driver to the list of [enabled backends](https://github.com/att-comdev/openstack-helm/blob/master/cinder/values.yaml#L87) in Cinder's values.yaml file, and changing the `enabled` flag under `fake` to true. The Fake backend allows developers to create volumes and log events. In the future, the Fake backend will be replaced with the LVM backend in development mode to allow developers to create and attach volumes to instances. + + ### Label Minikube Node Be sure to label your minikube node according to the documentation in our installation guide (this remains exactly the same).