forked from inference-gateway/inference-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
97 lines (92 loc) · 3.75 KB
/
Copy pathTaskfile.yaml
File metadata and controls
97 lines (92 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
version: "3"
tasks:
deploy-infrastructure:
desc: "Deploy monitoring infrastructure"
cmds:
- ctlptl apply -f Cluster.yaml
- helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
- helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- helm repo add grafana https://grafana.github.io/helm-charts
- echo "🚀 Starting monitoring infrastructure deployment..."
- |
helm upgrade --install \
--create-namespace \
--namespace kube-system \
--set controller.progressDeadlineSeconds=500 \
--version 4.12.2 \
--wait \
ingress-nginx ingress-nginx/ingress-nginx
- |
helm upgrade --install \
--create-namespace \
--namespace monitoring \
--version 72.6.2 \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
--set-string prometheus.prometheusSpec.serviceMonitorNamespaceSelector.matchLabels.monitoring=true \
--set prometheus.enabled=false \
--set alertmanager.enabled=false \
--set kubeStateMetrics.enabled=false \
--set nodeExporter.enabled=false \
--set grafana.enabled=false \
--wait \
prometheus-operator prometheus-community/kube-prometheus-stack
- |
helm upgrade --install \
--create-namespace \
--namespace monitoring \
--version 5.18.0 \
--wait \
grafana-operator grafana/grafana-operator
- kubectl label namespace monitoring monitoring="true" --overwrite
- kubectl apply -f prometheus/
- kubectl apply -f grafana/
- echo "📊 Monitoring infrastructure deployed successfully!"
deploy-inference-gateway:
desc: "Deploy inference-gateway with monitoring and autoscaling enabled"
cmds:
- |
helm upgrade --install \
--create-namespace \
--namespace inference-gateway \
--set config.ENABLE_TELEMETRY=true \
--set config.OLLAMA_API_URL="http://ollama.ollama:8080/v1" \
--set monitoring.enabled=true \
--set ingress.enabled=true \
--set autoscaling.enabled=true \
--set autoscaling.minReplicas=2 \
--set autoscaling.maxReplicas=10 \
--set autoscaling.targetCPUUtilizationPercentage=80 \
--set autoscaling.targetMemoryUtilizationPercentage=80 \
--version 0.7.1 \
--wait \
inference-gateway oci://ghcr.io/inference-gateway/charts/inference-gateway
- kubectl label namespace inference-gateway monitoring="true" --overwrite
- echo "📈 Inference Gateway with monitoring and autoscaling deployed successfully!"
deploy-ollama:
desc: "Deploy ollama as a provider"
cmds:
- kubectl create namespace ollama --dry-run=client -o yaml | kubectl apply -f -
- |
kubectl apply -f ollama/
- kubectl -n ollama rollout status deployment ollama
- echo "🤖 Ollama provider deployed successfully!"
simulate-requests:
desc: "Generate test requests to simulate monitoring"
cmds:
- |
for i in $(seq 1 20); do
curl -s -X POST http://api.inference-gateway.local/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"ollama/deepseek-r1:1.5b","messages":[{"role":"user","content":"Say hello"}]}' \
--max-time 10
echo
sleep 1
done
- echo "🧪 Test requests completed successfully!"
clean:
desc: "Clean up the cluster"
cmds:
- ctlptl delete -f Cluster.yaml
- echo "🧹 Cluster cleaned up successfully!"