blob: d1980ee7b977a828c252e6b54136ce53178dbdbc [file] [log] [blame]
# Copyright 2022-present Open Networking Foundation
#
# 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.
{{- if and .Values.global.redis.cluster.enabled .Values.global.redis.sentinel.enabled }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-0
labels:
type: local
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: redis-data-{{ template "redis.fullname" . }}-node-0
namespace: default
hostPath:
path: "{{ .Values.global.redis.volumePath }}/redis"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.global.hostname.worker1 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-1
labels:
type: local
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: redis-data-{{ template "redis.fullname" . }}-node-1
namespace: default
hostPath:
path: "{{ .Values.global.redis.volumePath }}/redis"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.global.hostname.worker2 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-2
labels:
type: local
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: redis-data-{{ template "redis.fullname" . }}-node-2
namespace: default
hostPath:
path: "{{ .Values.global.redis.volumePath }}/redis"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .Values.global.hostname.worker3 }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-0
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-1
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data-{{ template "redis.fullname" . }}-node-2
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
{{- else }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-data-{{ template "redis.fullname" . }}-0
labels:
type: local
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "{{ .Values.global.volumePath }}/data/redis"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data-{{ template "redis.fullname" . }}-0
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
{{- end }}