Tinoj Joseph | dd1fd9d | 2022-08-01 23:59:26 +0530 | [diff] [blame^] | 1 | # 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 | --- |
| 17 | apiVersion: v1 |
| 18 | kind: PersistentVolume |
| 19 | metadata: |
| 20 | name: redis-data-{{ template "redis.fullname" . }}-node-0 |
| 21 | labels: |
| 22 | type: local |
| 23 | spec: |
| 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 | --- |
| 44 | apiVersion: v1 |
| 45 | kind: PersistentVolume |
| 46 | metadata: |
| 47 | name: redis-data-{{ template "redis.fullname" . }}-node-1 |
| 48 | labels: |
| 49 | type: local |
| 50 | spec: |
| 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 | --- |
| 71 | apiVersion: v1 |
| 72 | kind: PersistentVolume |
| 73 | metadata: |
| 74 | name: redis-data-{{ template "redis.fullname" . }}-node-2 |
| 75 | labels: |
| 76 | type: local |
| 77 | spec: |
| 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 | --- |
| 98 | apiVersion: v1 |
| 99 | kind: PersistentVolumeClaim |
| 100 | metadata: |
| 101 | name: redis-data-{{ template "redis.fullname" . }}-node-0 |
| 102 | spec: |
| 103 | accessModes: |
| 104 | - "ReadWriteOnce" |
| 105 | resources: |
| 106 | requests: |
| 107 | storage: "2Gi" |
| 108 | |
| 109 | --- |
| 110 | apiVersion: v1 |
| 111 | kind: PersistentVolumeClaim |
| 112 | metadata: |
| 113 | name: redis-data-{{ template "redis.fullname" . }}-node-1 |
| 114 | spec: |
| 115 | accessModes: |
| 116 | - "ReadWriteOnce" |
| 117 | resources: |
| 118 | requests: |
| 119 | storage: "2Gi" |
| 120 | |
| 121 | --- |
| 122 | apiVersion: v1 |
| 123 | kind: PersistentVolumeClaim |
| 124 | metadata: |
| 125 | name: redis-data-{{ template "redis.fullname" . }}-node-2 |
| 126 | spec: |
| 127 | accessModes: |
| 128 | - "ReadWriteOnce" |
| 129 | resources: |
| 130 | requests: |
| 131 | storage: "2Gi" |
| 132 | |
| 133 | {{- else }} |
| 134 | --- |
| 135 | apiVersion: v1 |
| 136 | kind: PersistentVolume |
| 137 | metadata: |
| 138 | name: redis-data-{{ template "redis.fullname" . }}-0 |
| 139 | labels: |
| 140 | type: local |
| 141 | spec: |
| 142 | capacity: |
| 143 | storage: 2Gi |
| 144 | accessModes: |
| 145 | - ReadWriteOnce |
| 146 | hostPath: |
| 147 | path: "{{ .Values.global.volumePath }}/data/redis" |
| 148 | |
| 149 | |
| 150 | --- |
| 151 | apiVersion: v1 |
| 152 | kind: PersistentVolumeClaim |
| 153 | metadata: |
| 154 | name: redis-data-{{ template "redis.fullname" . }}-0 |
| 155 | spec: |
| 156 | accessModes: |
| 157 | - "ReadWriteOnce" |
| 158 | resources: |
| 159 | requests: |
| 160 | storage: "2Gi" |
| 161 | |
| 162 | |
| 163 | {{- end }} |
| 164 | |