Skip to content

Commit 69361df

Browse files
committed
New notes and discovery secret for Chroma
1 parent 6f9a327 commit 69361df

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

charts/chromadb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sources:
1212
- https://github.com/chroma-core/chroma
1313
- https://github.com/amikos-tech/chromadb-chart/
1414
type: application
15-
version: 1.0.4
15+
version: 1.0.5
1616
appVersion: "0.6.3"
1717
dependencies:
1818
- name: chromadb

charts/chromadb/templates/NOTES.txt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
{{- end -}}
1111
{{- end -}}
1212

13+
### Access
1314

14-
{{- if not (or (.Values.ingress).enabled (.Values.route).enabled) -}}
15+
{{ if not (or (.Values.ingress).enabled (.Values.route).enabled) -}}
1516
Enable access to your service using port forwarding:
1617
```bash
1718
kubectl port-forward service/{{ include "chart.fullname" .Subcharts.chromadb }} <port-local>:{{ .Values.chromadb.chromadb.serverHttpPort }}
1819
```
19-
20-
{{ end }}
20+
{{ else -}}
21+
Your service is available at the following URI:
22+
- {{ $hostname }}
23+
{{ end -}}
2124

2225
{{- if .Values.chromadb.chromadb.auth.enabled }}
2326
Authentication:
@@ -31,10 +34,13 @@ Authentication:
3134
Access to your service is not authenticated.
3235
{{- end }}
3336

37+
<details>
38+
<summary> Environment variable setup </summary>
3439
Configure the access to your service using environment variables:
3540
```bash
3641
export CHROMA_SERVER_HOST={{ $hostname }}
3742
export CHROMA_SERVER_HTTP_PORT={{ $httpport }}
43+
export CHROMA_SERVER_SSL_ENABLED={{ $ssl }}
3844

3945
{{- if .Values.chromadb.chromadb.auth.enabled }}
4046
{{- if eq .Values.chromadb.chromadb.auth.type "token" }}
@@ -49,17 +55,28 @@ export CHROMA_CLIENT_AUTH_PROVIDER=chromadb.auth.basic_authn.BasicAuthClientProv
4955
{{- end }}
5056
{{- end }}
5157
```
58+
</details>
59+
60+
61+
### Clients
62+
63+
<details>
64+
<summary> Python client </summary>
65+
Install the ChromaDB client library first:
66+
```bash
67+
uv pip install chromadb-client==0.6.3
68+
```
5269

53-
Using Python the variables are used automatically for authentication:
70+
Environment variables are then automatically used for authentication:
5471
```python
72+
import os
5573
import chromadb
5674
from chromadb.config import Settings
5775

5876
# Setup client using environment variables
5977
client = chromadb.HttpClient(
60-
host="{{ $hostname }}",
61-
port={{ $httpport }},
62-
ssl={{ $ssl }},
78+
host=os.getenv("CHROMA_SERVER_HOST"),
79+
port=int(os.getenv("CHROMA_SERVER_HTTP_PORT")),
6380
settings=Settings()
6481
)
6582

@@ -69,3 +86,4 @@ client.get_or_create_collection("test", metadata={"key": "value"})
6986
# Print out all existing collections
7087
print("This should print ['test']:", client.list_collections())
7188
```
89+
</details>

charts/chromadb/templates/discovery-secret.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ stringData:
1111
CHROMA_SERVER_HOST: {{ include "library-chart.service-url" . | quote }}
1212
{{- if or (.Values.route).enabled (.Values.ingress).tls }}
1313
CHROMA_SERVER_HTTP_PORT: "443"
14+
CHROMA_SERVER_SSL_ENABLED: "True"
1415
{{- else }}
1516
CHROMA_SERVER_HTTP_PORT: "80"
17+
CHROMA_SERVER_SSL_ENABLED: "False"
1618
{{- end }}
1719
{{- else }}
1820
CHROMA_SERVER_HOST: {{ printf "http://%s" (include "chart.fullname" .Subcharts.chromadb) | quote }}
@@ -21,8 +23,12 @@ stringData:
2123
{{- if .Values.chromadb.chromadb.auth.enabled }}
2224
{{- if eq .Values.chromadb.chromadb.auth.type "token" }}
2325
CHROMA_CLIENT_AUTH_PROVIDER: "chromadb.auth.token_authn.TokenAuthClientProvider"
26+
CHROMA_CLIENT_AUTH_CREDENTIALS: {{ .Values.chromadb.chromadb.auth.token.value | quote }}
2427
{{- else }}
2528
CHROMA_CLIENT_AUTH_PROVIDER: "chromadb.auth.basic_authn.BasicAuthClientProvider"
29+
CHROMA_CLIENT_AUTH_USERNAME: {{ .Values.chromadb.chromadb.auth.basic.username | quote }}
30+
CHROMA_CLIENT_AUTH_PASSWORD: {{ .Values.chromadb.chromadb.auth.basic.password | quote }}
31+
CHROMA_CLIENT_AUTH_CREDENTIALS: {{ printf "%s:%s" .Values.chromadb.chromadb.auth.basic.username .Values.chromadb.chromadb.auth.basic.password | quote }}
2632
{{- end }}
2733
CHROMA_AUTH_SECRET: "chromadb-auth"
2834
{{- end }}

0 commit comments

Comments
 (0)