Compare commits
1
Commits
f5ba90c64d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a65a7a070
|
@@ -1,3 +1,13 @@
|
|||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# defaults file for ansible-role-localrecall
|
# defaults file for ansible-role-localrecall
|
||||||
|
localrecall_collection_db_pvc_size: 10Gi
|
||||||
|
localrecall_file_assets_pvc_size: 10Gi
|
||||||
|
localrecall_file_assets: /state/assets
|
||||||
|
localrecall_collection_db_path: /state/db
|
||||||
|
localrecall_embedding_model: granite-embedding-107m-multilingual
|
||||||
|
localrecall_openai_api_key: changeme
|
||||||
|
localrecall_openai_base_url: http://localai:8080/
|
||||||
|
localrecall_api_keys:
|
||||||
|
- 123abc
|
||||||
|
- abc123
|
||||||
|
|||||||
+142
@@ -1,3 +1,145 @@
|
|||||||
#SPDX-License-Identifier: MIT-0
|
#SPDX-License-Identifier: MIT-0
|
||||||
---
|
---
|
||||||
# tasks file for ansible-role-localrecall
|
# tasks file for ansible-role-localrecall
|
||||||
|
- name: Create namespace for localrecall
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: localrecall
|
||||||
|
|
||||||
|
- name: Create pvc for localrecall file assets
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: localrecall-file-assets
|
||||||
|
namespace: localrecall
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: "{{ localrecall_file_assets_pvc_size }}"
|
||||||
|
|
||||||
|
- name: Create pvc for localrecall collection db
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: localrecall-collection-db
|
||||||
|
namespace: localrecall
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: "{{ localrecall_collection_db_pvc_size }}"
|
||||||
|
|
||||||
|
- name: Create deployment for localrecall
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: localrecall
|
||||||
|
namespace: localrecall
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: localrecall
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: localrecall
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: localrecall
|
||||||
|
image: quay.io/mudler/localrecall:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
volumeMounts:
|
||||||
|
- name: collection-db
|
||||||
|
mountPath: "{{ localrecall_collection_db_path }}"
|
||||||
|
- name: file-assets
|
||||||
|
mountPath: "{{ localrecall_file_assets }}"
|
||||||
|
env:
|
||||||
|
- name: COLLECTION_DB_PATH
|
||||||
|
value: "{{ localrecall_collection_db_path }}"
|
||||||
|
- name: EMBEDDING_MODEL
|
||||||
|
value: "{{ localrecall_embedding_model }}"
|
||||||
|
- name: FILE_ASSETS
|
||||||
|
value: "{{ localrecall_file_assets }}"
|
||||||
|
- name: OPENAI_API_KEY
|
||||||
|
value: "{{ localrecall_openai_api_key }}"
|
||||||
|
- name: OPENAI_BASE_URL
|
||||||
|
value: "{{ localrecall_openai_base_url }}"
|
||||||
|
- name: API_KEYS
|
||||||
|
value: "{{ localrecall_api_keys | join(',') }}"
|
||||||
|
volumes:
|
||||||
|
- name: collection-db
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: localrecall-collection-db
|
||||||
|
- name: file-assets
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: localrecall-file-assets
|
||||||
|
|
||||||
|
- name: Create service for localrecall
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: localrecall
|
||||||
|
namespace: localrecall
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: localrecall
|
||||||
|
|
||||||
|
- name: Create ingress for localrecall
|
||||||
|
k8s:
|
||||||
|
state: present
|
||||||
|
definition:
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: localrecall-ingress
|
||||||
|
namespace: localrecall
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: ca-issuer
|
||||||
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
kubernetes.io/ingress.class: "nginx"
|
||||||
|
nginx.ingress.kubernetes.io/configuration-snippet: |
|
||||||
|
more_set_headers "X-Forwarded-For $http_x_forwarded_for";
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: localrecall.eom.dev
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: localrecall
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- localrecall.eom.dev
|
||||||
|
secretName: localrecall-tls
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user