n8n和chroma可以了
This commit is contained in:
parent
8424ede01a
commit
083ca14f37
22
n8n/chroma-configmap.yaml
Normal file
22
n8n/chroma-configmap.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: chroma-config
|
||||||
|
namespace: n8n
|
||||||
|
data:
|
||||||
|
log_config.yml: |
|
||||||
|
version: 1
|
||||||
|
disable_existing_loggers: False
|
||||||
|
formatters:
|
||||||
|
simple:
|
||||||
|
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||||
|
handlers:
|
||||||
|
console:
|
||||||
|
class: logging.StreamHandler
|
||||||
|
level: DEBUG
|
||||||
|
formatter: simple
|
||||||
|
stream: ext://sys.stdout
|
||||||
|
root:
|
||||||
|
level: DEBUG
|
||||||
|
handlers: [console]
|
27
n8n/chroma-deployment.yaml
Normal file
27
n8n/chroma-deployment.yaml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: chroma-deployment
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: chroma
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: chroma
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: chroma
|
||||||
|
image: localhost:32000/chromadb/chroma
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
volumeMounts:
|
||||||
|
- name: chroma-storage
|
||||||
|
mountPath: /home/node/.n8n/
|
||||||
|
volumes:
|
||||||
|
- name: chroma-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: chroma-pvc
|
18
n8n/chroma-ingress.yaml
Normal file
18
n8n/chroma-ingress.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: chroma-ingress
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: chroma.k8s.xunlang.home
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: chroma-service
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
path: /
|
||||||
|
pathType: Prefix
|
15
n8n/chroma-pv.yaml
Normal file
15
n8n/chroma-pv.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: chroma-pv
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 10Gi
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
storageClassName: microk8s-hostpath
|
||||||
|
hostPath:
|
||||||
|
path: /var/snap/microk8s/common/mnt/data/chroma
|
12
n8n/chroma-pvc.yaml
Normal file
12
n8n/chroma-pvc.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: chroma-pvc
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
storageClassName: microk8s-hostpath
|
13
n8n/chroma-service.yaml
Normal file
13
n8n/chroma-service.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: chroma-service
|
||||||
|
namespace: n8n
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: chroma
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
type: ClusterIP
|
BIN
n8n/chroma_x86.tar
Normal file
BIN
n8n/chroma_x86.tar
Normal file
Binary file not shown.
17
n8n/inin_chroma.sh
Executable file
17
n8n/inin_chroma.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
# 创建命名空间(如果不存在)
|
||||||
|
microk8s.kubectl create namespace n8n
|
||||||
|
|
||||||
|
# 创建 PV
|
||||||
|
microk8s.kubectl apply -f chroma-pv.yaml
|
||||||
|
|
||||||
|
# 创建 PVC
|
||||||
|
microk8s.kubectl apply -f chroma-pvc.yaml
|
||||||
|
|
||||||
|
# 创建 Deployment
|
||||||
|
microk8s.kubectl apply -f chroma-deployment.yaml
|
||||||
|
|
||||||
|
# 创建 Service
|
||||||
|
microk8s.kubectl apply -f chroma-service.yaml
|
||||||
|
|
||||||
|
# 创建 Ingress
|
||||||
|
microk8s.kubectl apply -f chroma-ingress.yaml
|
Loading…
x
Reference in New Issue
Block a user