From 2b930a1687a190e401cc52254ccb09dfc718d533 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 5 Apr 2024 11:22:31 -0400 Subject: [PATCH] Update deployment of localai to basic deployment --- localai/localai-deployment.yaml | 32 +++++++++++++++++++ ...ase.yaml => localai-helm-release.yaml.off} | 0 localai/localai-pvc.yaml | 11 +++++++ localai/localai-service.yaml | 13 ++++++++ 4 files changed, 56 insertions(+) create mode 100644 localai/localai-deployment.yaml rename localai/{localai-helm-release.yaml => localai-helm-release.yaml.off} (100%) create mode 100644 localai/localai-pvc.yaml create mode 100644 localai/localai-service.yaml diff --git a/localai/localai-deployment.yaml b/localai/localai-deployment.yaml new file mode 100644 index 0000000..9d82038 --- /dev/null +++ b/localai/localai-deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: localai + namespace: localai-ns +spec: + replicas: 1 + selector: + matchLabels: + app: localai + template: + metadata: + labels: + app: localai + spec: + runtimeClassName: nvidia + resources: + limits: + nvidia.com/gpu: 2 + containers: + - name: localai + image: quay.io/go-skynet/local-ai:latest-aio-gpu-nvidia-cuda-12 + ports: + - containerPort: 80 + env: + volumeMounts: + - mountPath: "/models" + name: models + volumes: + - name: models + persistentVolumeClaim: + claimName: localai-pvc diff --git a/localai/localai-helm-release.yaml b/localai/localai-helm-release.yaml.off similarity index 100% rename from localai/localai-helm-release.yaml rename to localai/localai-helm-release.yaml.off diff --git a/localai/localai-pvc.yaml b/localai/localai-pvc.yaml new file mode 100644 index 0000000..81c8a6f --- /dev/null +++ b/localai/localai-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: localai-pvc + namespace: localai-ns +spec: + accessModes: + - ReadWritemany + resources: + requests: + storage: 20Gi diff --git a/localai/localai-service.yaml b/localai/localai-service.yaml new file mode 100644 index 0000000..d10e413 --- /dev/null +++ b/localai/localai-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: localai + namespace: localai-ns +spec: + type: LoadBalancer + selector: + app: localai + ports: + - port: 80 + targetPort: 80 + protocol: TCP