blob: 4d3aa3b845c744fa19fc4867ec82d8f372bc63fc [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{- /*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003# Copyright 2019-present Open Networking Foundation
4#
Jeremy Ronquillo6046ce32020-06-18 11:06:29 -07005# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07006
Jeremy Ronquillo223db002020-06-05 10:28:22 -07007*/ -}}
8
9{{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.service_account" }}
10---
11apiVersion: apps/v1
12kind: StatefulSet
13metadata:
14 name: accelleran-cbrs-redis
15 labels:
16{{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.metadata_labels" | indent 4 }}
17spec:
18 selector:
19 matchLabels:
20{{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.metadata_labels" | indent 6 }}
21 serviceName: accelleran-cbrs-redis
22 template:
23 metadata:
24 labels:
25{{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.metadata_labels" | indent 8 }}
26 spec:
27 {{- if .Values.nodeSelectors.enabled }}
28 nodeSelector:
29 {{ .Values.nodeSelectors.accelleranCBRSCommon.label }}: {{ .Values.nodeSelectors.accelleranCBRSCommon.value }}
30 {{- end }}
31 serviceAccountName: accelleran-cbrs-redis
Hyunsun Moon1f868cf2021-05-08 18:26:44 -070032 {{- if hasKey .Values.images "pullSecrets" }}
Hyunsun Moon8da17882020-10-14 21:28:44 -050033 imagePullSecrets:
Hyunsun Moon1f868cf2021-05-08 18:26:44 -070034{{ toYaml .Values.images.pullSecrets | indent 8 }}
Hyunsun Moon8da17882020-10-14 21:28:44 -050035 {{- end }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070036 containers:
37 - name: redis
38 image: {{ .Values.images.tags.redis }}
39 imagePullPolicy: {{ .Values.images.pullPolicy }}
40 command: ["sh", "-c"]
41 args:
42 - /usr/local/bin/redis-server /etc/redis.conf
43 {{- if .Values.resources.enabled }}
44 resources:
45{{ toYaml .Values.resources.accelleranCBRSCommon | indent 10 }}
46 {{- end }}
47 volumeMounts:
48 - mountPath: /data
49 name: redis-data-volume
50 volumes:
Hyunsun Moonbb68dfc2020-10-08 16:35:27 -070051{{- if not .Values.config.redis.persistence.enabled }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070052 - name: redis-data-volume
53 hostPath:
Hyunsun Moonbb68dfc2020-10-08 16:35:27 -070054 path: /etc/redis-storage
Jeremy Ronquillo223db002020-06-05 10:28:22 -070055 type: DirectoryOrCreate
Hyunsun Moonbb68dfc2020-10-08 16:35:27 -070056{{- else }}
57 volumeClaimTemplates:
58 - metadata:
59 name: redis-data-volume
60 labels:
61{{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.metadata_labels" | indent 8 }}
62 spec:
63 accessModes:
64 - {{ .Values.config.redis.persistence.accessMode | quote }}
65 resources:
66 requests:
67 storage: {{ .Values.config.redis.persistence.size | quote }}
68 {{- if .Values.config.redis.persistence.storageClass }}
69 storageClassName: "{{ .Values.config.redis.persistence.storageClass }}"
70 {{- end }}
71{{- end }}