k8s/roles/vllm/tasks/deploy.yml

37 lines
1.2 KiB
YAML

---
- name: Helm | Add vLLM chart repository
ansible.builtin.command: helm repo add vllm https://vllm-project.github.io/charts
environment:
KUBECONFIG: "{{ vllm_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
register: _helm_repo_add
changed_when: "'already exists' not in _helm_repo_add.stdout"
failed_when: _helm_repo_add.rc != 0 and 'already exists' not in _helm_repo_add.stdout
- name: Helm | Update chart repositories
ansible.builtin.command: helm repo update
environment:
KUBECONFIG: "{{ vllm_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
changed_when: false
- name: vLLM | Render values
ansible.builtin.template:
src: vllm-values.yml.j2
dest: /tmp/vllm-values.yml
mode: "0600"
- name: vLLM | Install or upgrade
ansible.builtin.command: >
helm upgrade --install vllm vllm/vllm
--namespace {{ vllm_namespace }}
--version {{ vllm_chart_version }}
--values /tmp/vllm-values.yml
--timeout 15m0s
--wait
environment:
KUBECONFIG: "{{ vllm_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
register: _helm_install
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"