This folder contains AdvantEDGE ansible playbooks.
No newline at end of file
This folder provides an **Ansible-based automation framework** to set up a multi-node Kubernetes cluster for ETSI MEC Sandbox.
---
## Pre-requisites
Before running the playbooks, ensure:
1. You have **Ansible** installed on your control machine.
2. You have **SSH access** to all remote nodes (master & workers, if applicable).
> **Note:** If your playbooks are running on `localhost` (control machine itself), **SSH is not required**. SSH setup is only necessary for remote worker or master nodes.
> `-K` prompts for sudo password if required. You can also export `ANSIBLE_BECOME_PASSWORD` or configure passwordless sudo.
## Variables
*`container_runtime`: `"containerd"` (default) or `"docker"`
*`kube_version`: `"1.29.*"`
*`pod_network_cidr`: `"192.168.0.0/16"`
*`calico_version`: `"v3.30.0"`
*`install_dev_env`: `true` → set to `false` to disable Node/Go tooling
## Tags
You can run just parts of the setup with `--tags` or skip parts with `--skip-tags`. (The roles here are intentionally simple and do not define custom tags; feel free to add them if you want finer control.)
## 📖 Notes
* Ensure worker nodes have SSH access configured before running.
* Use `--tags` if you want to run specific roles (e.g. `--tags kubernetes,helm`).
3. Run the playbook for master first (to initialize control plane and produce join script):
```bash
ansible-playbook -K-l k8s_masters site.yml
```
After successful run, a join command will be generated on the master at `/tmp/kube_join_cmd.sh`. You can retrieve it with `scp` or `ansible.builtin.fetch`.
4. Copy the `/tmp/kube_join_cmd.sh` to each worker node (e.g., `/tmp/kube_join_cmd.sh`) so that the worker play can use it. Example using scp:
Alternatively, you can fetch it programmatically in Ansible from master and distribute to workers via a small play/role.
5. Run the worker play:
```bash
ansible-playbook -K-l k8s_workers site.yml
```
Notes:
- Worker nodes will only run `common`, `kernel`, `container_runtime`, and `kubernetes/worker` roles as requested.
- The `kubernetes/worker` role expects a join script (created on master) at `/tmp/kube_join_cmd.sh`. If you prefer, you can expose the master token & CA hash via a secure variable and run `kubeadm join` directly in the role.