File tree 8 files changed +65
-5
lines changed
deploy/charts/litellm-helm
8 files changed +65
-5
lines changed Original file line number Diff line number Diff line change 9
9
@echo " make test - Run all tests"
10
10
@echo " make test-unit - Run unit tests"
11
11
@echo " make test-integration - Run integration tests"
12
+ @echo " make test-unit-helm - Run helm unit tests"
12
13
13
14
install-dev :
14
15
poetry install --with dev
@@ -25,4 +26,7 @@ test-unit:
25
26
poetry run pytest tests/litellm/
26
27
27
28
test-integration :
28
- poetry run pytest tests/ -k " not litellm"
29
+ poetry run pytest tests/ -k " not litellm"
30
+
31
+ test-unit-helm :
32
+ helm unittest -f ' tests/*.yaml' deploy/charts/litellm-helm
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ type: application
18
18
# This is the chart version. This version number should be incremented each time you make changes
19
19
# to the chart and its templates, including the app version.
20
20
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21
- version : 0.4.1
21
+ version : 0.4.2
22
22
23
23
# This is the version number of the application being deployed. This version number should be
24
24
# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ If `db.useStackgresOperator` is used (not yet implemented):
22
22
| Name | Description | Value |
23
23
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
24
24
| ` replicaCount ` | The number of LiteLLM Proxy pods to be deployed | ` 1 ` |
25
+ | ` masterkeySecretName ` | The name of the Kubernetes Secret that contains the Master API Key for LiteLLM. If not specified, use the generated secret name. | N/A |
26
+ | ` masterkeySecretKey ` | The key within the Kubernetes Secret that contains the Master API Key for LiteLLM. If not specified, use ` masterkey ` as the key. | N/A |
25
27
| ` masterkey ` | The Master API Key for LiteLLM. If not specified, a random key is generated. | N/A |
26
28
| ` environmentSecrets ` | An optional array of Secret object names. The keys and values in these secrets will be presented to the LiteLLM proxy pod as environment variables. See below for an example Secret object. | ` [] ` |
27
29
| ` environmentConfigMaps ` | An optional array of ConfigMap object names. The keys and values in these configmaps will be presented to the LiteLLM proxy pod as environment variables. See below for an example Secret object. | ` [] ` |
Original file line number Diff line number Diff line change 78
78
- name : PROXY_MASTER_KEY
79
79
valueFrom :
80
80
secretKeyRef :
81
- name : {{ include "litellm.fullname" . }}-masterkey
82
- key : masterkey
81
+ name : {{ .Values.masterkeySecretName | default (printf "%s-masterkey" ( include "litellm.fullname" .)) }}
82
+ key : {{ .Values.masterkeySecretKey | default " masterkey" }}
83
83
{{- if .Values.redis.enabled }}
84
84
- name : REDIS_HOST
85
85
value : {{ include "litellm.redis.serviceName" . }}
Original file line number Diff line number Diff line change
1
+ {{- if not .Values.masterkeySecretName }}
1
2
{{ $masterkey := (.Values.masterkey | default (randAlphaNum 17)) }}
2
3
apiVersion : v1
3
4
kind : Secret
4
5
metadata :
5
6
name : {{ include "litellm.fullname" . }}-masterkey
6
7
data :
7
8
masterkey : {{ $masterkey | b64enc }}
8
- type : Opaque
9
+ type : Opaque
10
+ {{- end }}
Original file line number Diff line number Diff line change @@ -52,3 +52,31 @@ tests:
52
52
- equal :
53
53
path : spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0]
54
54
value : antarctica-east1
55
+ - it : should work without masterkeySecretName or masterkeySecretKey
56
+ template : deployment.yaml
57
+ set :
58
+ masterkeySecretName : " "
59
+ masterkeySecretKey : " "
60
+ asserts :
61
+ - contains :
62
+ path : spec.template.spec.containers[0].env
63
+ content :
64
+ name : PROXY_MASTER_KEY
65
+ valueFrom :
66
+ secretKeyRef :
67
+ name : RELEASE-NAME-litellm-masterkey
68
+ key : masterkey
69
+ - it : should work with masterkeySecretName and masterkeySecretKey
70
+ template : deployment.yaml
71
+ set :
72
+ masterkeySecretName : my-secret
73
+ masterkeySecretKey : my-key
74
+ asserts :
75
+ - contains :
76
+ path : spec.template.spec.containers[0].env
77
+ content :
78
+ name : PROXY_MASTER_KEY
79
+ valueFrom :
80
+ secretKeyRef :
81
+ name : my-secret
82
+ key : my-key
Original file line number Diff line number Diff line change
1
+ suite : test masterkey secret
2
+ templates :
3
+ - secret-masterkey.yaml
4
+ tests :
5
+ - it : should create a secret if masterkeySecretName is not set
6
+ template : secret-masterkey.yaml
7
+ set :
8
+ masterkeySecretName : " "
9
+ asserts :
10
+ - isKind :
11
+ of : Secret
12
+ - it : should not create a secret if masterkeySecretName is set
13
+ template : secret-masterkey.yaml
14
+ set :
15
+ masterkeySecretName : my-secret
16
+ asserts :
17
+ - hasDocuments :
18
+ count : 0
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ ingress:
75
75
76
76
# masterkey: changeit
77
77
78
+ # if set, use this secret for the master key; otherwise, autogenerate a new one
79
+ masterkeySecretName : " "
80
+
81
+ # if set, use this secret key for the master key; otherwise, use the default key
82
+ masterkeySecretKey : " "
83
+
78
84
# The elements within proxy_config are rendered as config.yaml for the proxy
79
85
# Examples: https://github.com/BerriAI/litellm/tree/main/litellm/proxy/example_config_yaml
80
86
# Reference: https://docs.litellm.ai/docs/proxy/configs
You can’t perform that action at this time.
0 commit comments