Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove enabled_backend entry from 00-config.conf #440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: file.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
fmount marked this conversation as resolved.
Show resolved Hide resolved
{{ 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
Loading