Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion charts/akeyless-api-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ Generate chart secret name
{{- end -}}
{{- end -}}

{{- define "akeyless-api-gw.cache.pvcName" -}}
{{- printf "%s-cache" (include "akeyless-api-gw.fullname" .) }}
{{- end -}}


{{/* Define REDIS_MAXMEMORY as 80% of the pod's memory limit */}}
{{- define "akeyless-api-gw.redisMaxmemory" -}}
{{- $memoryLimit := .Values.cache.resources.limits.memory | toString -}}

{{- $memoryLimitBytes := 0 -}}
{{- if regexMatch "^[0-9]+$" $memoryLimit -}}
{{- $memoryLimitBytes = $memoryLimit | mulf 1 -}} {{/* Direct byte value */}}
Expand Down
16 changes: 14 additions & 2 deletions charts/akeyless-api-gateway/templates/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ spec:
name: {{ $deploymentName }}
component: cache
spec:
{{- if (include "cacheEnableTls" . | eq "true") }}
volumes:
{{- if .Values.cache.persistence.enabled }}
- name: cache-data
persistentVolumeClaim:
claimName: {{ .Values.cache.persistence.existingClaim | default (include "akeyless-api-gw.cache.pvcName" .) }}
{{- end }}
{{- if (include "cacheEnableTls" . | eq "true") }}
- name: cache-tls
secret:
secretName: {{ include "cacheTlsSecretName" . }}
Expand Down Expand Up @@ -67,6 +72,9 @@ spec:
- --port
- "6379"
{{- end }}
{{- if .Values.cache.extraArgs }}
{{- toYaml .Values.cache.extraArgs | nindent 8 }}
{{- end }}
ports:
- containerPort: 6379
name: cache
Expand Down Expand Up @@ -118,8 +126,12 @@ spec:
secretKeyRef:
name: {{ include "akeyless-api-gw.cacheSecretName" . }}
key: cache-pass
{{- if (include "cacheEnableTls" . | eq "true") }}
volumeMounts:
{{- if .Values.cache.persistence.enabled }}
- name: cache-data
mountPath: /data
{{- end }}
{{- if (include "cacheEnableTls" . | eq "true") }}
- name: cache-tls
mountPath: {{ $mountCertPaths }}
readOnly: true
Expand Down
26 changes: 26 additions & 0 deletions charts/akeyless-api-gateway/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,29 @@ spec:
storage: {{ .Values.persistence.size }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}

---
{{- if and .Values.cache.persistence.enabled (not .Values.cache.persistence.existingClaim) }}
{{- $pvcName := include "akeyless-api-gw.cache.pvcName" . }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ $pvcName }}
{{- if .Values.cache.persistence.labels }}
labels:
{{- toYaml .Values.cache.persistence.labels | nindent 4 }}
{{- end }}
{{- if .Values.cache.persistence.annotations }}
annotations:
{{- toYaml .Values.cache.persistence.annotations | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.cache.persistence.accessMode | default "ReadWriteOnce" }}
resources:
requests:
storage: {{ .Values.cache.persistence.size | default "10Gi" }}
{{- if .Values.cache.persistence.storageClass }}
storageClassName: {{ .Values.cache.persistence.storageClass }}
{{- end }}
{{- end }}
5 changes: 4 additions & 1 deletion charts/akeyless-api-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ cache:
pullPolicy: Always
resources:
limits:
# cpu: 500m
# cpu: 500m
memory: 2Gi
requests:
cpu: 250m
memory: 256Mi
persistence:
enabled: false

Comment thread
kgal-akl marked this conversation as resolved.

image:
repository: akeyless/base
Expand Down
Loading