Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert api-redis to redis-persistent #601

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions charts/lagoon-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
2 changes: 2 additions & 0 deletions charts/lagoon-core/ci/linter-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ apiRedis:
resources:
requests:
cpu: "10m"
persistence:
enabled: false

# TODO - update repo/tag before v2.11 release
actionsHandler:
Expand Down
26 changes: 26 additions & 0 deletions charts/lagoon-core/templates/api-redis.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ 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 }}
{{- end }}
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
Expand All @@ -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 }}
Expand All @@ -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 }}
Comment on lines +81 to +91
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, could be a statefulSet hangover

17 changes: 17 additions & 0 deletions charts/lagoon-core/templates/api-redis.pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 3 additions & 2 deletions charts/lagoon-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ apiRedis:
memory: "64Mi"
cpu: "50m"

additionalEnvs:
# FOO: Bar
persistence:
enabled: true
size: 1Gi

service:
type: ClusterIP
Expand Down