Add Kubernetes support (#18)

This commit is contained in:
Dan Garfield 2023-08-18 10:48:24 -06:00 committed by GitHub
parent bd50076aae
commit ca6ec9b370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- llama-gpt-api-deployment.yaml
- llama-gpt-api-service.yaml
- llama-gpt-ui-deployment.yaml
- llama-gpt-ui-service.yaml
# patches:
# -
configMapGenerator:
- name: llama-gpt
literals:
- DEFAULT_MODEL="/models/llama-2-7b-chat.bin"
- OPENAI_API_HOST="http://llama-gpt-api:8000"
- OPENAI_API_KEY="sk-XXXXXXXXXXXXXXXXXXXX"
- WAIT_HOSTS="llama-gpt-api:8000"
- WAIT_TIMEOUT="600"

View File

@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: llama-gpt-api
name: llama-gpt-api
spec:
replicas: 1
selector:
matchLabels:
service: llama-gpt-api
template:
metadata:
labels:
service: llama-gpt-api
spec:
containers:
- name: llama-gpt-api
image: ghcr.io/getumbrel/llama-gpt-api:1.0.1
env:
- name: MODEL
valueFrom:
configMapKeyRef:
name: llama-gpt
key: DEFAULT_MODEL
resources:
requests:
memory: 5Gi
restartPolicy: Always

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: llama-gpt-api
name: llama-gpt-api
spec:
ports:
- name: api
port: 8000
targetPort: 8000
selector:
service: llama-gpt-api
status:
loadBalancer: {}

View File

@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: llama-gpt-ui
name: llama-gpt-ui
spec:
replicas: 1
selector:
matchLabels:
service: llama-gpt-ui
template:
metadata:
labels:
service: llama-gpt-ui
spec:
containers:
- name: llama-gpt-ui
image: ghcr.io/getumbrel/llama-gpt-ui:latest
envFrom:
- configMapRef:
name: llama-gpt
ports:
- containerPort: 3000
resources: {}
restartPolicy: Always

View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: llama-gpt-ui
name: llama-gpt-ui
spec:
ports:
- name: ui
port: 3000
targetPort: 3000
selector:
service: llama-gpt-ui
type: ClusterIP
status:
loadBalancer: {}