diff --git a/n8n/chroma-configmap.yaml b/n8n/chroma-configmap.yaml new file mode 100644 index 0000000..2845971 --- /dev/null +++ b/n8n/chroma-configmap.yaml @@ -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] diff --git a/n8n/chroma-deployment.yaml b/n8n/chroma-deployment.yaml new file mode 100644 index 0000000..8e96ef5 --- /dev/null +++ b/n8n/chroma-deployment.yaml @@ -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 diff --git a/n8n/chroma-ingress.yaml b/n8n/chroma-ingress.yaml new file mode 100644 index 0000000..c6ffad9 --- /dev/null +++ b/n8n/chroma-ingress.yaml @@ -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 diff --git a/n8n/chroma-pv.yaml b/n8n/chroma-pv.yaml new file mode 100644 index 0000000..2b2acff --- /dev/null +++ b/n8n/chroma-pv.yaml @@ -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 diff --git a/n8n/chroma-pvc.yaml b/n8n/chroma-pvc.yaml new file mode 100644 index 0000000..a4adba1 --- /dev/null +++ b/n8n/chroma-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: chroma-pvc + namespace: n8n +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: microk8s-hostpath diff --git a/n8n/chroma-service.yaml b/n8n/chroma-service.yaml new file mode 100644 index 0000000..63a2f71 --- /dev/null +++ b/n8n/chroma-service.yaml @@ -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 diff --git a/n8n/chroma_x86.tar b/n8n/chroma_x86.tar new file mode 100644 index 0000000..4ab7d45 Binary files /dev/null and b/n8n/chroma_x86.tar differ diff --git a/n8n/inin_chroma.sh b/n8n/inin_chroma.sh new file mode 100755 index 0000000..c922db8 --- /dev/null +++ b/n8n/inin_chroma.sh @@ -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