DISCLAIMER: THIS SETUP WITH DEFAULTS IS NOT FOR PRODUCTION USE!
This ansible playbook is for installing container native storage (CNS) to Openshift Container Platform 3.4+.
- Ansible
- OCP 3.4+ (3.7 no tested yet) with three app nodes
- Subscription for Gluster storage (eval or proper production one)
- Access to OCP master via Ansible
- At least one spare brick in each three Openshift app nodes
- Ansible hosts file that was used to install yuor OCP. At least same hosts.
All variables that you need to change are in vars.yml
file.
You need to change at least following to match your env.
Openshift Container Platform subscription pool id. You can fetch is with command subscription-manager list --available --matches="*Openshift*"
Gluster storage subcription pool id. subscription-manager list --available
Gluster installation process goes forward so fast that host that executes cns-deploy will need entries to /etc/hosts file to resolv needed services fast enough.
For /etc/hosts file
List of target hosts for Ansible to define where to install actual storage nodes. Must be found from your Ansible hosts file.
List of Openshift nodes running storage, double check with oc get nodes
List of storage hosts IP addresses. Must be in same order as nodes in storage_nodes
Devices that will be used as storage on storage hosts/nodes.
This is used as hack to label storage nodes with correct zone label. Must be in same order as nodes in storage_nodes var.
Playbook must be installed on hosts that has ansible and connection to all Openshift masters and nodes. This playbook relies on default what comes to ansible connection to remote hosts. Change connenction stuff to match your env either directly to playbook and to ansible configs.
Execute installation with following command after you have check your Ansible connection stuff and vars.yml.
git clone https://github.com/tahonen/gluster-openshift.git
cd gluster-openshfit
ansible-playbook playbooks/install_gluster.yml
After installation you can test was installation success by create app that needs storage like oc new-app --template mongodb-persistent -p VOLUME_CAPACITY=1Gi
All template and config files are pretty much defauls that work. If you want to customize your installation you can change following files, but you need to know what you are doing :)
Change this file if you want to create something else than single storage cluster with 3 zones.
Change if you need to change heketi config.
Change if you need to modify or add stuff to storageclass definition. For example add labels.
Change this file if you need to change how installation goes.