Skip to content

Commit

Permalink
Remove enabled_backend entry from 00-config.conf
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
fmount committed Oct 11, 2024
1 parent 998ac19 commit 0123eb1
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 4 deletions.
64 changes: 64 additions & 0 deletions config/samples/backends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Currently available samples are:

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

## FILE example

**For development only purposes**, as this is an unsupported configuration,
you can configure Glance with `File` backend.
Set `glanceAPI` to `replicas: 1` since it assumes that Persistent Volume Claims
are `RWO`, and image data are local on the Pod.
However, you can scale up the number of replicas if an `RWX` PVC is provided
through the `extraMounts` interface.

### Configure the File backend

The following snippet shows how the Glance configuration looks like in the
OpenStackControlPlane when File is set as a backend:

```
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
...
...
glance:
template:
customServiceConfig: |
[DEFAULT]
enabled_backends = default_backend:file
[glance_store]
default_backend = default_backend
[default_backend]
filesystem_store_datadir = /var/lib/glance/images/
databaseInstance: openstack
glanceAPIs:
default:
replicas: 1
type: single
```

Once you have `crc` running making a deployment with File as a backend is
trivial:

```
$ cd install_yamls
$ make ceph TIMEOUT=90
$ make crc_storage openstack
$ oc kustomize ../glance-operator/config/samples/backends/file > ~/openstack-deployment.yaml
$ export OPENSTACK_CR=`realpath ~/openstack-deployment.yaml`
$ make openstack_deploy
```

## NFS Example

Expand Down Expand Up @@ -198,6 +248,20 @@ metadata:
spec:
...
...
glance:
template:
customServiceConfig: |
[DEFAULT]
enabled_backends = default_backend:file
[glance_store]
default_backend = default_backend
[default_backend]
filesystem_store_datadir = /var/lib/glance/images/
databaseInstance: openstack
glanceAPIs:
default:
replicas: 1
type: single
extraMounts:
- extraVol:
- extraVolType: Nfs
Expand Down
21 changes: 21 additions & 0 deletions config/samples/backends/file/file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ** FOR DEVELOPMENT PURPOSES ONLY**
# Sample using File as a glance backend
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
glance:
template:
customServiceConfig: |
[DEFAULT]
enabled_backends = default_backend:file
[glance_store]
default_backend = default_backend
[default_backend]
filesystem_store_datadir = /var/lib/glance/images/
databaseInstance: openstack
glanceAPIs:
default:
replicas: 1
type: single
7 changes: 7 additions & 0 deletions config/samples/backends/file/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- ../base/openstack

patches:
- path: nfs.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
4 changes: 0 additions & 4 deletions templates/common/config/00-config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ max_logfile_count=1
max_logfile_size_mb=20
log_rotation_type=size
log_file = {{ .LogFile }}
enabled_backends=default_backend:file
{{ if (index . "CacheEnabled") -}}
image_cache_dir = {{ .ImageCacheDir }}
image_cache_max_size = {{ .CacheMaxSize }}
Expand All @@ -35,9 +34,6 @@ db_max_retries = -1
[file]
filesystem_store_datadir = /var/lib/glance/images

[glance_store]
default_backend=default_backend

[keystone_authtoken]
www_authenticate_uri={{ .KeystonePublicURL }}
auth_url={{ .KeystoneInternalURL }}
Expand Down

0 comments on commit 0123eb1

Please sign in to comment.