- Notifications
You must be signed in to change notification settings - Fork3
Provision Kubernetes on Citrix XenServer
License
christus02/kubexen
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
You can now provision a Kubernetes cluster on aCitrix Xenserver using this tool. You can also specify the required CNI, node count and Kubernetes version.This is an Ansible based tool that usedKubeADM to bring up the Kubernetes Cluster.
This tool would create the Nodes in the XenServer for you and then install Kubernetes on them based on the parameters which you specify.
- Required Packages
apt install python-pippip install ansiblepip install XenAPIapt install sshpassexport ANSIBLE_HOST_KEY_CHECKING=False
- VM Template needs to be created. This is a one time process. This step can be skipped, if you choose not to provision nodes.
A detailed guide on how to create a VM export is givenhere
Note Support for installing nodes from pre-built VM templates is work-in-progress.
https://github.com/christus02/kubexen.gitcd kubexen
Specify the Xen Server details in the below section
xenserver: hostname: <IP/Hostname of the XenServer> username: <Username of the XenServer> password: <Password of the XenServer>
Provide the Free IPs in the XenServer management range. The Kubernetes nodes would be assigned these IPs after bring up.
The IPs should be specified as CIDR.
The First IP would be assigned to the Master Node
ip_config: ip: # Specify the IPs to be assigned for the nodes as CIDR (IP/PREFIX) - 10.0.0.11/24 # The first IP would be considered as Master - 10.0.0.12/24 # Worker Node 1 - 10.0.0.13/24 # Worker Node 2 gateway: 10.0.0.1
You can provide the CNI to be installed in the below section.
cluster_configs: # Possible CNI list: # TODO cni: 'flannel'
You can provide the Kubernetes Version to be installed in the below section.
cluster_configs: # Specify the Kubernetes version you wish to install version: '1.18.0'
Save thevars/config.yml
file and exit.
Now that you have updated thevars/config.yml
file, run the Ansible playbook to provision VMs and create Kubernetes cluster
ansible-playbook kubexen.yml
Let the playbook run and in few more minutes your cluster would be UP and RUNNING.
Login to the Master IP provided in thevars/config.yml
with thevm.template_username
andvm.template_password
specified in thevars/config.yml
file
After logging in, you can execute the usualkubectl
commands.
Your Kubernetes cluster is now UP and READY.
Make sure thevars/config.yml
is not changed and execute the below command to delete the created Kubernetes cluster
ansible-playbook kubexen.yml -t delete
The Kubernetes cluster can also be deleted by manually deleting the VMs from the XenCenter.
All the nodes in the Kubernetes cluster can reach each other using the hostnames. This is made possible as the hostnames are configured asxip.io
domain names.
- Support all possible CNI
- Option to bring up just Kubernetes without provisioning VMs
- Make this tool Docker Ready
- Support for importing a VM template from URL