Allows keep glance-images PVC once defined

Glance image PVC contains requires images that should be careful handled
during changing glance storage when migrate out of PVC mode for glance
storage.
Which in migrate/upgrade path, should be be correctly moved and deleted
the PVC after.

On the other hand, it's also possible to accidentally changes storage
mode out of `pvc` and lose the `glance-images` PVC which is unbearable
mistake.

Once storage mode set to `pvc, we should allow that PVC to be able to
stay and ready for reuse again until it's mannually deleted.

This add flag `keep_pvc` (default to true).
Set it to true to set helm/resource-policy to keep for glance-images.
Set it to false to allow helm delete glance-images PVC when request.

Change-Id: I9d0e2a49aabf81eb2d4e00ad2a9d42125261489e
This commit is contained in:
ricolin 2023-08-24 23:17:03 +08:00
parent 2387723306
commit f074a65ba1
4 changed files with 13 additions and 1 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Glance description: OpenStack-Helm Glance
name: glance name: glance
version: 0.4.11 version: 0.4.12
home: https://docs.openstack.org/glance/latest/ home: https://docs.openstack.org/glance/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Glance/OpenStack_Project_Glance_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Glance/OpenStack_Project_Glance_vertical.png
sources: sources:

View File

@ -20,6 +20,10 @@ kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: glance-images name: glance-images
{{- if .Values.keep_pvc }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
spec: spec:
accessModes: [ "ReadWriteOnce" ] accessModes: [ "ReadWriteOnce" ]
resources: resources:

View File

@ -1026,4 +1026,11 @@ manifests:
secret_registry: true secret_registry: true
service_ingress_api: true service_ingress_api: true
service_api: true service_api: true
# NOTE: This is for enable helm resource-policy to keep glance-images PVC.
# set keep_pvc: true when allow helm resource-policy to keep for PVC.
# This will requires mannual delete for PVC.
# set keep_pvc: false when disallow helm resource-policy to keep for PVC.
# This will allow helm to delete the PVC.
keep_pvc: true
... ...

View File

@ -45,4 +45,5 @@ glance:
- 0.4.9 Use service tokens - 0.4.9 Use service tokens
- 0.4.10 Add exec probe timeouts - 0.4.10 Add exec probe timeouts
- 0.4.11 Bring liveness/readiness params out to values.yaml - 0.4.11 Bring liveness/readiness params out to values.yaml
- 0.4.12 Add flag `keep_pvc` to allows set helm resource-policy for glance-images PVC to keep.
... ...