Skip to content

Commit 0123eb1

Browse files
committed
Remove enabled_backend entry from 00-config.conf
With webhooks we prevent the glance deploy unless a backend is specified via customServiceConfig. It doesn't fail if replicas is set to 0, but in general a backend must be specified. Signed-off-by: Francesco Pantano <[email protected]>
1 parent 998ac19 commit 0123eb1

File tree

4 files changed

+92
-4
lines changed

4 files changed

+92
-4
lines changed

config/samples/backends/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Currently available samples are:
1919

2020
- Ceph
2121
- NFS
22+
- File
2223
- CEPH + NFS
2324
- CEPH + Sparse Image Upload
2425
- Cinder backends
@@ -170,6 +171,55 @@ openstack role add --project admin --user admin swiftoperator
170171
Additional details on the `Ceph RGW` configuration are described in the
171172
[openstack-k8s-operators/docs repo](https://github.com/openstack-k8s-operators/docs/blob/main/ceph.md#configure-swift-with-a-rgw-backend).
172173

174+
## FILE example
175+
176+
**For development only purposes**, as this is an unsupported configuration,
177+
you can configure Glance with `File` backend.
178+
Set `glanceAPI` to `replicas: 1` since it assumes that Persistent Volume Claims
179+
are `RWO`, and image data are local on the Pod.
180+
However, you can scale up the number of replicas if an `RWX` PVC is provided
181+
through the `extraMounts` interface.
182+
183+
### Configure the File backend
184+
185+
The following snippet shows how the Glance configuration looks like in the
186+
OpenStackControlPlane when File is set as a backend:
187+
188+
```
189+
apiVersion: core.openstack.org/v1beta1
190+
kind: OpenStackControlPlane
191+
metadata:
192+
name: openstack
193+
spec:
194+
...
195+
...
196+
glance:
197+
template:
198+
customServiceConfig: |
199+
[DEFAULT]
200+
enabled_backends = default_backend:file
201+
[glance_store]
202+
default_backend = default_backend
203+
[default_backend]
204+
filesystem_store_datadir = /var/lib/glance/images/
205+
databaseInstance: openstack
206+
glanceAPIs:
207+
default:
208+
replicas: 1
209+
type: single
210+
```
211+
212+
Once you have `crc` running making a deployment with File as a backend is
213+
trivial:
214+
215+
```
216+
$ cd install_yamls
217+
$ make ceph TIMEOUT=90
218+
$ make crc_storage openstack
219+
$ oc kustomize ../glance-operator/config/samples/backends/file > ~/openstack-deployment.yaml
220+
$ export OPENSTACK_CR=`realpath ~/openstack-deployment.yaml`
221+
$ make openstack_deploy
222+
```
173223

174224
## NFS Example
175225

@@ -198,6 +248,20 @@ metadata:
198248
spec:
199249
...
200250
...
251+
glance:
252+
template:
253+
customServiceConfig: |
254+
[DEFAULT]
255+
enabled_backends = default_backend:file
256+
[glance_store]
257+
default_backend = default_backend
258+
[default_backend]
259+
filesystem_store_datadir = /var/lib/glance/images/
260+
databaseInstance: openstack
261+
glanceAPIs:
262+
default:
263+
replicas: 1
264+
type: single
201265
extraMounts:
202266
- extraVol:
203267
- extraVolType: Nfs
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ** FOR DEVELOPMENT PURPOSES ONLY**
2+
# Sample using File as a glance backend
3+
apiVersion: core.openstack.org/v1beta1
4+
kind: OpenStackControlPlane
5+
metadata:
6+
name: openstack
7+
spec:
8+
glance:
9+
template:
10+
customServiceConfig: |
11+
[DEFAULT]
12+
enabled_backends = default_backend:file
13+
[glance_store]
14+
default_backend = default_backend
15+
[default_backend]
16+
filesystem_store_datadir = /var/lib/glance/images/
17+
databaseInstance: openstack
18+
glanceAPIs:
19+
default:
20+
replicas: 1
21+
type: single
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resources:
2+
- ../base/openstack
3+
4+
patches:
5+
- path: nfs.yaml
6+
apiVersion: kustomize.config.k8s.io/v1beta1
7+
kind: Kustomization

templates/common/config/00-config.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ max_logfile_count=1
1818
max_logfile_size_mb=20
1919
log_rotation_type=size
2020
log_file = {{ .LogFile }}
21-
enabled_backends=default_backend:file
2221
{{ if (index . "CacheEnabled") -}}
2322
image_cache_dir = {{ .ImageCacheDir }}
2423
image_cache_max_size = {{ .CacheMaxSize }}
@@ -35,9 +34,6 @@ db_max_retries = -1
3534
[file]
3635
filesystem_store_datadir = /var/lib/glance/images
3736

38-
[glance_store]
39-
default_backend=default_backend
40-
4137
[keystone_authtoken]
4238
www_authenticate_uri={{ .KeystonePublicURL }}
4339
auth_url={{ .KeystoneInternalURL }}

0 commit comments

Comments
 (0)