Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | {{- /* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 2 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 3 | # Copyright 2019-present Open Networking Foundation |
| 4 | # |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 5 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 6 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 7 | */ -}} |
| 8 | |
| 9 | {{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.service_account" }} |
| 10 | --- |
| 11 | apiVersion: apps/v1 |
| 12 | kind: StatefulSet |
| 13 | metadata: |
| 14 | name: accelleran-cbrs-redis |
| 15 | labels: |
| 16 | {{ tuple "accelleran-cbrs-redis" . | include "accelleran-cbrs-common.metadata_labels" | indent 4 }} |
| 17 | spec: |
| 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 Moon | 8da1788 | 2020-10-14 21:28:44 -0500 | [diff] [blame] | 32 | {{- if .Values.images.credentials }} |
| 33 | imagePullSecrets: |
| 34 | - name: {{ .Release.Name }}.registry |
| 35 | {{- end }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 36 | 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 Moon | bb68dfc | 2020-10-08 16:35:27 -0700 | [diff] [blame] | 51 | {{- if not .Values.config.redis.persistence.enabled }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 52 | - name: redis-data-volume |
| 53 | hostPath: |
Hyunsun Moon | bb68dfc | 2020-10-08 16:35:27 -0700 | [diff] [blame] | 54 | path: /etc/redis-storage |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 55 | type: DirectoryOrCreate |
Hyunsun Moon | bb68dfc | 2020-10-08 16:35:27 -0700 | [diff] [blame] | 56 | {{- 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 }} |