diff --git a/.gitignore b/.gitignore index 596e88d..8250dd6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ *-locale.yaml *.tgz .fleet/ -values-local.yaml \ No newline at end of file +values-local.yaml +.output/ \ No newline at end of file diff --git a/charts/vaas/templates/gateway/_helpers.tpl b/charts/vaas/templates/gateway/_helpers.tpl index d300635..18e0222 100644 --- a/charts/vaas/templates/gateway/_helpers.tpl +++ b/charts/vaas/templates/gateway/_helpers.tpl @@ -59,40 +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 }} - -{{- define "gateway.extractEnvVars" -}} -{{- range $key, $value := .Values.gateway.extraEnvVars }} -- name: {{ $key }} - value: {{ $value | quote }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/vaas/templates/gateway/statefulset.yaml b/charts/vaas/templates/gateway/statefulset.yaml index d617666..364befa 100644 --- a/charts/vaas/templates/gateway/statefulset.yaml +++ b/charts/vaas/templates/gateway/statefulset.yaml @@ -49,7 +49,19 @@ spec: value: "http://gdscan:8080/scan/body" - name: RedisConfiguration__Configuration value: "redis-master" - {{- include "gateway.extractEnvVars" . | nindent 12 }} + {{- 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 }} + {{- toYaml .Values.gateway.extraEnvVars | nindent 12 }} ports: - name: http containerPort: {{ .Values.gateway.service.http.port }} diff --git a/charts/vaas/values.yaml b/charts/vaas/values.yaml index 6c032fc..51b1ec2 100644 --- a/charts/vaas/values.yaml +++ b/charts/vaas/values.yaml @@ -134,6 +134,8 @@ gateway: tolerations: [] affinity: {} + extraEnvVars: [] + # This block is only for G DATA's internal usage. hashlookup: enabled: false