From f5795c50c71cb585da57834a8c03fbc22c82062c Mon Sep 17 00:00:00 2001 From: John Daniel Maguire Date: Thu, 28 Apr 2022 10:29:01 -0300 Subject: [PATCH] Stripe key as secret --- .../chart/templates/deployment.yaml | 12 +++++++--- modules/cloud-manager-agent/chart/values.yaml | 2 ++ modules/cloud-manager-agent/values.yaml.tftpl | 22 ++++++++++++++++--- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/cloud-manager-agent/chart/templates/deployment.yaml b/modules/cloud-manager-agent/chart/templates/deployment.yaml index 0665eaf..82fc412 100644 --- a/modules/cloud-manager-agent/chart/templates/deployment.yaml +++ b/modules/cloud-manager-agent/chart/templates/deployment.yaml @@ -49,6 +49,15 @@ spec: terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} containers: - name: agent + {{ $stripeKeySecretName := .Values.appConfig.applicationAgentProperties.stripeKeySecretName }} + {{- if $stripeKeySecretName }} + env: + - name: STRIPE_DEFAULT_SECRET_API_KEY + valueFrom: + secretKeyRef: + name: {{ $stripeKeySecretName | quote }} + key: {{ .Values.appConfig.applicationAgentProperties.stripeKeySecretKey | quote }} + {{- end }} image: {{ include "cloud-manager-agent.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} readinessProbe: @@ -89,9 +98,6 @@ spec: items: - key: application-default.properties path: application-agent.properties - # - name: cloud-manager-agent-tls - # secret: - # secretName: ctl-tls - name: data emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/modules/cloud-manager-agent/chart/values.yaml b/modules/cloud-manager-agent/chart/values.yaml index 8cf733b..c55b6d8 100644 --- a/modules/cloud-manager-agent/chart/values.yaml +++ b/modules/cloud-manager-agent/chart/values.yaml @@ -40,6 +40,8 @@ rbac: appConfig: applicationAgentProperties: + stripeKeySecretName: "" + stripeKeySecretKey: key raw: "" applicationProperties: | logging.level.org.apache=INFO diff --git a/modules/cloud-manager-agent/values.yaml.tftpl b/modules/cloud-manager-agent/values.yaml.tftpl index aee93e6..984e909 100644 --- a/modules/cloud-manager-agent/values.yaml.tftpl +++ b/modules/cloud-manager-agent/values.yaml.tftpl @@ -1,5 +1,21 @@ appConfig: applicationAgentProperties: - kubernetesExternalSecret: - enabled: true - secretName: cloud-manager-agent-extra-${environment} + stripeKeySecretName: stripe +%{ if environment == "test" } + raw: | + spring.security.oauth2.resourceserver.jwt.issuer-uri=https://auth.test.cloud.gcp.streamnative.dev/ + cloud.api.audience=https://api.test.cloud.gcp.streamnative.dev + spring.security.oauth2.resourceserver.jwt.audience=https://api.test.cloud.gcp.streamnative.dev +%{ else } +%{ if environment == "staging" } + raw: | + spring.security.oauth2.resourceserver.jwt.issuer-uri=https://auth.sncloud-stg.dev/ + cloud.api.audience=https://api.sncloud-stg.dev + spring.security.oauth2.resourceserver.jwt.audience=https://api.sncloud-stg.dev +%{ else } + raw: | + spring.security.oauth2.resourceserver.jwt.issuer-uri=https://auth.streamnative.cloud/ + cloud.api.audience=https://api.streamnative.cloud + spring.security.oauth2.resourceserver.jwt.audience=https://api.streamnative.cloud +%{ endif } +%{ endif }