diff --git a/charts/lagoon-core/Chart.yaml b/charts/lagoon-core/Chart.yaml index 81aca95b..c1aabdc9 100644 --- a/charts/lagoon-core/Chart.yaml +++ b/charts/lagoon-core/Chart.yaml @@ -21,7 +21,7 @@ type: application # time you make changes to the chart and its templates, including the app # version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.36.0 +version: 1.37.0 # This is the version number of the application being deployed. This version # number should be incremented each time you make changes to the application. @@ -41,10 +41,4 @@ dependencies: annotations: artifacthub.io/changes: | - kind: changed - description: add additional metrics to broker - - kind: changed - description: update lagoon-ssh-token and lagoon-ssh-portal-api to v0.30.1 - - kind: changed - description: update NATS chart dependency to v0.19.17 - - kind: changed - description: update Lagoon appVersion to v2.15.4 + description: convert api-redis to redis-persistent diff --git a/charts/lagoon-core/ci/linter-values.yaml b/charts/lagoon-core/ci/linter-values.yaml index 1c42e096..6f82c1c5 100644 --- a/charts/lagoon-core/ci/linter-values.yaml +++ b/charts/lagoon-core/ci/linter-values.yaml @@ -45,6 +45,8 @@ apiRedis: resources: requests: cpu: "10m" + persistence: + enabled: false # TODO - update repo/tag before v2.11 release actionsHandler: diff --git a/charts/lagoon-core/templates/api-redis.deployment.yaml b/charts/lagoon-core/templates/api-redis.deployment.yaml index 5d618590..3865f746 100644 --- a/charts/lagoon-core/templates/api-redis.deployment.yaml +++ b/charts/lagoon-core/templates/api-redis.deployment.yaml @@ -36,6 +36,10 @@ spec: secretKeyRef: name: {{ include "lagoon-core.api.fullname" . }} key: REDIS_PASSWORD + {{- if .Values.apiRedis.persistence.enabled }} + - name: FLAVOR + value: persistent + {{- end }} {{- range $key, $val := .Values.apiRedis.additionalEnvs }} - name: {{ $key }} value: {{ $val | quote }} @@ -43,6 +47,11 @@ spec: ports: - name: redis containerPort: 6379 + {{- if .Values.apiRedis.persistence.enabled }} + volumeMounts: + - name: {{ include "lagoon-core.apiRedis.fullname" . }}-data + mountPath: /data + {{- end }} livenessProbe: tcpSocket: port: redis @@ -51,6 +60,12 @@ spec: port: redis resources: {{- toYaml .Values.apiRedis.resources | nindent 10 }} + {{- if .Values.apiRedis.persistence.enabled }} + volumes: + - name: {{ include "lagoon-core.apiRedis.fullname" . }}-data + persistentVolumeClaim: + claimName: {{ include "lagoon-core.apiRedis.fullname" . }}-data + {{- end }} {{- with .Values.apiRedis.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -63,3 +78,14 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.apiRedis.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: {{ include "lagoon-core.apiRedis.fullname" . }}-data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.apiRedis.storageSize | quote }} + {{- end }} diff --git a/charts/lagoon-core/templates/api-redis.pvc.yaml b/charts/lagoon-core/templates/api-redis.pvc.yaml new file mode 100644 index 00000000..1952d882 --- /dev/null +++ b/charts/lagoon-core/templates/api-redis.pvc.yaml @@ -0,0 +1,17 @@ +{{- if .Values.apiRedis.persistence.enabled -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "lagoon-core.apiRedis.fullname" . }}-data + labels: + {{- include "lagoon-core.apiRedis.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.apiRedis.persistence.size | quote }} + {{- with .Values.apiRedis.persistence.className }} + storageClassName: {{ . | quote }} + {{- end }} +{{- end }} diff --git a/charts/lagoon-core/values.yaml b/charts/lagoon-core/values.yaml index 5850b605..bee398bd 100644 --- a/charts/lagoon-core/values.yaml +++ b/charts/lagoon-core/values.yaml @@ -199,8 +199,9 @@ apiRedis: memory: "64Mi" cpu: "50m" - additionalEnvs: - # FOO: Bar + persistence: + enabled: true + size: 1Gi service: type: ClusterIP