blob: d1980ee7b977a828c252e6b54136ce53178dbdbc [file] [log] [blame]
Tinoj Josephdd1fd9d2022-08-01 23:59:26 +05301# Copyright 2022-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15{{- if and .Values.global.redis.cluster.enabled .Values.global.redis.sentinel.enabled }}
16---
17apiVersion: v1
18kind: PersistentVolume
19metadata:
20 name: redis-data-{{ template "redis.fullname" . }}-node-0
21 labels:
22 type: local
23spec:
24 capacity:
25 storage: 2Gi
26 accessModes:
27 - ReadWriteOnce
28 claimRef:
29 apiVersion: v1
30 kind: PersistentVolumeClaim
31 name: redis-data-{{ template "redis.fullname" . }}-node-0
32 namespace: default
33 hostPath:
34 path: "{{ .Values.global.redis.volumePath }}/redis"
35 nodeAffinity:
36 required:
37 nodeSelectorTerms:
38 - matchExpressions:
39 - key: kubernetes.io/hostname
40 operator: In
41 values:
42 - {{ .Values.global.hostname.worker1 }}
43---
44apiVersion: v1
45kind: PersistentVolume
46metadata:
47 name: redis-data-{{ template "redis.fullname" . }}-node-1
48 labels:
49 type: local
50spec:
51 capacity:
52 storage: 2Gi
53 accessModes:
54 - ReadWriteOnce
55 claimRef:
56 apiVersion: v1
57 kind: PersistentVolumeClaim
58 name: redis-data-{{ template "redis.fullname" . }}-node-1
59 namespace: default
60 hostPath:
61 path: "{{ .Values.global.redis.volumePath }}/redis"
62 nodeAffinity:
63 required:
64 nodeSelectorTerms:
65 - matchExpressions:
66 - key: kubernetes.io/hostname
67 operator: In
68 values:
69 - {{ .Values.global.hostname.worker2 }}
70---
71apiVersion: v1
72kind: PersistentVolume
73metadata:
74 name: redis-data-{{ template "redis.fullname" . }}-node-2
75 labels:
76 type: local
77spec:
78 capacity:
79 storage: 2Gi
80 accessModes:
81 - ReadWriteOnce
82 claimRef:
83 apiVersion: v1
84 kind: PersistentVolumeClaim
85 name: redis-data-{{ template "redis.fullname" . }}-node-2
86 namespace: default
87 hostPath:
88 path: "{{ .Values.global.redis.volumePath }}/redis"
89 nodeAffinity:
90 required:
91 nodeSelectorTerms:
92 - matchExpressions:
93 - key: kubernetes.io/hostname
94 operator: In
95 values:
96 - {{ .Values.global.hostname.worker3 }}
97---
98apiVersion: v1
99kind: PersistentVolumeClaim
100metadata:
101 name: redis-data-{{ template "redis.fullname" . }}-node-0
102spec:
103 accessModes:
104 - "ReadWriteOnce"
105 resources:
106 requests:
107 storage: "2Gi"
108
109---
110apiVersion: v1
111kind: PersistentVolumeClaim
112metadata:
113 name: redis-data-{{ template "redis.fullname" . }}-node-1
114spec:
115 accessModes:
116 - "ReadWriteOnce"
117 resources:
118 requests:
119 storage: "2Gi"
120
121---
122apiVersion: v1
123kind: PersistentVolumeClaim
124metadata:
125 name: redis-data-{{ template "redis.fullname" . }}-node-2
126spec:
127 accessModes:
128 - "ReadWriteOnce"
129 resources:
130 requests:
131 storage: "2Gi"
132
133{{- else }}
134---
135apiVersion: v1
136kind: PersistentVolume
137metadata:
138 name: redis-data-{{ template "redis.fullname" . }}-0
139 labels:
140 type: local
141spec:
142 capacity:
143 storage: 2Gi
144 accessModes:
145 - ReadWriteOnce
146 hostPath:
147 path: "{{ .Values.global.volumePath }}/data/redis"
148
149
150---
151apiVersion: v1
152kind: PersistentVolumeClaim
153metadata:
154 name: redis-data-{{ template "redis.fullname" . }}-0
155spec:
156 accessModes:
157 - "ReadWriteOnce"
158 resources:
159 requests:
160 storage: "2Gi"
161
162
163{{- end }}
164