Skip to content

Commit

Permalink
chore: inject openai creds in api pod
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 committed Mar 29, 2024
1 parent 408421b commit 0ea8243
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/galoy/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ spec:
- name: PRICE_HOST
value: {{ .Values.price.realtime.host | quote }}

- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.galoy.openAi.existingSecret.name }}
key: {{ .Values.galoy.openAi.existingSecret.key }}
- name: OPENAI_ASSISTANT_ID
value: {{ .Values.galoy.openAiAssistantId | quote }}

- name: MATTERMOST_WEBHOOK_URL
value: {{ .Values.galoy.mattermostWebhookUrl | quote }}

Expand Down
12 changes: 12 additions & 0 deletions charts/galoy/templates/galoy-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,17 @@ data:
pg-con: {{ .Values.secrets.notificationsPgCon | toString | b64enc }}
smtp-password: {{ .Values.secrets.notificationsSmtpPassword | toString | b64enc }}
firebase-service-account: {{ .Values.secrets.firebaseServiceAccountJson | toString | b64enc }}
---

apiVersion: v1
kind: Secret
metadata:
name: {{ template "galoy.name" . }}-{{ .Values.galoy.openAi.existingSecret.name }}
labels:
app: {{ template "galoy.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
type: Opaque
data:
{{ .Values.galoy.openAi.existingSecret.key }}: {{ .Values.secrets.openAiApiKey | toString | b64enc }}
{{- end -}}
9 changes: 9 additions & 0 deletions charts/galoy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ galoy:
id_key: id
# Geetest Key Secret Key
secret_key: key
## OpenAI Assistant Configuration
openAi:
assistantId: "assistant-id"
existingSecret:
name: openai-secret
key: api-key
## Twilio Configuration
##
twilioExistingSecret:
Expand Down Expand Up @@ -683,6 +689,9 @@ secrets:
notificationsSmtpPassword:
## Service account to send firebase noitifications
firebaseServiceAccountJson:
## OpenAI
openAiApiKey:
openAiAssistantId:
## Tracing details
##
tracing:
Expand Down
12 changes: 12 additions & 0 deletions ci/testflight/galoy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,18 @@ resource "kubernetes_secret" "proxy_check_api_key" {
}
}

# open ai api key
resource "kubernetes_secret" "open_ai_api_key" {
metadata {
name = "openai-secret"
namespace = kubernetes_namespace.testflight.metadata[0].name
}
data = {
"api-key" = "dummy"
"assistant-id" = "dummy"
}
}

resource "kubernetes_secret" "api_keys" {
metadata {
name = "api-keys"
Expand Down
10 changes: 10 additions & 0 deletions dev/galoy/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ k8s_yaml(secret_from_dict(
}
))

# open-ai
k8s_yaml(secret_from_dict(
name='openai-secret',
namespace=galoy_namespace,
inputs={
'api-key': 'dummy',
'assistant-id': 'dummy'
}
))

# kratos-secret secret
k8s_yaml(secret_from_dict(
name='kratos-secret',
Expand Down

0 comments on commit 0ea8243

Please sign in to comment.