LocalAI/examples/k8sgpt
dependabot[bot] 905ed62ee3
chore(deps): Bump nginx from 1.a.b.c to 1.27.0 in /examples/k8sgpt (#2790)
Bumps nginx from 1.a.b.c to 1.27.0.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-13 00:41:25 +00:00
..
broken-pod.yaml chore(deps): Bump nginx from 1.a.b.c to 1.27.0 in /examples/k8sgpt (#2790) 2024-07-13 00:41:25 +00:00
README.md Update to working k8sgpt + localai example in documentation (#852) 2023-08-01 22:31:36 +02:00
values.yaml chore(deps): Update Dependencies (#2538) 2024-07-12 19:54:08 +00:00

k8sgpt example

This example show how to use LocalAI with k8sgpt

Screenshot from 2023-06-19 23-58-47

Create the cluster locally with Kind (optional)

If you want to test this locally without a remote Kubernetes cluster, you can use kind.

Install kind and create a cluster:

kind create cluster

Setup LocalAI

We will use helm:

helm repo add go-skynet https://go-skynet.github.io/helm-charts/
helm repo update

# Clone LocalAI
git clone https://github.com/go-skynet/LocalAI

cd LocalAI/examples/k8sgpt

# modify values.yaml preload_models with the models you want to install.
# CHANGE the URL to a model in huggingface.
helm install local-ai go-skynet/local-ai --create-namespace --namespace local-ai --values values.yaml

Setup K8sGPT

# Install k8sgpt
helm repo add k8sgpt https://charts.k8sgpt.ai/
helm repo update
helm install release k8sgpt/k8sgpt-operator -n k8sgpt-operator-system --create-namespace --version 0.0.17

Apply the k8sgpt-operator configuration:

kubectl apply -f - << EOF
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  name: k8sgpt-local-ai
  namespace: default
spec:
  backend: localai
  baseUrl: http://local-ai.local-ai.svc.cluster.local:8080/v1
  noCache: false
  model: gpt-3.5-turbo
  version: v0.3.0
  enableAI: true
EOF

Test

Apply a broken pod:

kubectl apply -f broken-pod.yaml

ArgoCD Deployment Example

Deploy K8sgpt + localai with Argocd