mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-02-04 15:53:28 +00:00
ai
This commit is contained in:
94
roles/cripto/files/ai-deployment.yaml
Normal file
94
roles/cripto/files/ai-deployment.yaml
Normal file
@ -0,0 +1,94 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fenix-ai
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: crypto-forecast-api-deployment
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
replicas: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: crypto-forecast-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: crypto-forecast-api
|
||||
spec:
|
||||
containers:
|
||||
- name: crypto-forecast-api
|
||||
image: gitea.fenix-dev.com/fenix-gitea-admin/fenix-cripto-api:0.0.19
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||
env:
|
||||
- name: ASPNETCORE_ENVIRONMENT
|
||||
value: Development
|
||||
volumeMounts:
|
||||
- name: model
|
||||
mountPath: /models
|
||||
volumes:
|
||||
- name: model
|
||||
persistentVolumeClaim:
|
||||
claimName: crypto-forecast-api-model-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: crypto-forecast-api-svc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
selector:
|
||||
app: crypto-forecast-api
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: crypto-forecast-api-model-pv
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: fenix-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/fenix/ai/api/model
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crypto-forecast-api-model-pvc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
storageClassName: fenix-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: crypto-forecast-api-model-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: fenix-ai-nfs-csi
|
||||
namespace: fenix-ai
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
4
roles/cripto/files/ai-namespace.yaml
Normal file
4
roles/cripto/files/ai-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fenix-ai
|
||||
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
@ -0,0 +1,97 @@
|
||||
apiVersion: metallb.io/v1beta1
|
||||
kind: IPAddressPool
|
||||
metadata:
|
||||
name: local-pool-2
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
addresses:
|
||||
- 192.168.1.100-192.168.1.200
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ollama-deployment
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ollama
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ollama
|
||||
spec:
|
||||
containers:
|
||||
- name: ollama
|
||||
image: ollama/ollama:latest
|
||||
ports:
|
||||
- containerPort: 11434
|
||||
resources:
|
||||
limits:
|
||||
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||
env:
|
||||
- name: OLLAMA_HOST
|
||||
value: "0.0.0.0"
|
||||
volumeMounts:
|
||||
- name: ollama-data
|
||||
mountPath: /root/.ollama
|
||||
volumes:
|
||||
- name: ollama-data
|
||||
persistentVolumeClaim:
|
||||
claimName: ollama-data-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ollama-api-svc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
selector:
|
||||
app: ollama
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 11434
|
||||
targetPort: 11434
|
||||
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: ollama-data-pv
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: ollama-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: ollama-data-pvc
|
||||
namespace: fenix-ai
|
||||
spec:
|
||||
storageClassName: ollama-ai-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: ollama-ai-nfs-csi
|
||||
namespace: fenix-ai
|
||||
provisioner: nfs.csi.k8s.io
|
||||
parameters:
|
||||
server: 192.168.1.22
|
||||
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
Reference in New Issue
Block a user