Skip to content

Commit

Permalink
Customize environment (#13)
Browse files Browse the repository at this point in the history
* add extra env vars

* render yaml as extra env vars instead of own function

* increase verson

* don't push chart.lock file

* increase version number in ci file

* fix redis version

* fix extraenvvars

---------

Co-authored-by: PT-ATA No One <[email protected]>
  • Loading branch information
unglaublicherdude and ata-no-one authored Feb 21, 2024
1 parent ffef4c9 commit a551f79
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
name: vaas
repository: gdatasoftwareag/charts
tag: 1.0.3
tag: 1.0.4
path: charts/vaas
registry: ghcr.io
registry_username: ${{ secrets.REGISTRY_USERNAME }}
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
*.log
*-locale.yaml
*.tgz
.fleet/
.fleet/
values-local.yaml
.output/
Chart.lock
4 changes: 2 additions & 2 deletions charts/vaas/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v2
name: vaas
version: 1.0.3
version: 1.0.4
description: Deployment of a Verdict-as-a-Service on-premise instance
maintainers:
- name: G DATA CyberDefense AG
email: [email protected]
type: application
dependencies:
- name: redis
version: 18.13.0
version: 18.14.0
condition: redis.enabled
repository: https://charts.bitnami.com/bitnami
- name: gdscan
Expand Down
30 changes: 0 additions & 30 deletions charts/vaas/templates/gateway/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,3 @@ Selector labels
app.kubernetes.io/name: {{ include "gateway.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create environment variables to configure gateway container.
*/}}
{{- define "gateway.env" }}
- name: Authentication__Schemes__Bearer__Authority
value: {{.Values.gateway.authentication.authority}}
- name: Authentication__Schemes__Bearer__RequireHttpsMetadata
value: "false"
- name: Upload__Endpoint
value: {{.Values.gateway.uploadUrl}}
- name: JwtSettings__Secret
value: {{ randAlphaNum 64 }}
- name: GDScanConfiguration__Url
value: "http://gdscan:8080/scan/body"
- name: RedisConfiguration__Configuration
value: "redis-master"
{{- if .Values.gateway.cloudhashlookup.enabled }}
- name: VerdictAsAService__Url
value: {{ .Values.gateway.options.url | quote }}
- name: VerdictAsAService__TokenUrl
value: {{ .Values.gateway.options.tokenurl | quote }}
- name: VerdictAsAService__Credentials__GrantType
value: {{ .Values.gateway.options.credentials.granttype | quote }}
- name: VerdictAsAService__Credentials__ClientId
value: {{ .Values.gateway.options.credentials.clientid | quote }}
- name: VerdictAsAService__Credentials__ClientSecret
{{ toYaml .Values.gateway.options.credentials.clientsecret }}
{{- end }}
{{- end }}
30 changes: 28 additions & 2 deletions charts/vaas/templates/gateway/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,34 @@ spec:
volumeMounts:
- mountPath: /tmp
name: gateway-tmp
env:
{{- include "gateway.env" . | nindent 12 }}
env:
{{- if .Values.gateway.extraEnvVars }}
{{- toYaml .Values.gateway.extraEnvVars | nindent 12 }}
{{- end }}
- name: Authentication__Schemes__Bearer__Authority
value: {{.Values.gateway.authentication.authority}}
- name: Authentication__Schemes__Bearer__RequireHttpsMetadata
value: "false"
- name: Upload__Endpoint
value: {{.Values.gateway.uploadUrl}}
- name: JwtSettings__Secret
value: {{ randAlphaNum 64 }}
- name: GDScanConfiguration__Url
value: "http://gdscan:8080/scan/body"
- name: RedisConfiguration__Configuration
value: "redis-master"
{{- if .Values.gateway.cloudhashlookup.enabled }}
- name: VerdictAsAService__Url
value: {{ .Values.gateway.options.url | quote }}
- name: VerdictAsAService__TokenUrl
value: {{ .Values.gateway.options.tokenurl | quote }}
- name: VerdictAsAService__Credentials__GrantType
value: {{ .Values.gateway.options.credentials.granttype | quote }}
- name: VerdictAsAService__Credentials__ClientId
value: {{ .Values.gateway.options.credentials.clientid | quote }}
- name: VerdictAsAService__Credentials__ClientSecret
{{ toYaml .Values.gateway.options.credentials.clientsecret }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.gateway.service.http.port }}
Expand Down
2 changes: 2 additions & 0 deletions charts/vaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ gateway:
tolerations: []
affinity: {}

extraEnvVars: []

# This block is only for G DATA's internal usage.
hashlookup:
enabled: false
Expand Down

0 comments on commit a551f79

Please sign in to comment.