diff --git a/docs_dev/assemblies/development_environment.adoc b/docs_dev/assemblies/development_environment.adoc index 6fd4e605a..335da8ff3 100644 --- a/docs_dev/assemblies/development_environment.adoc +++ b/docs_dev/assemblies/development_environment.adoc @@ -101,10 +101,15 @@ cat << EOF > /tmp/addtional_nets.json EOF export EDPM_COMPUTE_ADDITIONAL_NETWORKS=$(jq -c . /tmp/addtional_nets.json) export STANDALONE_COMPUTE_DRIVER=ironic -export NTP_SERVER=pool.ntp.org # Only neccecary if not on the RedHat network ... +export NTP_SERVER=pool.ntp.org # Only necessary if not on the RedHat network ... export EDPM_COMPUTE_CEPH_ENABLED=false # Optional ---- +[Note] +=== +If `EDPM_COMPUTE_CEPH_ENABLED=false` is set, TripleO configures `Glance` with +`Swift` as a backend. +=== ''' Use the https://github.com/openstack-k8s-operators/install_yamls/tree/main/devsetup[install_yamls devsetup] diff --git a/docs_user/modules/openstack-glance_adoption.adoc b/docs_user/modules/openstack-glance_adoption.adoc index 231206650..526a773fa 100644 --- a/docs_user/modules/openstack-glance_adoption.adoc +++ b/docs_user/modules/openstack-glance_adoption.adoc @@ -66,6 +66,101 @@ spec: ' ---- +=== Using swift backend + +When Glance is deployed with Swift as a backend in the source environment based +on TripleO, the podified `glanceAPI` instance should be deployed with the following +configuration: + +---- +.. +spec + glance: + ... + customServiceConfig: | + [DEFAULT] + enabled_backends = default_backend:swift + [glance_store] + default_backend = default_backend + [default_backend] + swift_store_create_container_on_put = True + swift_store_auth_version = 3 + swift_store_auth_address = {{ .KeystoneInternalURL }} + swift_store_endpoint_type = internalURL + swift_store_user = service:glance + swift_store_key = {{ .ServicePassword }} +---- + +It is recommended to write the patch manifest into a file, for example `glance_swift.patch`, +and then apply it with the following command: + +---- +oc patch openstackcontrolplane openstack --type=merge --patch-file=glance_swift.patch +---- + +For example, the Glance deployment with a Swift backend would look like this: + +---- +spec: + glance: + enabled: true + apiOverride: + route: {} + template: + databaseInstance: openstack + storageClass: "local-storage" + storageRequest: 10G + customServiceConfig: | + [DEFAULT] + enabled_backends = default_backend:swift + [glance_store] + default_backend = default_backend + [default_backend] + swift_store_create_container_on_put = True + swift_store_auth_version = 3 + swift_store_auth_address = {{ .KeystoneInternalURL }} + swift_store_endpoint_type = internalURL + swift_store_user = service:glance + swift_store_key = {{ .ServicePassword }} + glanceAPIs: + default: + replicas: 0 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage +---- + +The example above sets `GlanceAPI` `replicas:0`. Having `Swift` as a backend, +establishes a dependency between the two services, and any deployed `GlanceAPI` +instance would **not work** if `Glance` is configured with `Swift` thae is +still not available in the `OpenStackControlPlane`. +Once Swift, and in particular `SwiftProxy`, has been adopted through the +procedure described in <>, it is possible +to set `GlanceAPI` `replicas:1` (or. greater that 1). + +Verify that `SwiftProxy` is available with the following command: + +---- +$ oc get pod -l component=swift-proxy | grep Running +swift-proxy-75cb47f65-92rxq 3/3 Running 0 +---- + +If the output is similar to the above, it is possible to move forward and patch +the `GlanceAPI` service deployed in the podified context. + +--- +$ oc patch glance glance --type=json -p="[{'op': 'replace', 'path': '/spec/glanceAPIs/default/replicas', value: 1}]" +--- + === Using NFS backend When the source Cloud based on TripleO uses Glance with a NFS backend, before diff --git a/tests/roles/glance_adoption/defaults/main.yaml b/tests/roles/glance_adoption/defaults/main.yaml index ba9775a51..275244f68 100644 --- a/tests/roles/glance_adoption/defaults/main.yaml +++ b/tests/roles/glance_adoption/defaults/main.yaml @@ -1,2 +1,2 @@ -# glance_backend can be 'local' or 'ceph' +# glance_backend can be 'local', 'ceph' or 'swift' glance_backend: local diff --git a/tests/roles/glance_adoption/tasks/main.yaml b/tests/roles/glance_adoption/tasks/main.yaml index fd7e08f0b..c7463350e 100644 --- a/tests/roles/glance_adoption/tasks/main.yaml +++ b/tests/roles/glance_adoption/tasks/main.yaml @@ -76,6 +76,48 @@ ' when: glance_backend == 'ceph' +- name: deploy podified Glance with Swift backend + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + glance: + enabled: true + template: + databaseInstance: openstack + customServiceConfig: | + [DEFAULT] + enabled_backends = default_backend:swift + [glance_store] + default_backend = default_backend + [default_backend] + swift_store_create_container_on_put = True + swift_store_auth_version = 3 + swift_store_auth_address = {{ .KeystoneInternalURL }} + swift_store_endpoint_type = internalURL + swift_store_user = service:glance + swift_store_key = {{ .ServicePassword }} + storageClass: "local-storage" + storageRequest: 10G + glanceAPIs: + default: + replicas: 1 + override: + service: + internal: + metadata: + annotations: + metallb.universe.tf/address-pool: internalapi + metallb.universe.tf/allow-shared-ip: internalapi + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 + spec: + type: LoadBalancer + networkAttachments: + - storage + ' + when: glance_backend == 'swift' + - name: wait for Glance to start up ansible.builtin.shell: | {{ shell_header }}