Skip to content

Ansible playbook for setting up single master Kubernetes test clusters with LINSTOR from LINBIT's repositories on CentOS/RHEL7 or Ubuntu 20.04 hosts.

Notifications You must be signed in to change notification settings

kermat/k8s-linstor-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes w/ LINSTOR Ansible Playbook

Build a Kubernetes cluster w/ LINSTOR installed using Ansible.

Requirements:

Usage

Adjust the variables in hosts.ini accordingly. For example:

... snip ...
# all vars
[multi:vars]
ansible_user=root
become=yes
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
# Linstor variables
drbd_backing_disk=/dev/sdb
# my.linbit.com customer portal credentials
lb_user="fthomas"
lb_pass="Password1!"
lb_email="[email protected]"

You can only list a single host as a k8s_master. That node will be the node you can administer Kubernetes from.

Bring up cluster using Ansible:

ansible-playbook -i hosts.ini playbook.yaml

You can bring up a Kuberenetes cluster without LINSTOR via --skip-tags linstor. Or, you can install LINSTOR into an existing kubernetes cluster using --tags linstor.

If you don't want to put LINBIT credentials into your host.ini, you can run the playbook like this instead:

ansible-playbook -e lb_user="username" -e lb_pass="password" playbook.yaml

If you're target systems require a sudo password to become root, you can provide the sudo password when running the playbook like this:

ansible-playbook -i hosts.ini playbook.yaml -e "ansible_become_pass=superSecretSudoPW1!"

Testing Installation

Shell into the k8s_master and watch pods coming up:

watch kubectl get pods

Once deployed, there is a pile of yaml in root's home under, linstor-csi-k8s-yaml, that can be used to deploy applications:

kubectl apply -f linstor-csi-k8s-yaml/mysql-replicated-stateful-set/

You should see a mysql cluster starting up with LINSTOR volumes being created as it's persistent volumes:

watch "kubectl get pods; kubectl get pv"

About

Ansible playbook for setting up single master Kubernetes test clusters with LINSTOR from LINBIT's repositories on CentOS/RHEL7 or Ubuntu 20.04 hosts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages