c12s-kubespray/docs/ansible_collection.md
2022-12-15 12:20:41 +01:00

1.1 KiB

Ansible collection

Kubespray can be installed as an Ansible collection.

Requirements

  • An inventory file with the appropriate host groups. See the README.
  • A group_vars directory. These group variables need to match the appropriate variable names under inventory/local/group_vars. See the README.

Usage

  1. Add Kubespray to your requirements.yml file

    collections:
    - name: https://github.com/kubernetes_sigs/kubespray
      type: git
      version: v2.20.0
    
  2. Install your collection

    ansible-galaxy install -r requirements.yml
    
  3. Create a playbook to install your Kubernetes cluster

    - name: Install Kubernetes
      ansible.builtin.import_playbook: kubernetes_sigs.kubespray.cluster
    
  4. Update INVENTORY and PLAYBOOK so that they point to your inventory file and the playbook you created above, and then install Kubespray

    ansible-playbook -i INVENTORY --become --become-user=root PLAYBOOK