AI/openviking: add k8s manifest (Kustomize) and remove redundant Dockerfile
This commit is contained in:
@@ -1,11 +0,0 @@
|
|||||||
FROM python:3.11-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
RUN pip install openviking --upgrade --force-reinstall
|
|
||||||
|
|
||||||
RUN openviking-server init
|
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
CMD ["openviking-server", "run", "--host", "0.0.0.0", "--port", "8000"]
|
|
||||||
7
AI/openviking/k8s/00-namespace.yaml
Normal file
7
AI/openviking/k8s/00-namespace.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: openviking
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: openviking
|
||||||
|
app.kubernetes.io/managed-by: kubectl
|
||||||
52
AI/openviking/k8s/01-deployment.yaml
Normal file
52
AI/openviking/k8s/01-deployment.yaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: openviking
|
||||||
|
namespace: openviking
|
||||||
|
labels:
|
||||||
|
app: openviking
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: openviking
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: openviking
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: openviking
|
||||||
|
image: ghcr.io/volcengine/openviking:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: openviking-config
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 1Gi
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /ready
|
||||||
|
port: 1933
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 30
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /ready
|
||||||
|
port: 1933
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /app/data
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: openviking-data
|
||||||
16
AI/openviking/k8s/02-service.yaml
Normal file
16
AI/openviking/k8s/02-service.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: openviking
|
||||||
|
namespace: openviking
|
||||||
|
labels:
|
||||||
|
app: openviking
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 8000
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
app: openviking
|
||||||
14
AI/openviking/k8s/03-configmap.yaml
Normal file
14
AI/openviking/k8s/03-configmap.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: openviking-config
|
||||||
|
namespace: openviking
|
||||||
|
data:
|
||||||
|
OVIKING_PORT: "8000"
|
||||||
|
OVIKING_HOST: "0.0.0.0"
|
||||||
|
# 日志级别: debug, info, warn, error
|
||||||
|
OVIKING_LOG_LEVEL: "info"
|
||||||
|
# 数据存储路径(容器内)
|
||||||
|
OVIKING_DATA_DIR: "/app/data"
|
||||||
|
# 向量模型(可选,注释掉则使用默认模型)
|
||||||
|
# OVIKING_EMBED_MODEL: "text-embedding-3-large"
|
||||||
13
AI/openviking/k8s/04-pvc.yaml
Normal file
13
AI/openviking/k8s/04-pvc.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: openviking-data
|
||||||
|
namespace: openviking
|
||||||
|
labels:
|
||||||
|
app: openviking
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
22
AI/openviking/k8s/05-ingress.yaml
Normal file
22
AI/openviking/k8s/05-ingress.yaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: openviking
|
||||||
|
namespace: openviking
|
||||||
|
labels:
|
||||||
|
app: openviking
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: openviking.local
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: openviking
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
16
AI/openviking/k8s/kustomization.yaml
Normal file
16
AI/openviking/k8s/kustomization.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
namespace: openviking
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- 00-namespace.yaml
|
||||||
|
- 01-deployment.yaml
|
||||||
|
- 02-service.yaml
|
||||||
|
- 03-configmap.yaml
|
||||||
|
- 04-pvc.yaml
|
||||||
|
- 05-ingress.yaml
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
app.kubernetes.io/name: openviking
|
||||||
|
app.kubernetes.io/managed-by: kustomize
|
||||||
Reference in New Issue
Block a user