Merge "vvp -- VNF Validation Platform"
[oom.git] / kubernetes / common / music / charts / music-cassandra / templates / volumes.yaml
1 {{/*
2 # Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16
17 {{ if .Values.persistence.enabled }}
18 {{- $root := . -}}
19 {{ range $i, $e := until (atoi (quote $root.Values.replicaCount) | default 3) }}
20 ---
21 apiVersion: v1
22 kind: PersistentVolume
23 metadata:
24   name: {{ $root.Release.Name }}-{{ $root.Values.service.name }}-{{ $i }}
25   namespace: {{ $root.Release.Namespace }}
26   labels:
27     type: {{ $root.Values.persistence.storageType }}
28     app: {{ $root.Values.service.name }}
29     chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}
30     release: {{ $root.Release.Name }}
31     heritage: {{ $root.Release.Service }}
32 spec:
33   capacity:
34     storage: {{ $root.Values.persistence.size }}
35   accessModes:
36     - {{ $root.Values.persistence.accessMode }}
37   hostPath:
38     path: {{ $root.Values.persistence.mountPath }}/{{ $root.Release.Name }}/{{ $root.Values.persistence.mountSubPath }}-{{$i}}
39   persistentVolumeReclaimPolicy: {{ $root.Values.persistence.volumeReclaimPolicy }}
40   podAntiAffinity:
41     preferredDuringSchedulingIgnoredDuringExecution:
42     - weight: 1
43       podAffinityTerm:
44         labelSelector:
45           matchExpressions:
46             - key: app
47               operator: In
48               values:
49               - "{{ $root.Chart.Name }}"
50         topologyKey: kubernetes.io/hostname
51 {{ end }}
52 {{ end }}