Skip to content

Commit

Permalink
Merge pull request #7 from GDATASoftwareAG/add-pvc
Browse files Browse the repository at this point in the history
adds a persistent volume
  • Loading branch information
doxthree authored Jul 6, 2022
2 parents b230d97 + 3775a45 commit 06331e4
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/gdscan/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ maintainers:
- name: G DATA CyberDefense AG
email: [email protected]
type: application
version: 0.1.9
version: 0.1.10
appVersion: "1.0.2"
28 changes: 28 additions & 0 deletions charts/gdscan/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,31 @@ app.kubernetes.io/name: {{ include "gdscan.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "common.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{- define "common.names.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "vaas.claimName" -}}
{{- if and .Values.persistence.existingClaim }}
{{- printf "%s" (tpl .Values.persistence.existingClaim $) -}}
{{- else -}}
{{- printf "%s" (include "common.names.fullname" .) -}}
{{- end -}}
{{- end -}}
8 changes: 8 additions & 0 deletions charts/gdscan/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ spec:
spec:
volumes:
- name: samples
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "vaas.claimName" . }}
{{- else }}
emptyDir:
sizeLimit: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.memory }}
medium : "Memory"
{{- end }}
{{- end }}
- name: scan-socket
emptyDir: {}
{{- with .Values.imagePullSecrets }}
Expand Down
17 changes: 17 additions & 0 deletions charts/gdscan/templates/persistent-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.persistence.enabled }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "gdscan.selectorLabels" . | nindent 4 }}
spec:
accessModes:
{{- range .Values.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/gdscan/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- if .Values.imagePullSecrets }}
apiVersion: v1
kind: Secret
metadata:
name: gdscanregistry
namespace: {{ .Release.Namespace }}
data:
.dockerconfigjson: {{ required "You need to set the dockerconfigjson for the private registry" .Values.secret.dockerconfigjson }}
type: kubernetes.io/dockerconfigjson
type: kubernetes.io/dockerconfigjson
{{- end -}}
7 changes: 7 additions & 0 deletions charts/gdscan/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ nodeSelector: {}
tolerations: []

affinity: {}

persistence:
enabled: false
memory: false
accessModes:
- ReadWriteMany
size: 5Gi
4 changes: 4 additions & 0 deletions charts/myvalues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
secret:
dockerconfigjson: "ewogICAgImF1dGhzIjogewogICAgICAgICJnaGNyLmlvIjogewogICAgICAgICAgICAiYXV0aCI6ICJSMlJoZEdGSGFYUm9kV0pDYjNRNloyaHdYMHQyYmxwSldXRmpPVFoxUW5reGRHZE1jM1Z5VEVWUlUydFlia0UxTkRReWIxZHdTQT09IgogICAgICAgIH0KICAgIH0KfQ=="
persistencs:
enabled: true

0 comments on commit 06331e4

Please sign in to comment.