From 884fdc05c94badbed81b611899fe1555fc87309c Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Tue, 13 Aug 2024 08:15:40 -0500 Subject: [PATCH] Remove deprecated glance config options These options are: `stores` and `default_store` which have been deprecated since Rocky. Also add the possibility to use local (hostPath) directory for filesystem backend. Change-Id: Ibf1994a54eed2a0742fb8e16ab94ada030d3bc64 --- glance/Chart.yaml | 2 +- glance/templates/configmap-etc.yaml | 30 ++++++++++++-------------- glance/templates/deployment-api.yaml | 17 +++++++++------ glance/templates/job-storage-init.yaml | 10 ++++----- glance/values.yaml | 25 +++++++++++++++++++++ glance/values_overrides/tls.yaml | 1 + releasenotes/notes/glance.yaml | 1 + zuul.d/base.yaml | 12 +++++------ zuul.d/project.yaml | 2 +- 9 files changed, 65 insertions(+), 35 deletions(-) diff --git a/glance/Chart.yaml b/glance/Chart.yaml index 55e4196484..549138c87b 100644 --- a/glance/Chart.yaml +++ b/glance/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Glance name: glance -version: 0.4.26 +version: 0.5.0 home: https://docs.openstack.org/glance/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Glance/OpenStack_Project_Glance_vertical.png sources: diff --git a/glance/templates/configmap-etc.yaml b/glance/templates/configmap-etc.yaml index 5a5f1c2814..5fdb7a5ea5 100644 --- a/glance/templates/configmap-etc.yaml +++ b/glance/templates/configmap-etc.yaml @@ -72,27 +72,25 @@ limitations under the License. {{- $_ := tuple "image" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.glance.DEFAULT "public_endpoint" -}} {{- end -}} -{{- if empty .Values.conf.glance.glance_store.stores -}} +{{- if empty .Values.conf.glance.DEFAULT.enabled_backends -}} {{- if eq .Values.storage "rbd" }} -{{- $_ := "file, http, rbd" | set .Values.conf.glance.glance_store "stores" -}} -{{- end -}} -{{- if eq .Values.storage "pvc" }} -{{- $_ := "file, http" | set .Values.conf.glance.glance_store "stores" -}} -{{- end -}} -{{ if or (eq .Values.storage "radosgw") (eq .Values.storage "swift") }} -{{- $_ := "file, http, swift" | set .Values.conf.glance.glance_store "stores" -}} +{{- $_ := "file:file,http:http,rbd:rbd" | set .Values.conf.glance.DEFAULT "enabled_backends" -}} +{{- else if or (eq .Values.storage "radosgw") (eq .Values.storage "swift") }} +{{- $_ := "file:file,http:http,swift:swift" | set .Values.conf.glance.DEFAULT "enabled_backends" -}} +{{- else -}} +{{/* pvc, local (hostPath) or other/ephemeral (emptyDir) */}} +{{- $_ := "file:file,http:http" | set .Values.conf.glance.DEFAULT "enabled_backends" -}} {{- end -}} {{- end -}} -{{- if empty .Values.conf.glance.glance_store.default_store -}} +{{- if empty .Values.conf.glance.glance_store.default_backend -}} {{- if eq .Values.storage "rbd" }} -{{- $_ := "rbd" | set .Values.conf.glance.glance_store "default_store" -}} -{{- end -}} -{{- if eq .Values.storage "pvc" }} -{{- $_ := "file" | set .Values.conf.glance.glance_store "default_store" -}} -{{- end -}} -{{ if or (eq .Values.storage "radosgw") (eq .Values.storage "swift") }} -{{- $_ := "swift" | set .Values.conf.glance.glance_store "default_store" -}} +{{- $_ := "rbd" | set .Values.conf.glance.glance_store "default_backend" -}} +{{- else if or (eq .Values.storage "radosgw") (eq .Values.storage "swift") }} +{{- $_ := "swift" | set .Values.conf.glance.glance_store "default_backend" -}} +{{- else -}} +{{/* pvc, local (hostPath) or other/ephemeral (emptyDir) */}} +{{- $_ := "file" | set .Values.conf.glance.glance_store "default_backend" -}} {{- end -}} {{- end -}} diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml index bfeaf26bff..8a8e28447a 100644 --- a/glance/templates/deployment-api.yaml +++ b/glance/templates/deployment-api.yaml @@ -103,19 +103,19 @@ spec: - chown - -R - "glance:" - - {{ .Values.conf.glance.glance_store.filesystem_store_datadir }} + - {{ .Values.conf.glance.file.filesystem_store_datadir }} volumeMounts: - name: pod-tmp mountPath: /tmp - name: glance-images - mountPath: {{ .Values.conf.glance.glance_store.filesystem_store_datadir }} + mountPath: {{ .Values.conf.glance.file.filesystem_store_datadir }} {{ if eq .Values.storage "rbd" }} - name: ceph-keyring-placement {{ tuple $envAll "glance_api" | include "helm-toolkit.snippets.image" | indent 10 }} {{ dict "envAll" $envAll "application" "glance" "container" "ceph_keyring_placement" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} env: - name: RBD_STORE_USER - value: {{ .Values.conf.glance.glance_store.rbd_store_user | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_user | quote }} command: - /tmp/ceph-keyring.sh volumeMounts: @@ -258,11 +258,11 @@ spec: {{- end }} {{- end }} - name: glance-etc - mountPath: {{ .Values.conf.glance.glance_store.swift_store_config_file }} + mountPath: {{ .Values.conf.glance.swift.swift_store_config_file }} subPath: swift-store.conf readOnly: true - name: glance-images - mountPath: {{ .Values.conf.glance.glance_store.filesystem_store_datadir }} + mountPath: {{ .Values.conf.glance.file.filesystem_store_datadir }} {{- if eq .Values.storage "cinder" }} - name: host-rootfs mountPath: /mnt/host-rootfs @@ -338,7 +338,12 @@ spec: - name: glance-images persistentVolumeClaim: claimName: glance-images -{{ else }} +{{ else if eq .Values.storage "local" }} + - name: glance-images + hostPath: + path: {{ .Values.conf.glance.file.filesystem_store_datadir }} + type: DirectoryOrCreate +{{- else }} - name: glance-images emptyDir: {} {{- end }} diff --git a/glance/templates/job-storage-init.yaml b/glance/templates/job-storage-init.yaml index f2890df425..be9d2331ba 100644 --- a/glance/templates/job-storage-init.yaml +++ b/glance/templates/job-storage-init.yaml @@ -112,17 +112,17 @@ spec: value: {{ .Values.storage | quote }} {{- if eq .Values.storage "rbd" }} - name: RBD_POOL_NAME - value: {{ .Values.conf.glance.glance_store.rbd_store_pool | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_pool | quote }} - name: RBD_POOL_APP_NAME value: {{ .Values.conf.software.rbd.rbd_store_pool_app_name | quote }} - name: RBD_POOL_USER - value: {{ .Values.conf.glance.glance_store.rbd_store_user | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_user | quote }} - name: RBD_POOL_REPLICATION - value: {{ .Values.conf.glance.glance_store.rbd_store_replication | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_replication | quote }} - name: RBD_POOL_CRUSH_RULE - value: {{ .Values.conf.glance.glance_store.rbd_store_crush_rule | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_crush_rule | quote }} - name: RBD_POOL_CHUNK_SIZE - value: {{ .Values.conf.glance.glance_store.rbd_store_chunk_size | quote }} + value: {{ .Values.conf.glance.rbd.rbd_store_chunk_size | quote }} - name: RBD_POOL_SECRET value: {{ .Values.secrets.rbd | quote }} {{ end }} diff --git a/glance/values.yaml b/glance/values.yaml index 2f881f3ac7..38e32b844a 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -260,6 +260,10 @@ conf: memcache_security_strategy: ENCRYPT service_type: image glance_store: + # Since 2024.1 this section must contain the only key 'default_backend'. + # Other keys should be defined in the corresponding per-backend sections. + # This is for backward compatibility. + filesystem_store_datadir: /var/lib/glance/images cinder_catalog_info: volumev3::internalURL rbd_store_chunk_size: 8 rbd_store_replication: 3 @@ -267,7 +271,28 @@ conf: rbd_store_pool: glance.images rbd_store_user: glance rbd_store_ceph_conf: /etc/ceph/ceph.conf + default_swift_reference: ref1 + swift_store_container: glance + swift_store_create_container_on_put: true + swift_store_config_file: /etc/glance/swift-store.conf + swift_store_endpoint_type: internalURL + file: filesystem_store_datadir: /var/lib/glance/images + # These two sections os_glance_tasks_store and os_glance_staging_store + # are mandatory. Glance will be unable to delete images from if these + # two are not properly configured. + os_glance_tasks_store: + filesystem_store_datadir: /var/lib/glance/tmp/os_glance_tasks_store + os_glance_staging_store: + filesystem_store_datadir: /var/lib/glance/tmp/os_glance_staging_store + rbd: + rbd_store_chunk_size: 8 + rbd_store_replication: 3 + rbd_store_crush_rule: replicated_rule + rbd_store_pool: glance.images + rbd_store_user: glance + rbd_store_ceph_conf: /etc/ceph/ceph.conf + swift: default_swift_reference: ref1 swift_store_container: glance swift_store_create_container_on_put: true diff --git a/glance/values_overrides/tls.yaml b/glance/values_overrides/tls.yaml index d1aa35ad02..86cba6087d 100644 --- a/glance/values_overrides/tls.yaml +++ b/glance/values_overrides/tls.yaml @@ -7,6 +7,7 @@ conf: keystone_authtoken: cafile: /etc/glance/certs/ca.crt glance_store: + # This option has been removed in 2024.1 https_ca_certificates_file: /etc/glance/certs/ca.crt swift_store_cacert: /etc/glance/certs/ca.crt oslo_messaging_rabbit: diff --git a/releasenotes/notes/glance.yaml b/releasenotes/notes/glance.yaml index 8cb58c54a5..f3438339dc 100644 --- a/releasenotes/notes/glance.yaml +++ b/releasenotes/notes/glance.yaml @@ -60,4 +60,5 @@ glance: - 0.4.24 Do not attach backend pvc to storage init pod - 0.4.25 Allow customisation of pvc storage accessMode so we can run multiple api pods - 0.4.26 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default + - 0.5.0 Remove deprecated config options `stores` and `default_store` ... diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 1812092b42..b778771f19 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -84,7 +84,7 @@ - ./tools/deployment/component/common/memcached.sh - ./tools/deployment/component/keystone/keystone.sh - ./tools/deployment/component/heat/heat.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - ./tools/deployment/component/compute-kit/openvswitch.sh - ./tools/deployment/component/compute-kit/libvirt.sh - ./tools/deployment/component/compute-kit/compute-kit.sh @@ -138,7 +138,7 @@ - ./tools/deployment/component/common/memcached.sh - ./tools/deployment/component/keystone/keystone.sh - - ./tools/deployment/component/heat/heat.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - ./tools/deployment/component/compute-kit/openvswitch.sh - ./tools/deployment/component/compute-kit/libvirt.sh - ./tools/deployment/component/compute-kit/compute-kit.sh @@ -168,7 +168,7 @@ - ./tools/deployment/component/common/memcached.sh - ./tools/deployment/component/keystone/keystone.sh - - ./tools/deployment/component/heat/heat.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - ./tools/deployment/component/compute-kit/openvswitch.sh - ./tools/deployment/component/compute-kit/libvirt.sh - ./tools/deployment/component/compute-kit/compute-kit.sh @@ -194,7 +194,7 @@ - ./tools/deployment/component/common/memcached.sh - ./tools/deployment/component/keystone/keystone.sh - - ./tools/deployment/component/heat/heat.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - ./tools/deployment/component/compute-kit/openvswitch.sh - ./tools/deployment/component/compute-kit/libvirt.sh - ./tools/deployment/component/ovn/ovn.sh @@ -299,7 +299,7 @@ - ./tools/deployment/common/prepare-charts.sh - ./tools/deployment/common/setup-client.sh - ./tools/deployment/common/ingress.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/common/openstack.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/common/openstack.sh - export HELM_TESTS_TRIES=3; export OSH_TEST_TIMEOUT=1200; ./tools/deployment/common/run-helm-tests.sh openstack - ./tools/deployment/common/use-it.sh - ./tools/deployment/common/force-cronjob-run.sh @@ -373,7 +373,7 @@ - ./tools/deployment/component/common/memcached.sh - ./tools/deployment/component/keystone/keystone.sh - - ./tools/deployment/component/heat/heat.sh - - export GLANCE_BACKEND=memory; ./tools/deployment/component/glance/glance.sh + - export GLANCE_BACKEND=local; ./tools/deployment/component/glance/glance.sh - ./tools/deployment/component/compute-kit/openvswitch.sh - ./tools/deployment/component/compute-kit/libvirt.sh - ./tools/deployment/component/compute-kit/compute-kit.sh diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 122ce3383c..ea85f2f3ae 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -34,7 +34,7 @@ - openstack-helm-compute-kit-2023-2-ubuntu_jammy # 3 nodes - openstack-helm-compute-kit-ovn-2023-2-ubuntu_jammy # 3 nodes # 2024.1 - - openstack-helm-umbrella-2024-1-ubuntu_jammy # 3 nodes + - openstack-helm-umbrella-2024-1-ubuntu_jammy # 3 nodes rook - openstack-helm-tls-2024-1-ubuntu_jammy # 3 nodes rook - openstack-helm-cinder-2024-1-ubuntu_jammy # 3 nodes rook - openstack-helm-compute-kit-2024-1-ubuntu_jammy # 3 nodes