From 2ee28a5a7a82116e1854d92713a315490c9f259b Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 15 Jan 2021 16:39:50 -0500 Subject: [SDNC] Move ODL persistent data to pvc In OpenDaylight, there are three types of data that we want to retain: - exported backups (stored in /opt/opendaylight/daexim) - journals (stored in /opt/opendaylight/journal) - snapshots (stored in /opt/opendaylight/snapshots) This change saves all 3 directories to the sdnc persistent volume so that they are retained across restarts. Issue-ID: SDNC-1455 Signed-off-by: Dan Timoney Change-Id: I6b068c7a7bce294f94f9697a34027010bb5bfe8f --- kubernetes/sdnc/templates/pv-data.yaml | 57 +++++++++------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) (limited to 'kubernetes/sdnc/templates/pv-data.yaml') diff --git a/kubernetes/sdnc/templates/pv-data.yaml b/kubernetes/sdnc/templates/pv-data.yaml index e40bdd6ea3..a0d998cd07 100644 --- a/kubernetes/sdnc/templates/pv-data.yaml +++ b/kubernetes/sdnc/templates/pv-data.yaml @@ -1,46 +1,17 @@ {{/* -# Copyright © 2018 Amdocs, AT&T, Bell Canada -# # -# # Licensed under the Apache License, Version 2.0 (the "License"); -# # you may not use this file except in compliance with the License. -# # You may obtain a copy of the License at -# # -# # http://www.apache.org/licenses/LICENSE-2.0 -# # -# # Unless required by applicable law or agreed to in writing, software -# # distributed under the License is distributed on an "AS IS" BASIS, -# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# # See the License for the specific language governing permissions and -# # limitations under the License. +# Copyright © 2018 Amdocs, Bell Canada, AT&T +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. */}} -{{- $global := . }} -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} -{{- if eq "True" (include "common.needPV" .) -}} -{{- range $i := until (int $global.Values.replicaCount)}} -kind: PersistentVolume -apiVersion: v1 -metadata: - name: {{ include "common.fullname" $global }}-data-{{ $i }} - namespace: {{ include "common.namespace" $global }} - labels: - app: {{ include "common.fullname" $global }} - chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}" - release: "{{ include "common.release" $global }}" - heritage: "{{ $global.Release.Service }}" - name: {{ include "common.fullname" $global }} -spec: - capacity: - storage: {{ $global.Values.persistence.size}} - accessModes: - - {{ $global.Values.persistence.accessMode }} - storageClassName: "{{ include "common.fullname" $global }}-data" - persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }} - hostPath: - path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ include "common.release" $global }}/{{ $global.Values.persistence.mountSubPath }}-{{$i}} -{{if ne $i (int $global.Values.replicaCount) }} ---- -{{- end -}} -{{- end -}} -{{- end -}} -{{- end -}} +{{ include "common.replicaPV" . }} -- cgit 1.2.3-korg