Skip to content
Open
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
2 changes: 1 addition & 1 deletion charts/akeyless-api-gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Helm chart for Kubernetes that deploys akeyless-api-gateway
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.61.2
version: 1.62.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 4.44.0
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
23 changes: 20 additions & 3 deletions charts/akeyless-api-gateway/templates/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ 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" . }}
{{ end }}
{{- end }}
{{- include "cache.imagePullSecrets" . | indent 2 }}
containers:
- name: {{ $deploymentName }}
Expand Down Expand Up @@ -67,6 +72,14 @@ spec:
- --port
- "6379"
{{- end }}
{{- if .Values.cache.extraArgs }}
{{- toYaml .Values.cache.extraArgs | nindent 8 }}
{{- else if not .Values.cache.persistence.enabled }}
- --save
- ""
- --appendonly
- "no"
{{- end }}
ports:
- containerPort: 6379
name: cache
Expand Down Expand Up @@ -118,8 +131,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
2 changes: 1 addition & 1 deletion charts/akeyless-api-gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
{{- if eq .Values.persistence.enabled true }}
- name: persistent-storage
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (printf "%s-pvc" (include "akeyless-api-gw.fullname" .)) }}
claimName: {{ .Values.persistence.existingClaim | default (include "akeyless-api-gw.pvcName" .) }}
{{- end }}
initContainers:
# Since k8s 1.9.4, config maps mount read-only volumes. Since the Docker image also writes to the config file,
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 }}
24 changes: 24 additions & 0 deletions charts/akeyless-api-gateway/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@
"$schema": "https://json-schema.org/draft-07/schema#",
"properties": {
"cache" : {
"type": "object",
"properties": {
"tls": {
"type": "object",
"properties": {
"autoGenerated" : { "type": "boolean" },
"existingSecretName": { "type": "string" }
}
},
"persistence": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"existingClaim": { "type": "string" },
"accessMode": { "type": "string" },
"size": { "type": "string" },
"storageClass": { "type": "string" },
"labels": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"annotations": {
"type": "object",
"additionalProperties": { "type": "string" }
}
}
},
"extraArgs": {
"type": "array",
"items": { "type": "string" }
}
}
},
Expand Down
15 changes: 14 additions & 1 deletion charts/akeyless-api-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ cache:
pullPolicy: Always
resources:
limits:
# cpu: 500m
# cpu: 500m
memory: 2Gi
requests:
cpu: 250m
memory: 256Mi
persistence:
enabled: false
# existingClaim: ""
# accessMode: "ReadWriteMany"
# size: 5Gi
# storageClass: ""
# labels: {}
# annotations: {}
# Additional Redis flags appended to the container args.
# By default, when cache.persistence.enabled=false, the chart adds:
# --save "" --appendonly "no"
# extraArgs: []

Comment thread
kgal-akl marked this conversation as resolved.

image:
repository: akeyless/base
Expand Down