diff options
Diffstat (limited to 'bin/cluster')
-rwxr-xr-x | bin/cluster | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/cluster b/bin/cluster index a3d4b629c..9b02b4347 100755 --- a/bin/cluster +++ b/bin/cluster @@ -67,6 +67,21 @@ class Cluster(object): self.action(args, inventory, env, playbook) + def addNodes(self, args): + """ + Add nodes to an existing cluster for given provider + :param args: command line arguments provided by user + """ + env = {'cluster_id': args.cluster_id, + 'deployment_type': self.get_deployment_type(args)} + playbook = "playbooks/{0}/openshift-cluster/addNodes.yml".format(args.provider) + inventory = self.setup_provider(args.provider) + + env['num_nodes'] = args.nodes + env['num_infra'] = args.infra + + self.action(args, inventory, env, playbook) + def terminate(self, args): """ Destroy OpenShift cluster @@ -292,6 +307,16 @@ if __name__ == '__main__': help='number of external etcd hosts to create in cluster') create_parser.set_defaults(func=cluster.create) + + create_parser = action_parser.add_parser('addNodes', help='Add nodes to a cluster', + parents=[meta_parser]) + create_parser.add_argument('-n', '--nodes', default=1, type=int, + help='number of nodes to add to the cluster') + create_parser.add_argument('-i', '--infra', default=1, type=int, + help='number of infra nodes to add to the cluster') + create_parser.set_defaults(func=cluster.addNodes) + + config_parser = action_parser.add_parser('config', help='Configure or reconfigure a cluster', parents=[meta_parser]) |