91 lines
1.9 KiB
YAML
91 lines
1.9 KiB
YAML
|
|
apiVersion: v1
|
||
|
|
kind: Namespace
|
||
|
|
metadata:
|
||
|
|
name: llm-proxy
|
||
|
|
---
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: llm-proxy
|
||
|
|
namespace: llm-proxy
|
||
|
|
labels:
|
||
|
|
app: llm-proxy
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: llm-proxy
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: llm-proxy
|
||
|
|
spec:
|
||
|
|
imagePullSecrets:
|
||
|
|
- name: registry-creds
|
||
|
|
containers:
|
||
|
|
- name: llm-proxy
|
||
|
|
image: registry.famzheng.me/mochi/llm-proxy:latest
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
ports:
|
||
|
|
- containerPort: 8080
|
||
|
|
name: http
|
||
|
|
envFrom:
|
||
|
|
# secret `proxy-credentials` 由 kubectl 手工创建(BACKEND_TOKEN +
|
||
|
|
# PROXY_AUTH_TOKEN),不在 git manifest 里。
|
||
|
|
- secretRef:
|
||
|
|
name: proxy-credentials
|
||
|
|
env:
|
||
|
|
- name: LLM_GATEWAY
|
||
|
|
value: "http://3.135.65.204:8848/v1"
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /healthz
|
||
|
|
port: http
|
||
|
|
initialDelaySeconds: 1
|
||
|
|
periodSeconds: 5
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /healthz
|
||
|
|
port: http
|
||
|
|
initialDelaySeconds: 5
|
||
|
|
periodSeconds: 15
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: 10m
|
||
|
|
memory: 16Mi
|
||
|
|
limits:
|
||
|
|
cpu: 200m
|
||
|
|
memory: 128Mi
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: llm-proxy
|
||
|
|
namespace: llm-proxy
|
||
|
|
spec:
|
||
|
|
selector:
|
||
|
|
app: llm-proxy
|
||
|
|
ports:
|
||
|
|
- name: http
|
||
|
|
port: 80
|
||
|
|
targetPort: 8080
|
||
|
|
---
|
||
|
|
apiVersion: networking.k8s.io/v1
|
||
|
|
kind: Ingress
|
||
|
|
metadata:
|
||
|
|
name: llm-proxy
|
||
|
|
namespace: llm-proxy
|
||
|
|
spec:
|
||
|
|
ingressClassName: traefik
|
||
|
|
rules:
|
||
|
|
- host: llm.famzheng.me
|
||
|
|
http:
|
||
|
|
paths:
|
||
|
|
- path: /
|
||
|
|
pathType: Prefix
|
||
|
|
backend:
|
||
|
|
service:
|
||
|
|
name: llm-proxy
|
||
|
|
port:
|
||
|
|
number: 80
|