diff --git a/ceph/values.yaml b/ceph/values.yaml index 784a03edf3..c25ed13c35 100644 --- a/ceph/values.yaml +++ b/ceph/values.yaml @@ -293,7 +293,6 @@ bootstrap: ceph osd pool stats $1 || ceph osd pool create $1 $2 } ensure_pool volumes 8 - ensure_pool images 8 # if you change provision_storage_class to false # it is presumed you manage your own storage diff --git a/doc/source/install/developer/all-in-one.rst b/doc/source/install/developer/all-in-one.rst index 37e09dc4aa..5411ed1b6d 100644 --- a/doc/source/install/developer/all-in-one.rst +++ b/doc/source/install/developer/all-in-one.rst @@ -233,7 +233,7 @@ more sensible values for the All-in-One environment using the ``--values`` and helm install --name=keystone ./keystone --namespace=openstack helm install --name=glance ./glance --namespace=openstack \ - --values=./tools/overrides/mvp/glance.yaml + --set storage=pvc helm install --name=nova ./nova --namespace=openstack \ --values=./tools/overrides/mvp/nova.yaml \ --set=conf.nova.libvirt.nova.conf.virt_type=qemu diff --git a/doc/source/install/multinode.rst b/doc/source/install/multinode.rst index 4b7a392dff..393bb5a54c 100644 --- a/doc/source/install/multinode.rst +++ b/doc/source/install/multinode.rst @@ -451,11 +451,25 @@ now create endpoints in the Keystone service catalog: **Install Glance:** +Glance supports a number of backends: + +* ``pvc``: A simple file based backend using Kubernetes PVCs +* ``rbd``: Uses Ceph RBD devices to store images. +* ``radosgw``: Uses Ceph RadosGW object storage to store images. +* ``swift``: Uses the ``object-storage`` service from the OpenStack service + catalog to store images. + +You can deploy Glance with any of these backends if you deployed both the +RadosGW and created Keystone endpoints by changing the value for +``GLANCE_BACKEND`` in the following: + :: + : ${GLANCE_BACKEND:="radosgw"} helm install --namespace=openstack --name=glance ./glance \ --set pod.replicas.api=2 \ --set pod.replicas.registry=2 + --set storage=${GLANCE_BACKEND} **Install Heat:** diff --git a/glance/templates/bin/_ceph-keyring.sh.tpl b/glance/templates/bin/_ceph-keyring.sh.tpl index 709191e48a..aa3a3e842d 100644 --- a/glance/templates/bin/_ceph-keyring.sh.tpl +++ b/glance/templates/bin/_ceph-keyring.sh.tpl @@ -19,8 +19,8 @@ limitations under the License. set -ex export HOME=/tmp -cat < /etc/ceph/ceph.client.{{ .Values.conf.glance.glance_store.glance.store.rbd_store_user }}.keyring -[client.{{ .Values.conf.glance.glance_store.glance.store.rbd_store_user }}] +cat < /etc/ceph/ceph.client.${RBD_STORE_USER}.keyring +[client.${RBD_STORE_USER}] {{- if .Values.conf.ceph.keyring }} key = {{ .Values.conf.ceph.keyring }} {{- else }} diff --git a/glance/templates/bin/_clean.sh.tpl b/glance/templates/bin/_clean-image.sh.tpl similarity index 100% rename from glance/templates/bin/_clean.sh.tpl rename to glance/templates/bin/_clean-image.sh.tpl diff --git a/glance/templates/bin/_clean-secrets.sh.tpl b/glance/templates/bin/_clean-secrets.sh.tpl new file mode 100644 index 0000000000..618458d1ee --- /dev/null +++ b/glance/templates/bin/_clean-secrets.sh.tpl @@ -0,0 +1,21 @@ +#!/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 + +exec kubectl delete secret --namespace ${NAMESPACE} ${RBD_POOL_SECRET} diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl new file mode 100644 index 0000000000..91522eaba2 --- /dev/null +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -0,0 +1,76 @@ +#!/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 -x +if [ "x$STORAGE_BACKEND" == "xrbd" ]; then + SECRET=$(mktemp --suffix .yaml) + KEYRING=$(mktemp --suffix .keyring) + function cleanup { + rm -f ${SECRET} ${KEYRING} + } + trap cleanup EXIT +fi + +set -ex +if [ "x$STORAGE_BACKEND" == "xpvc" ] || [ "x$STORAGE_BACKEND" == "xswift" ]; then + echo "No action required." +elif [ "x$STORAGE_BACKEND" == "xrbd" ]; then + ceph -s + function ensure_pool () { + ceph osd pool stats $1 || ceph osd pool create $1 $2 + } + ensure_pool ${RBD_POOL_NAME} ${RBD_POOL_CHUNK_SIZE} + + #NOTE(Portdirect): Determine proper privs to assign keyring + ceph auth get-or-create client.${RBD_POOL_USER} \ + mon "allow *" \ + osd "allow *" \ + -o ${KEYRING} + + ENCODED_KEYRING=$(sed -n 's/^[[:blank:]]*key[[:blank:]]\+=[[:blank:]]\(.*\)/\1/p' ${KEYRING} | base64 -w0) + cat > ${SECRET} <