You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

  1. # Ansible collection
  2. Kubespray can be installed as an [Ansible collection](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html).
  3. ## Requirements
  4. - An inventory file with the appropriate host groups. See the [README](../README.md#usage).
  5. - A `group_vars` directory. These group variables **need** to match the appropriate variable names under `inventory/local/group_vars`. See the [README](../README.md#usage).
  6. ## Usage
  7. 1. Add Kubespray to your requirements.yml file
  8. ```yaml
  9. collections:
  10. - name: https://github.com/kubernetes-sigs/kubespray
  11. type: git
  12. version: v2.22.1
  13. ```
  14. 2. Install your collection
  15. ```ShellSession
  16. ansible-galaxy install -r requirements.yml
  17. ```
  18. 3. Create a playbook to install your Kubernetes cluster
  19. ```yaml
  20. - name: Install Kubernetes
  21. ansible.builtin.import_playbook: kubernetes_sigs.kubespray.cluster
  22. ```
  23. 4. Update INVENTORY and PLAYBOOK so that they point to your inventory file and the playbook you created above, and then install Kubespray
  24. ```ShellSession
  25. ansible-playbook -i INVENTORY --become --become-user=root PLAYBOOK
  26. ```