Skip to content

Commit

Permalink
feat(chart): use infisical (#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrompier authored Jun 14, 2024
1 parent 2ebc77f commit 4650c24
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 42 deletions.
15 changes: 2 additions & 13 deletions chart/env/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,20 +347,9 @@ envVars:
WEBSEARCH_BLOCKLIST: '["youtube.com", "twitter.com"]'
XFF_DEPTH: '2'

externalSecrets:
infisical:
enabled: true
secretStoreName: "chat-ui-prod-secretstore"
secretName: "chat-ui-prod-secrets"
parameters:
MONGODB_URL: "hub-prod-chat-ui-mongodb-url"
OPENID_CONFIG: "hub-prod-chat-ui-openid-config"
SERPER_API_KEY: "hub-prod-chat-ui-serper-api-key"
HF_TOKEN: "hub-prod-chat-ui-hf-token"
WEBHOOK_URL_REPORT_ASSISTANT: "hub-prod-chat-ui-webhook-report-assistant"
ADMIN_API_SECRET: "hub-prod-chat-ui-admin-api-secret"
USAGE_LIMITS: "hub-prod-chat-ui-usage-limits"
MESSAGES_BEFORE_LOGIN: "hub-prod-chat-ui-messages-before-login"
IP_TOKEN_SECRET: "hub-prod-chat-ui-ip-token-secret"
env: "prod-us-east-1"

autoscaling:
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ spec:
envFrom:
- configMapRef:
name: {{ include "name" . }}
{{- if $.Values.externalSecrets.enabled }}
{{- if $.Values.infisical.enabled }}
- secretRef:
name: {{ $.Values.externalSecrets.secretName }}
name: {{ include "name" $ }}-infisical-secret
{{- end }}
{{- with $.Values.extraEnvFrom }}
{{- toYaml . | nindent 14 }}
Expand Down
24 changes: 24 additions & 0 deletions chart/templates/infisical.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.infisical.enabled }}
apiVersion: secrets.infisical.com/v1alpha1
kind: InfisicalSecret
metadata:
name: {{ include "name" $ }}-infisical-secret
namespace: {{ $.Release.Namespace }}
spec:
authentication:
universalAuth:
credentialsRef:
secretName: {{ .Values.infisical.operatorSecretName | quote }}
secretNamespace: {{ .Values.infisical.operatorSecretNamespace | quote }}
secretsScope:
envSlug: {{ .Values.infisical.env | quote }}
projectSlug: {{ .Values.infisical.project | quote }}
secretsPath: /
hostAPI: {{ .Values.infisical.url | quote }}
managedSecretReference:
creationPolicy: Owner
secretName: {{ include "name" $ }}-secs
secretNamespace: {{ .Release.Namespace | quote }}
secretType: Opaque
resyncInterval: {{ .Values.infisical.resyncInterval }}
{{- end }}
21 changes: 0 additions & 21 deletions chart/templates/secrets.yaml

This file was deleted.

15 changes: 10 additions & 5 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ nodeSelector: {}
tolerations: []

envVars: { }
externalSecrets:

infisical:
enabled: false
secretStoreName: ""
secretName: ""
parameters: { }
# Allow to environment injections on top or instead of externalSecrets
env: ""
project: "huggingchat-v2-a1"
url: ""
resyncInterval: 60
operatorSecretName: "huggingchat-operator-secrets"
operatorSecretNamespace: "hub-utils"

# Allow to environment injections on top or instead of infisical
extraEnvFrom: []
extraEnv: []

Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resources:

envVars:
MONGODB_URL: mongodb://chat-ui-mongo:27017
# Ensure that your values.yaml will not leak anywhere or use externalSecrets instead
# Ensure that your values.yaml will not leak anywhere
# PRs welcome for a chart rework with envFrom support!
HF_TOKEN: secret_token
```

0 comments on commit 4650c24

Please sign in to comment.