Skip to content

Commit dbce957

Browse files
committed
Enable glance in NFS scenario
This patch updates the glance template due to the missing "enabled: true". In addition, it adds the same overrides we have in all the other scenarios. Because the ctlplane creates an API with type: split, we register a new NFS GlanceAPI based on [1] and we decommission the default one (not used in this scenario). [1] https://github.com/openstack-k8s-operators/glance-operator/blob/main/docs/design-decisions.md#decommissioning-a-glanceapi Signed-off-by: Francesco Pantano <[email protected]>
1 parent 4ea7b99 commit dbce957

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

tests/roles/glance_adoption/tasks/glance_nfs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,16 @@
1717
{{ shell_header }}
1818
{{ oc_header }}
1919
oc patch openstackcontrolplane openstack --type=merge --patch-file=/tmp/glance_nfs.yaml
20+
21+
# NOTE (fpantano):
22+
# Glance provides by default a type: split API that we do not use for this scenario.
23+
# type: split applies to all the existing use cases except NFS where there's no
24+
# need to split the API between internal and external. Because it is not possible
25+
# to modify an existing Glance object with type:split (webhooks prevent this operation)
26+
# we delete this unused API.
27+
# https://github.com/openstack-k8s-operators/glance-operator/blob/main/docs/design-decisions.md#decommissioning-a-glanceapi
28+
- name: Decommission the default API
29+
ansible.builtin.shell: |
30+
{{ shell_header }}
31+
{{ oc_header }}
32+
oc patch openstackcontrolplane openstack --type=json -p="[{'op': 'remove', 'path': '/spec/glance/template/glanceAPIs/default'}]"

tests/roles/glance_adoption/templates/glance_nfs.yaml.j2

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
spec:
22
glance:
3+
enabled: true
34
template:
4-
customServiceConfig: |
5-
[DEFAULT]
6-
enabled_backends = default_backend:file
7-
[glance_store]
8-
default_backend = default_backend
9-
[default_backend]
10-
filesystem_store_datadir = /var/lib/glance/images/
115
databaseInstance: openstack
6+
keystoneEndpoint: nfs
127
glanceAPIs:
13-
default:
8+
nfs:
149
replicas: 3
1510
type: single
11+
customServiceConfig: |
12+
[DEFAULT]
13+
enabled_backends = default_backend:file
14+
[glance_store]
15+
default_backend = default_backend
16+
[default_backend]
17+
filesystem_store_datadir = /var/lib/glance/images/
18+
override:
19+
service:
20+
internal:
21+
metadata:
22+
annotations:
23+
metallb.universe.tf/address-pool: internalapi
24+
metallb.universe.tf/allow-shared-ip: internalapi
25+
metallb.universe.tf/loadBalancerIPs: {{ internalapi_prefix | default('172.17.0') }}.80
26+
spec:
27+
type: LoadBalancer
28+
networkAttachments:
29+
- storage
1630
extraMounts:
1731
- extraVol:
1832
- extraVolType: NFS

0 commit comments

Comments
 (0)