Simple commands to install and control a kuberneter cluster in Openstack
Be carefully when running these scripts, make sure you understand what you are doing and make sure to check current network environments (in OpenStack) to avoid deleting other people instances, this is espscially true when deleting the cluster: Do not use a exiting network name. Make sure to check network topology
It only works in python 2 given that ansible is not fully python 3 compatible. All packages below are pip installables.
The file config_nodes.yml has the initial configuration given OpenStack resources. This also includes the name of the key, if not in current working directory a ssh keipair will be created and upload to the server.
python admin_cluster.py <my_net> --create-network
python admin_cluster.py <my_net> --master
python admin_cluster.py <my_net> --add-nodes <number_of_nodes>
Use --add-nodes
or -an
to specify number of nodes, if flag is absent, no nodes will be added.If no number, the default is 1.
python admin_cluster.py <my_net> --create-network --master --add-nodes <number>
To run ansible using same script add --run-ansible or -run at the end, this will run the playbook on master
python admin_cluster.py <my_net> -run
python admin_cluster.py <my_net> --create-network --master --add-nodes 4 -run
By default the master will have the name <my_net>-master and the nodes will have <my_net>-, you can specify the names for the node with the flag --node-name
or -nn
You can create instances which automatically will be add to the kubernetes cluster (2 steps)
python admin_cluster.py <my_net> --add-nodes <number_of_nodes>
python admin_cluster.py <my_net> -run
python admin_cluster.py <my_net> --delete-cluster --force
python admin_cluster.py <my_net> --delete-network --force