Kubespray-readme-1.sh
· 1.3 KiB · Bash
Raw
# Copy ``inventory/sample`` as ``inventory/mycluster``
cp -rfp inventory/sample inventory/mycluster
# Update Ansible inventory file with inventory builder
declare -a IPS=(10.10.1.3 10.10.1.4 10.10.1.5)
CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
# Review and change parameters under ``inventory/mycluster/group_vars``
cat inventory/mycluster/group_vars/all/all.yml
cat inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml
# Clean up old Kubernetes cluster with Ansible Playbook - run the playbook as root
# The option `--become` is required, as for example cleaning up SSL keys in /etc/,
# uninstalling old packages and interacting with various systemd daemons.
# Without --become the playbook will fail to run!
# And be mind it will remove the current kubernetes cluster (if it's running)!
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root reset.yml
# Deploy Kubespray with Ansible Playbook - run the playbook as root
# The option `--become` is required, as for example writing SSL keys in /etc/,
# installing packages and interacting with various systemd daemons.
# Without --become the playbook will fail to run!
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml
1 | # Copy ``inventory/sample`` as ``inventory/mycluster`` |
2 | cp -rfp inventory/sample inventory/mycluster |
3 | |
4 | # Update Ansible inventory file with inventory builder |
5 | declare -a IPS=(10.10.1.3 10.10.1.4 10.10.1.5) |
6 | CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]} |
7 | |
8 | # Review and change parameters under ``inventory/mycluster/group_vars`` |
9 | cat inventory/mycluster/group_vars/all/all.yml |
10 | cat inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml |
11 | |
12 | # Clean up old Kubernetes cluster with Ansible Playbook - run the playbook as root |
13 | # The option `--become` is required, as for example cleaning up SSL keys in /etc/, |
14 | # uninstalling old packages and interacting with various systemd daemons. |
15 | # Without --become the playbook will fail to run! |
16 | # And be mind it will remove the current kubernetes cluster (if it's running)! |
17 | ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root reset.yml |
18 | |
19 | # Deploy Kubespray with Ansible Playbook - run the playbook as root |
20 | # The option `--become` is required, as for example writing SSL keys in /etc/, |
21 | # installing packages and interacting with various systemd daemons. |
22 | # Without --become the playbook will fail to run! |
23 | ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml |