Vladimir Kozhukalov bda43dfff8 Add deploy-env role
This role works both for singlenode and multinode
inventories. The role installs all necessary prerequisites
and deploys K8s with Containerd as a container runtime.
The idea is to use this role to deploy
all test singlenode/multinode environments for all test jobs.

This PR wraps into a role playbooks that
we are currently using for multinode compute-kit tests.

Change-Id: I41bbe80d806e614a155e6775c4505a4d81a086e8
2023-09-06 13:19:44 +03:00

40 lines
1.1 KiB
YAML

---
- name: Include prerequisites tasks
include_tasks:
file: prerequisites.yaml
- name: Include common tasks
include_tasks:
file: containerd.yaml
- name: Include common tasks
include_tasks:
file: common_k8s.yaml
- name: Include control-plane tasks
include_tasks:
file: control-plane.yaml
when: inventory_hostname == 'primary'
- name: Join workload nodes to cluster
command: "{{ hostvars['primary']['join_command'].stdout_lines[0] }}"
when: inventory_hostname in (groups['nodes'] | default([]))
- name: Wait for cluster is ready
become: false
block:
- name: Wait for Calico pods ready
command: kubectl -n kube-system wait --timeout=240s --for=condition=Ready pods -l k8s-app=calico-node
- name: Wait for Coredns pods ready
command: kubectl -n kube-system wait --timeout=240s --for=condition=Ready pods -l k8s-app=kube-dns
when: inventory_hostname == 'primary'
- name: Add coredns to /etc/resolv.conf
lineinfile:
line: nameserver 10.96.0.10
path: /etc/resolv.conf
state: present
insertbefore: "BOF"
...