Repository navigation
Expand file tree
/
Copy pathapps.yml
More file actions
87 lines (78 loc) · 3.96 KB
/
Copy pathapps.yml
File metadata and controls
87 lines (78 loc) · 3.96 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
---
# Couche applicative : Kueue -> kube-prometheus-stack -> Loki -> quota Kueue -> vLLM.
# Suppose playbook.yml déjà passé (k3s + GPU Operator up).
# Le secret hf-token doit exister avant que le pod vLLM ne tire le modèle :
# ansible-playbook -i inventory.ini apps.yml -e hf_token=hf_xxx (ou secret déjà créé)
- name: Deploy inference + observability stack
hosts: gpu_nodes
become: true
vars:
# >= v0.9 requis : v0.8.x embarque kube-rbac-proxy depuis gcr.io/kubebuilder (registre fermé -> ImagePullBackOff)
kueue_version: "v0.10.1"
repo_root: "{{ playbook_dir | dirname }}"
# Mot de passe admin Grafana : jamais en dur dans le repo.
# Fournir via l'environnement : GRAFANA_ADMIN_PASSWORD=... ansible-playbook ...
# (ou -e grafana_admin_password=... / vault).
grafana_admin_password: "{{ lookup('env', 'GRAFANA_ADMIN_PASSWORD') }}"
environment:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
tasks:
- name: Install Kueue
ansible.builtin.shell: |
k3s kubectl apply --server-side -f \
https://github.com/kubernetes-sigs/kueue/releases/download/{{ kueue_version }}/manifests.yaml
k3s kubectl -n kueue-system wait --for=condition=Available deploy/kueue-controller-manager --timeout=180s
args:
creates: /var/lib/rancher/k3s/kueue.installed
register: kueue
- name: Mark Kueue installed
ansible.builtin.file:
path: /var/lib/rancher/k3s/kueue.installed
state: touch
when: kueue is changed
- name: Add Helm repos (prometheus-community, grafana)
ansible.builtin.shell: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
changed_when: false
- name: Install kube-prometheus-stack (Prometheus + Grafana)
ansible.builtin.shell: |
helm upgrade --install kps prometheus-community/kube-prometheus-stack \
-n monitoring --create-namespace \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.scrapeInterval=5s \
--set grafana.adminPassword="{{ grafana_admin_password }}" \
--set alertmanager.alertmanagerSpec.alertmanagerConfigSelector.matchLabels.release=kps \
--wait --timeout 10m
- name: Enable DCGM exporter ServiceMonitor (GPU Operator)
ansible.builtin.shell: |
helm upgrade gpu-operator nvidia/gpu-operator -n gpu-operator --reuse-values \
--version v24.6.1 \
--set dcgmExporter.serviceMonitor.enabled=true \
--set dcgmExporter.serviceMonitor.interval=5s
- name: Install Loki + Promtail (logs)
ansible.builtin.shell: |
helm upgrade --install loki grafana/loki-stack -n monitoring \
--set loki.isDefault=false --set promtail.enabled=true \
--wait --timeout 5m
- name: Copy Kueue quota + vLLM manifests
ansible.builtin.copy:
src: "{{ repo_root }}/manifests/"
dest: /root/manifests/
- name: Apply Kueue quota (ResourceFlavor/ClusterQueue/LocalQueue)
ansible.builtin.shell: k3s kubectl apply -f /root/manifests/kueue/quota.yaml
- name: Create HF token secret
ansible.builtin.shell: |
k3s kubectl create secret generic hf-token \
--from-literal=token={{ hf_token }} \
--dry-run=client -o yaml | k3s kubectl apply -f -
when: hf_token is defined
no_log: true
- name: Deploy vLLM
ansible.builtin.shell: k3s kubectl apply -f /root/manifests/vllm/vllm.yaml
# Secret telegram-bot-token à créer hors playbook (jamais dans le repo) :
# kubectl -n monitoring create secret generic telegram-bot-token --from-literal=token=***
- name: Deploy alerting (SLO rules + routage Telegram)
ansible.builtin.shell: k3s kubectl apply -f /root/manifests/alerting/rules.yaml