Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions braintrust/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,23 @@ spec:
mountPath: "/mnt/secrets-store"
readOnly: true
{{- end }}
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
{{- with .Values.api.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if or (and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver) .Values.api.extraVolumes }}
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureKeyVaultDriver }}
- name: secrets-store-inline
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: {{ .Values.azure.keyVaultName }}
{{- end }}
{{- end }}
{{- with .Values.api.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- else }}
[]
{{- end }}

6 changes: 6 additions & 0 deletions braintrust/templates/brainstore-reader-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ spec:
mountPath: "/mnt/secrets-store"
readOnly: true
{{- end }}
{{- with .Values.brainstore.reader.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: cache-volume
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }}
Expand All @@ -165,3 +168,6 @@ spec:
volumeAttributes:
secretProviderClass: {{ .Values.azure.keyVaultName }}
{{- end }}
{{- with .Values.brainstore.reader.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 6 additions & 0 deletions braintrust/templates/brainstore-writer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ spec:
mountPath: "/mnt/secrets-store"
readOnly: true
{{- end }}
{{- with .Values.brainstore.writer.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: cache-volume
{{- if and (eq .Values.cloud "azure") .Values.azure.enableAzureContainerStorageDriver }}
Expand All @@ -165,3 +168,6 @@ spec:
volumeAttributes:
secretProviderClass: {{ .Values.azure.keyVaultName }}
{{- end }}
{{- with .Values.brainstore.writer.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
50 changes: 49 additions & 1 deletion braintrust/tests/api-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ tests:
release:
namespace: "braintrust"
asserts:
- isNull:
- equal:
path: spec.template.spec.volumes
value: []

- it: should include extraEnvVars when provided
values:
Expand Down Expand Up @@ -239,3 +240,50 @@ tests:
path: spec.template.spec.containers[0].livenessProbe
- isNull:
path: spec.template.spec.containers[0].readinessProbe

- it: should include extraContainers when provided (e.g. OTEL collector sidecar)
values:
- __fixtures__/base-values.yaml
set:
api.extraContainers:
- name: otel-collector
image: otel/opentelemetry-collector-contrib:0.100.0
args:
- --config=/etc/otel/config.yaml
volumeMounts:
- name: otel-config
mountPath: /etc/otel
readOnly: true
release:
namespace: "braintrust"
asserts:
- equal:
path: spec.template.spec.containers[1].name
value: otel-collector
- equal:
path: spec.template.spec.containers[1].image
value: otel/opentelemetry-collector-contrib:0.100.0
- contains:
path: spec.template.spec.containers[1].volumeMounts
content:
name: otel-config
mountPath: /etc/otel
readOnly: true

- it: should include extraVolumes when provided (for sidecar config)
values:
- __fixtures__/base-values.yaml
set:
api.extraVolumes:
- name: otel-config
configMap:
name: otel-collector-config
release:
namespace: "braintrust"
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: otel-config
configMap:
name: otel-collector-config
47 changes: 47 additions & 0 deletions braintrust/tests/brainstore-reader_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,50 @@ tests:
content:
name: BRAINSTORE_AI_PROXY_URL
value: "http://braintrust-api:8000"

- it: should include extraContainers when provided (e.g. OTEL collector sidecar)
values:
- __fixtures__/base-values.yaml
set:
brainstore.reader.extraContainers:
- name: otel-collector
image: otel/opentelemetry-collector-contrib:0.100.0
args:
- --config=/etc/otel/config.yaml
volumeMounts:
- name: otel-config
mountPath: /etc/otel
readOnly: true
release:
namespace: "braintrust"
asserts:
- equal:
path: spec.template.spec.containers[1].name
value: otel-collector
- equal:
path: spec.template.spec.containers[1].image
value: otel/opentelemetry-collector-contrib:0.100.0
- contains:
path: spec.template.spec.containers[1].volumeMounts
content:
name: otel-config
mountPath: /etc/otel
readOnly: true

- it: should include extraVolumes when provided (for sidecar config)
values:
- __fixtures__/base-values.yaml
set:
brainstore.reader.extraVolumes:
- name: otel-config
configMap:
name: otel-collector-config
release:
namespace: "braintrust"
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: otel-config
configMap:
name: otel-collector-config
6 changes: 6 additions & 0 deletions braintrust/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ api:
healthServer:
host: "0.0.0.0"
port: "8001"
extraContainers: []
extraVolumes: []

# Brainstore configuration (split into reader and writer)
brainstore:
Expand Down Expand Up @@ -222,6 +224,8 @@ brainstore:
nodeSelector: {}
tolerations: []
affinity: {}
extraContainers: []
extraVolumes: []

# Brainstore Writer configuration
writer:
Expand Down Expand Up @@ -265,6 +269,8 @@ brainstore:
nodeSelector: {}
tolerations: []
affinity: {}
extraContainers: []
extraVolumes: []

azureKeyVaultDriver:
# Map your Key Vault secret names to the required Kubernetes secret keys
Expand Down