k3s (D6): Dienst-VM k3s per tofu, Rollen k3s-server/k3s-agent/k3s-apps, Manifeste, NEX-Sprachdienste als k3s-Umzugstest
ci / test (push) Failing after 22s
ci / test (push) Failing after 22s
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
6cccc01d14
commit
2c1d43e9c7
@@ -0,0 +1,6 @@
|
||||
# Umzug der NEX-Sprachdienste von Docker Compose nach k3s (gleiche VM, gleiche Ports, gleiche Images).
|
||||
nex_speech_dir: /opt/nex-speech
|
||||
nex_speech_images:
|
||||
- knaster/nex-whisper:v1.9.4-cu12.6
|
||||
- knaster/nex-tts-piper:1.8.0
|
||||
nex_speech_k3s_manifests: "{{ playbook_dir }}/../../../../deploy/k8s/nex-speech"
|
||||
@@ -0,0 +1,40 @@
|
||||
# 1. Images aus Docker in das containerd von k3s übernehmen (kein Neubau, kein Registry-Umweg)
|
||||
- name: Images in k3s vorhanden?
|
||||
ansible.builtin.command: /usr/local/bin/k3s ctr images ls -q
|
||||
register: k3s_images
|
||||
changed_when: false
|
||||
|
||||
- name: Images aus Docker importieren
|
||||
ansible.builtin.shell: docker save {{ item }} | /usr/local/bin/k3s ctr images import -
|
||||
loop: "{{ nex_speech_images }}"
|
||||
when: ("docker.io/" ~ item) not in k3s_images.stdout
|
||||
async: 1800
|
||||
poll: 15
|
||||
|
||||
# 2. Compose-Stack anhalten (Host-Ports 8178/8179 werden frei), Dateien bleiben für den Rückweg
|
||||
- name: Compose-Stack nex-speech anhalten
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ nex_speech_dir }}"
|
||||
state: stopped
|
||||
when: nex_speech_compose_stop | default(true)
|
||||
|
||||
# 3. Manifeste anwenden und auf Bereitschaft warten (Probes prüfen /health in der VM)
|
||||
- name: Manifeste anwenden
|
||||
ansible.builtin.command: kubectl apply -f {{ nex_speech_k3s_manifests }}/
|
||||
register: nex_apply
|
||||
changed_when: "'configured' in nex_apply.stdout or 'created' in nex_apply.stdout"
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Warten, bis beide Deployments bereit sind
|
||||
ansible.builtin.command: kubectl -n nex rollout status deployment/{{ item }} --timeout=600s
|
||||
loop: [nex-stt, nex-tts]
|
||||
changed_when: false
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Gesundheit in der VM prüfen
|
||||
ansible.builtin.uri:
|
||||
url: "http://127.0.0.1:{{ item }}/health"
|
||||
status_code: 200
|
||||
loop: [8178, 8179]
|
||||
Reference in New Issue
Block a user