mgckind / kube_nebula

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kubernetes in OpenStack

Simple commands to install and control a kuberneter cluster in Openstack

WARNING NOTE ⚠️ ⚠️

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

Requirements

It only works in python 2 given that ansible is not fully python 3 compatible. All packages below are pip installables.

Configuration

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.

Command Examples

Create network

python admin_cluster.py <my_net> --create-network

Create master

python admin_cluster.py <my_net> --master

Add nodes

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.

All at once

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

To set up a cluster of 5 nodes in one command

python admin_cluster.py <my_net> --create-network --master --add-nodes 4 -run

Custon names for the nodes

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

Adding nodes after cluster is created

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

Delete cluster in network

python admin_cluster.py <my_net> --delete-cluster --force

Delete network

python admin_cluster.py <my_net> --delete-network --force

About


Languages

Language:Python 93.0%Language:Shell 7.0%Language:HTML 0.1%