first commit
This commit is contained in:
8
apps/litellm/README.md
Normal file
8
apps/litellm/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# litellm
|
||||
|
||||
LiteLLM gateway with ConfigMap-backed model routing and Secret-backed runtime
|
||||
keys.
|
||||
|
||||
The instance overlay should generate `litellm-secrets` and patch
|
||||
`config.yaml` for the selected upstream model.
|
||||
|
||||
20
apps/litellm/base/configmap.yaml
Normal file
20
apps/litellm/base/configmap.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: litellm-config
|
||||
labels:
|
||||
app.kubernetes.io/name: litellm
|
||||
app.kubernetes.io/component: config
|
||||
app.kubernetes.io/part-of: ocdp-workload
|
||||
data:
|
||||
config.yaml: |
|
||||
model_list:
|
||||
- model_name: default
|
||||
litellm_params:
|
||||
model: openai/default
|
||||
api_base: os.environ/LITELLM_UPSTREAM_API_BASE
|
||||
api_key: os.environ/LITELLM_UPSTREAM_API_KEY
|
||||
litellm_settings:
|
||||
drop_params: true
|
||||
request_timeout: 600
|
||||
|
||||
80
apps/litellm/base/deployment.yaml
Normal file
80
apps/litellm/base/deployment.yaml
Normal file
@ -0,0 +1,80 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: litellm
|
||||
labels:
|
||||
app.kubernetes.io/name: litellm
|
||||
app.kubernetes.io/component: gateway
|
||||
app.kubernetes.io/part-of: ocdp-workload
|
||||
annotations: {}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: litellm
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: litellm
|
||||
app.kubernetes.io/component: gateway
|
||||
app.kubernetes.io/part-of: ocdp-workload
|
||||
spec:
|
||||
containers:
|
||||
- name: litellm
|
||||
image: docker.litellm.ai/berriai/litellm:main-stable
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- --config
|
||||
- /app/config.yaml
|
||||
- --port
|
||||
- "4000"
|
||||
- --num_workers
|
||||
- "2"
|
||||
env:
|
||||
- name: LITELLM_MASTER_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: litellm-secrets
|
||||
key: masterKey
|
||||
- name: LITELLM_SALT_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: litellm-secrets
|
||||
key: saltKey
|
||||
- name: LITELLM_UPSTREAM_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: litellm-secrets
|
||||
key: upstreamApiKey
|
||||
- name: LITELLM_UPSTREAM_API_BASE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: litellm-secrets
|
||||
key: upstreamApiBase
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 4000
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health/readiness
|
||||
port: http
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health/liveliness
|
||||
port: http
|
||||
resources:
|
||||
requests:
|
||||
cpu: "250m"
|
||||
memory: 512Mi
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 1Gi
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /app/config.yaml
|
||||
subPath: config.yaml
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: litellm-config
|
||||
|
||||
7
apps/litellm/base/kustomization.yaml
Normal file
7
apps/litellm/base/kustomization.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- configmap.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
|
||||
16
apps/litellm/base/service.yaml
Normal file
16
apps/litellm/base/service.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: litellm
|
||||
labels:
|
||||
app.kubernetes.io/name: litellm
|
||||
app.kubernetes.io/component: gateway
|
||||
app.kubernetes.io/part-of: ocdp-workload
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: litellm
|
||||
ports:
|
||||
- name: http
|
||||
port: 4000
|
||||
targetPort: http
|
||||
|
||||
21
apps/litellm/components/ingress/ingress.yaml
Normal file
21
apps/litellm/components/ingress/ingress.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: litellm
|
||||
labels:
|
||||
app.kubernetes.io/name: litellm
|
||||
app.kubernetes.io/component: ingress
|
||||
app.kubernetes.io/part-of: ocdp-workload
|
||||
spec:
|
||||
rules:
|
||||
- host: litellm.example.local
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: litellm
|
||||
port:
|
||||
name: http
|
||||
|
||||
5
apps/litellm/components/ingress/kustomization.yaml
Normal file
5
apps/litellm/components/ingress/kustomization.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
resources:
|
||||
- ingress.yaml
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
patches:
|
||||
- path: service-loadbalancer-patch.yaml
|
||||
target:
|
||||
kind: Service
|
||||
name: litellm
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
- op: add
|
||||
path: /spec/type
|
||||
value: LoadBalancer
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
patches:
|
||||
- path: service-nodeport-patch.yaml
|
||||
target:
|
||||
kind: Service
|
||||
name: litellm
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
- op: add
|
||||
path: /spec/type
|
||||
value: NodePort
|
||||
|
||||
Reference in New Issue
Block a user