Update helm charts config maps after sx-dx migration with new CEPH monitors

This commit adds annotations that allows config maps to be recreated
after ceph monitor IP changes due to DX migration so that existing
StorageClasses can get a reference to the correct monitor. StorageClasses
and provisioners are recreated during platform-integ-apps auto re-apply.

Story: 2008587
Task: 42242

Signed-off-by: Pedro Linhares <PedroHenriqueLinhares.Silva@windriver.com>
Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/783727
Change-Id: I9cedc70326e92796f03520deed7f0857e119257f
This commit is contained in:
Pedro Henrique Linhares 2021-04-06 21:45:28 -03:00
parent bcebf33dc0
commit 66fa48f04d
4 changed files with 45 additions and 6 deletions

View File

@ -0,0 +1,30 @@
{{/*
#
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if .Values.manifests.configmap_ceph_conf }}
{{- $envAll := . }}
{{- $ceph := $envAll.Values.conf.ceph }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $envAll.Values.ceph_client.configmap }}
namespace: {{ $envAll.Release.namespace }}
labels:
app: ceph-pools-audit
annotations:
"helm.sh/hook": "pre-upgrade, pre-install"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
ceph.conf: |
[global]
auth_supported = none
{{ $monitors := $ceph.monitors }}{{ range $index, $element := $monitors}}
[mon.{{- $index }}]
mon_addr = {{ $element }}
{{- end }}
{{- end }}

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2019 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -13,7 +13,7 @@ labels:
name: ceph-pools-audit
ceph_client:
configmap: ceph-etc
configmap: ceph-etc-pools-audit
conf:
ceph:
@ -68,3 +68,4 @@ affinity: {}
manifests:
job_ceph_pools_audit: true
configmap_bin: true
configmap_ceph_conf: true

View File

@ -1,6 +1,6 @@
{{/*
#
# Copyright (c) 2020 Wind River Systems, Inc.
# Copyright (c) 2020-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -15,6 +15,9 @@ kind: ConfigMap
metadata:
name: ceph-config-file
namespace: {{ $defaults.cephFSNamespace }}
annotations:
"helm.sh/hook": "pre-upgrade, pre-install"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
ceph.conf: |
{{ tuple "conf/_ceph-conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
@ -92,4 +95,4 @@ spec:
{{- if .Values.global.nodeSelector }}
nodeSelector:
{{ .Values.global.nodeSelector | toYaml | trim | indent 8 }}
{{- end }}
{{- end }}

View File

@ -1,6 +1,6 @@
{{/*
#
# Copyright (c) 2018 Wind River Systems, Inc.
# Copyright (c) 2018-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -14,9 +14,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: 2016-02-18T19:14:38Z
name: config-{{- $root.Values.global.name }}
namespace: {{ $root.Release.Namespace }}
annotations:
"helm.sh/hook": "pre-upgrade, pre-install"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
ceph.conf: |
{{ $monitors := $defaults.monitors }}{{ range $index, $element := $monitors}}
@ -202,6 +204,9 @@ kind: ConfigMap
metadata:
name: ceph-etc
namespace: {{ $root.Release.Namespace }}
annotations:
"helm.sh/hook": "pre-upgrade, pre-install"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
ceph.conf: |
[global]