Skip to content

Commit 0d993b5

Browse files
committed
Merge branch 'main' into jeff/security-enhancements
2 parents dd21825 + 552507f commit 0d993b5

10 files changed

Lines changed: 171 additions & 67 deletions

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
### Installation
181181
\`\`\`bash
182182
183-
helm install braintrust oci://${{ steps.push-chart.outputs.chart_url }}/${{ env.CHART_NAME }} --version $CHART_VERSION
183+
helm install braintrust ${{ steps.push-chart.outputs.chart_url }}/${{ env.CHART_NAME }} --version $CHART_VERSION
184184
\`\`\`
185185
EOF
186186

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ This repository contains the official Helm chart for deploying Braintrust's self
77
### Install from OCI Registry
88

99
```bash
10-
helm install braintrust oci://public.ecr.aws/braintrust/helm/braintrust
11-
```
12-
13-
To install a specific version:
14-
15-
```bash
16-
helm install braintrust oci://public.ecr.aws/braintrust/helm/braintrust --version 1.2.3
10+
helm upgrade --install \
11+
--namespace braintrust --create-namespace \
12+
braintrust \
13+
oci://public.ecr.aws/braintrust/helm/braintrust \
14+
--version 1.2.3 \
15+
--values helm-values.yaml
1716
```
1817

1918
## Prerequisites

braintrust/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: braintrust
3-
version: 2.1.0
3+
version: 3.0.3
44
description: A Helm chart to run the Braintrust services for the self-hosted data plane
55
type: application
66
home: https://github.com/braintrustdata/helm

braintrust/README.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Prerequisites
44

5-
This helm chart requires a Kubernetes secret named `braintrust-secrets` to exist in the namespace where the chart is installed. Azure users can optionally use the Azure Key Vault CSI driver to automatically sync secrets from Azure Key Vault into Kubernetes (see below for details).
5+
This helm chart requires a Kubernetes secret named `braintrust-secrets` to exist in the namespace where the chart is installed. Azure users will automatically sync secrets from Azure Key Vault into Kubernetes (see below for details). AWS and Google users will need to manually create and manage the `braintrust-secrets` Kubernetes secret.
66

77
## Required Secrets
88

@@ -19,32 +19,30 @@ The `braintrust-secrets` secret must contain the following keys:
1919
| `GCS_ACCESS_KEY_ID` | Google HMAC Access ID string | Valid S3 API Key Id (only required if `cloud` is `google`) |
2020
| `GCS_SECRET_ACCESS_KEY` | Google HMAC Secret string | Valid S3 Secret string (only required if `cloud` is `google`) |
2121

22-
## Azure Key Vault CSI Integration (Optional)
22+
## Azure Key Vault Driver Integration
2323

24-
If you're using Azure, you can optionally use the Azure Key Vault CSI driver to automatically sync secrets from Azure Key Vault into Kubernetes. This eliminates the need to manually create and manage the `braintrust-secrets` Kubernetes secret.
24+
If you're using Azure, the Azure Key Vault CSI driver is default enabled and will automatically sync secrets from Azure Key Vault into Kubernetes. This eliminates the need to manually create and manage the `braintrust-secrets` Kubernetes secret.
2525

2626
To enable this feature:
2727

28-
1. Set `azureKeyVaultCSI.enabled: true` in your values.yaml
29-
2. Configure your Key Vault details:
28+
1. Configure your Key Vault details:
3029

3130
```yaml
32-
azureKeyVaultCSI:
33-
enabled: true
34-
name: "your-keyvault-name"
35-
userAssignedIdentityID: "your-identity-id"
36-
clientID: "your-client-id"
31+
azure:
32+
keyVaultName: "your-keyvault-name"
33+
keyVaultCSIclientID: "your-client-id" # This should come from the terraform module
3734
tenantId: "your-tenant-id"
3835
```
3936
40-
3. Optionally map your Key Vault secret names to the required Kubernetes secret keys. This is only required if you aren't using our terraform module. The defaults assume you are using the Braintrust terraform module to deploy the base infrastructure.
37+
2. Optionally map your Key Vault secret names to the required Kubernetes secret keys. This is only required if you aren't using our terraform module. The defaults assume you are using the Braintrust terraform module to deploy the base infrastructure.
4138
4239
```yaml
43-
secrets:
44-
- keyVaultSecretName: "your-redis-secret-name"
45-
kubernetesSecretKey: "REDIS_URL"
46-
keyVaultSecretType: "secret"
47-
# ... other secret mappings
40+
azureKeyVaultDriver:
41+
secrets:
42+
- keyVaultSecretName: "your-redis-secret-name"
43+
kubernetesSecretKey: "REDIS_URL"
44+
keyVaultSecretType: "secret"
45+
# ... other secret mappings
4846
```
4947

5048
The CSI driver will:
@@ -91,7 +89,7 @@ brainstore:
9189
- Ephemeral-storage requests ensure proper SSD allocation
9290
- Each brainstore pod gets its own dedicated node with full access to local SSDs
9391

94-
**Supported machine families:** c4, c4d,
92+
**Supported machine families:** c4, c4d
9593

9694
### GKE Standard Mode
9795

@@ -102,7 +100,7 @@ For Standard mode clusters, create node pools with local SSDs, then deploy:
102100
cloud: "google"
103101
104102
google:
105-
mode: "standard"
103+
mode: "standard"
106104
107105
brainstore:
108106
reader:
@@ -150,10 +148,6 @@ For Standard mode clusters, create node pools with local SSDs, then deploy:
150148
- Local SSDs are automatically available via emptyDir volumes
151149
- Pod anti-affinity ensures readers and writers don't share nodes (each pod gets dedicated node access)
152150

153-
## Notes
154-
155-
- The `AZURE_STORAGE_CONNECTION_STRING` may or may not contain an AccountKey or SAS token depending on the storage account configuration. If a key or token is not provided, workload identity will be used.
156-
- When using Azure Key Vault CSI, ensure your AKS cluster has the CSI driver installed and the managed identity has the correct permissions in Key Vault.
157151

158152
## Breaking Changes
159153

braintrust/templates/api-deployment.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ spec:
6060
- containerPort: {{ .Values.api.service.port }}
6161
resources:
6262
{{- toYaml .Values.api.resources | nindent 12 }}
63+
{{- with .Values.api.livenessProbe }}
64+
livenessProbe:
65+
{{- toYaml . | nindent 12 }}
66+
{{- end }}
67+
{{- with .Values.api.readinessProbe }}
68+
readinessProbe:
69+
{{- toYaml . | nindent 12 }}
70+
{{- end }}
6371
envFrom:
6472
- configMapRef:
6573
name: {{ .Values.api.name }}
@@ -103,6 +111,10 @@ spec:
103111
name: braintrust-secrets
104112
key: GCS_SECRET_ACCESS_KEY
105113
{{- end }}
114+
- name: TS_API_HEALTHSERVER_HOST
115+
value: "0.0.0.0"
116+
- name: TS_API_HEALTHSERVER_PORT
117+
value: "8001"
106118
{{- if .Values.api.extraEnvVars }}
107119
{{- toYaml .Values.api.extraEnvVars | nindent 12 }}
108120
{{- end }}
@@ -114,9 +126,9 @@ spec:
114126
- name: NODE_EXTRA_CA_CERTS
115127
value: "/etc/braintrust/tls/ca-bundle.pem"
116128
{{- end }}
117-
{{- if or .Values.azureKeyVaultCSI.enabled .Values.customTLSCABundle }}
129+
{{- if or (and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver) .Values.customTLSCABundle }}
118130
volumeMounts:
119-
{{- if .Values.azureKeyVaultCSI.enabled }}
131+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
120132
- name: secrets-store-inline
121133
mountPath: "/mnt/secrets-store"
122134
readOnly: true
@@ -127,7 +139,7 @@ spec:
127139
readOnly: true
128140
{{- end }}
129141
{{- end }}
130-
{{- if or .Values.azureKeyVaultCSI.enabled .Values.customTLSCABundle }}
142+
{{- if or (and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver) .Values.customTLSCABundle }}
131143
volumes:
132144
{{- if .Values.customTLSCABundle }}
133145
- name: tls-ca
@@ -139,13 +151,13 @@ spec:
139151
- key: "CA_PEM"
140152
path: "ca-bundle.pem"
141153
{{- end }}
142-
{{- if .Values.azureKeyVaultCSI.enabled }}
154+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
143155
- name: secrets-store-inline
144156
csi:
145157
driver: secrets-store.csi.k8s.io
146158
readOnly: true
147159
volumeAttributes:
148-
secretProviderClass: {{ .Values.azureKeyVaultCSI.name }}
160+
secretProviderClass: {{ .Values.azure.keyVaultName }}
149161
{{- end }}
150162
{{- end }}
151163

braintrust/templates/brainstore-reader-deployment.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ spec:
8383
limits:
8484
cpu: {{ .Values.brainstore.reader.resources.limits.cpu | quote }}
8585
memory: {{ .Values.brainstore.reader.resources.limits.memory | quote }}
86+
{{- with .Values.brainstore.livenessProbe }}
87+
livenessProbe:
88+
{{- toYaml . | nindent 12 }}
89+
{{- end }}
90+
{{- with .Values.brainstore.readinessProbe }}
91+
readinessProbe:
92+
{{- toYaml . | nindent 12 }}
93+
{{- end }}
8694
envFrom:
8795
- configMapRef:
8896
name: {{ .Values.brainstore.reader.name }}
@@ -114,6 +122,11 @@ spec:
114122
secretKeyRef:
115123
name: braintrust-secrets
116124
key: BRAINSTORE_LICENSE_KEY
125+
- name: FUNCTION_SECRET_KEY
126+
valueFrom:
127+
secretKeyRef:
128+
name: braintrust-secrets
129+
key: FUNCTION_SECRET_KEY
117130
{{- if .Values.brainstore.reader.extraEnvVars }}
118131
{{- toYaml .Values.brainstore.reader.extraEnvVars | nindent 12 }}
119132
{{- end }}
@@ -124,7 +137,7 @@ spec:
124137
volumeMounts:
125138
- name: cache-volume
126139
mountPath: {{ .Values.brainstore.reader.cacheDir }}
127-
{{- if .Values.azureKeyVaultCSI.enabled }}
140+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
128141
- name: secrets-store-inline
129142
mountPath: "/mnt/secrets-store"
130143
readOnly: true
@@ -136,14 +149,26 @@ spec:
136149
{{- end }}
137150
volumes:
138151
- name: cache-volume
152+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }}
153+
ephemeral:
154+
volumeClaimTemplate:
155+
spec:
156+
volumeMode: Filesystem
157+
accessModes: ["ReadWriteOnce"]
158+
storageClassName: local
159+
resources:
160+
requests:
161+
storage: {{ required "brainstore.reader.volume.size must be set" .Values.brainstore.reader.volume.size | quote }}
162+
{{- else }}
139163
emptyDir: {}
140-
{{- if .Values.azureKeyVaultCSI.enabled }}
164+
{{- end }}
165+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
141166
- name: secrets-store-inline
142167
csi:
143168
driver: secrets-store.csi.k8s.io
144169
readOnly: true
145170
volumeAttributes:
146-
secretProviderClass: {{ .Values.azureKeyVaultCSI.name }}
171+
secretProviderClass: {{ .Values.azure.keyVaultName }}
147172
{{- end }}
148173
{{- if .Values.customTLSCABundle }}
149174
- name: tls-ca

braintrust/templates/brainstore-writer-deployment.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ spec:
8383
limits:
8484
cpu: {{ .Values.brainstore.writer.resources.limits.cpu | quote }}
8585
memory: {{ .Values.brainstore.writer.resources.limits.memory | quote }}
86+
{{- with .Values.brainstore.livenessProbe }}
87+
livenessProbe:
88+
{{- toYaml . | nindent 12 }}
89+
{{- end }}
90+
{{- with .Values.brainstore.readinessProbe }}
91+
readinessProbe:
92+
{{- toYaml . | nindent 12 }}
93+
{{- end }}
8694
envFrom:
8795
- configMapRef:
8896
name: {{ .Values.brainstore.writer.name }}
@@ -114,6 +122,11 @@ spec:
114122
secretKeyRef:
115123
name: braintrust-secrets
116124
key: BRAINSTORE_LICENSE_KEY
125+
- name: FUNCTION_SECRET_KEY
126+
valueFrom:
127+
secretKeyRef:
128+
name: braintrust-secrets
129+
key: FUNCTION_SECRET_KEY
117130
{{- if .Values.brainstore.writer.extraEnvVars }}
118131
{{- toYaml .Values.brainstore.writer.extraEnvVars | nindent 12 }}
119132
{{- end }}
@@ -124,7 +137,7 @@ spec:
124137
volumeMounts:
125138
- name: cache-volume
126139
mountPath: {{ .Values.brainstore.writer.cacheDir }}
127-
{{- if .Values.azureKeyVaultCSI.enabled }}
140+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
128141
- name: secrets-store-inline
129142
mountPath: "/mnt/secrets-store"
130143
readOnly: true
@@ -136,14 +149,26 @@ spec:
136149
{{- end }}
137150
volumes:
138151
- name: cache-volume
152+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }}
153+
ephemeral:
154+
volumeClaimTemplate:
155+
spec:
156+
volumeMode: Filesystem
157+
accessModes: ["ReadWriteOnce"]
158+
storageClassName: local
159+
resources:
160+
requests:
161+
storage: {{ required "brainstore.writer.volume.size must be set" .Values.brainstore.writer.volume.size | quote }}
162+
{{- else }}
139163
emptyDir: {}
140-
{{- if .Values.azureKeyVaultCSI.enabled }}
164+
{{- end }}
165+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
141166
- name: secrets-store-inline
142167
csi:
143168
driver: secrets-store.csi.k8s.io
144169
readOnly: true
145170
volumeAttributes:
146-
secretProviderClass: {{ .Values.azureKeyVaultCSI.name }}
171+
secretProviderClass: {{ .Values.azure.keyVaultName }}
147172
{{- end }}
148173
{{- if .Values.customTLSCABundle }}
149174
- name: tls-ca

braintrust/templates/secretproviderclass.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{- if .Values.azureKeyVaultCSI.enabled }}
1+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
22
apiVersion: secrets-store.csi.x-k8s.io/v1
33
kind: SecretProviderClass
44
metadata:
5-
name: {{ .Values.azureKeyVaultCSI.name }}
5+
name: {{ .Values.azure.keyVaultName }}
66
namespace: {{ include "braintrust.namespace" . }}
77
{{- with .Values.global.labels }}
88
labels:
@@ -14,19 +14,19 @@ spec:
1414
- secretName: braintrust-secrets
1515
type: Opaque
1616
data:
17-
{{- range .Values.azureKeyVaultCSI.secrets }}
17+
{{- range .Values.azureKeyVaultDriver.secrets }}
1818
- key: {{ .kubernetesSecretKey }}
1919
objectName: {{ .keyVaultSecretName }}
2020
{{- end }}
2121
parameters:
2222
usePodIdentity: "false"
2323
useVMManagedIdentity: "false"
24-
keyvaultName: "{{ .Values.azureKeyVaultCSI.name }}"
25-
clientID: "{{ .Values.azureKeyVaultCSI.clientID }}"
26-
tenantId: "{{ .Values.azureKeyVaultCSI.tenantId }}"
24+
keyvaultName: "{{ .Values.azure.keyVaultName }}"
25+
clientID: "{{ .Values.azure.keyVaultCSIclientID }}"
26+
tenantId: "{{ .Values.azure.tenantId }}"
2727
objects: |
2828
array:
29-
{{- range .Values.azureKeyVaultCSI.secrets }}
29+
{{- range .Values.azureKeyVaultDriver.secrets }}
3030
- |
3131
objectName: {{ .keyVaultSecretName }}
3232
objectType: {{ .keyVaultSecretType }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }}
2+
apiVersion: storage.k8s.io/v1
3+
kind: StorageClass
4+
metadata:
5+
name: local
6+
provisioner: localdisk.csi.acstor.io
7+
reclaimPolicy: Delete
8+
volumeBindingMode: WaitForFirstConsumer
9+
allowVolumeExpansion: true
10+
{{- end }}

0 commit comments

Comments
 (0)