Skip to content

Commit

Permalink
Add Kubernetes support (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
todaywasawesome authored Aug 18, 2023
1 parent bd50076 commit ca6ec9b
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
20 changes: 20 additions & 0 deletions deploy/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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"
29 changes: 29 additions & 0 deletions deploy/kubernetes/llama-gpt-api-deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions deploy/kubernetes/llama-gpt-api-service.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
26 changes: 26 additions & 0 deletions deploy/kubernetes/llama-gpt-ui-deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions deploy/kubernetes/llama-gpt-ui-service.yaml
Original file line number Diff line number Diff line change
@@ -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: {}

0 comments on commit ca6ec9b

Please sign in to comment.