Kubeinit / kubeinit

Ansible automation to have a KUBErnetes cluster INITialized as soon as possible...

Home Page:https://www.kubeinit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a cluster with custom set of nodes

mmprabhu-coder opened this issue · comments

Hi,
By default I am able to bring up Kubeinit cluster with 3 controller-nodes and a single compute. I want to create a cluster with 1 control node and 2 compute nodes.
How do I change the inventory file or specify elsewhere so that only these nodes come up? I tried to set:
[controller_nodes] okd-controller-01 ansible_host=10.0.0.1 mac=52:54:00:34:84:26 interfaceid=47f2be09-9cde-49d5-bc7b-76189dfcb8a9 target=hypervisor-01 type=virtual

[compute_nodes] okd-compute-01 ansible_host=10.0.0.6 mac=52:54:00:10:64:16 interfaceid=4aa70bce-a99d-4142-8bfc-61c06f710d64 target=hypervisor-01 type=virtual okd-compute-02 ansible_host=10.0.0.7 mac=52:54:00:33:75:35 interfaceid=a9cc79f3-0892-47af-9195-6c28c718c2a0 target=hypervisor-01 type=virtual
These result in the ansible bailing out with errors indicating incorrect interfaceid etc. Is there an option where we can specify the required number of nodes?

Thanks,
/M

Hello,

Currently the inventory is generated dynamically, based on the latest deployment command from the docs you will need to run:

# Run the playbook
ansible-playbook \
    -v --user root \
    -e kubeinit_spec=okd-libvirt-1-2-1 \
    -i ./kubeinit/inventory \
    ./kubeinit/playbook.yml

Here we introduce the Kubeinit spec, which defines the number of nodes in your cluster.

okd-libvirt-1-2-1 means <distro>-<driver>-<controllers>-<computes>-<hypervisors>

What you should do in the inventory is to configure parameters like the node's prefix name you will like to use.

Let me know if this fixes your problem to close this.

Yes, it does. Exactly what I was looking for. Could some documentation be included to indicate the same? If it is already there and I missed it, please do point me to it.

@mmprabhu-coder nice it worked for you.

Please feel free to ask any questions you have, and if you find any issue also feel free to raise issues in the project's repo (https://www.github.com/kubeinit/kubeinit). You can jump in and ask in the slack channel https://kubernetes.slack.com/archives/C01FKK19T0B Also, it would be awesome if you can star the project to catch up with updates and new features.

Ill push a new PR to the docs with these changes.