diff options
author | Troy Dawson <tdawson@redhat.com> | 2015-06-16 11:48:22 -0500 |
---|---|---|
committer | Troy Dawson <tdawson@redhat.com> | 2015-06-24 09:19:34 -0500 |
commit | 97a8f95c750314087a2358059037f01b04da785a (patch) | |
tree | e80839217ede1364642f5d215e41f7f1112ede05 /roles/openshift_storage_nfs_lvm/README.md | |
parent | a7ac3f7b513fe57ddccad15bdb6c7e9091f16bcd (diff) | |
download | openshift-97a8f95c750314087a2358059037f01b04da785a.tar.gz openshift-97a8f95c750314087a2358059037f01b04da785a.tar.bz2 openshift-97a8f95c750314087a2358059037f01b04da785a.tar.xz openshift-97a8f95c750314087a2358059037f01b04da785a.zip |
Create openshift_storage_nfs_lvm based off kube_nfs_volumes
initial import of openshift_storage_nfs from kube_nfs_volumes
reduce total size so we do not go over
Postpone making the mounts owned by nfsnobody
rename openshift_storage_nfs storage_nfs_pvs
Update README to latest settings
have json files go to /root/
change categories from cloud to openshift, cuz this can run on bare metal
storgae_nfs_lvm initial commit
fixing default
getting it working
check these in, just cuz
for lvm we do not need the library
Update README to match reality
adding recycle
make volume_group a variable
make volume_group a variable
fix typo
default should be /exports/openshift
set owner and permissions of mount point
update examples
cleanup cruft
fixup documentation
fixup documentation
rename storage_nfs_lvm to openshift_storage_nfs_lvm
rename storage_nfs_lvm to openshift_storage_nfs_lvm
use openshiftvg, not openshift3vg
use ansible file: to set owner and permissions of mount dir
change nfs_export_options to osnl_nfs_export_options
change mount_dir to osnl_mount_dir
change volume_group to osnl_volume_group
change volume_prefix to osnl_volume_prefix
change volume_size to osnl_volume_size
change volume_num_start to osnl_volume_num_start
change number_of_volumes to osnl_number_of_volumes
replace volume_size with osnl_volume_size
Diffstat (limited to 'roles/openshift_storage_nfs_lvm/README.md')
-rw-r--r-- | roles/openshift_storage_nfs_lvm/README.md | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/roles/openshift_storage_nfs_lvm/README.md b/roles/openshift_storage_nfs_lvm/README.md new file mode 100644 index 000000000..1ee02e18a --- /dev/null +++ b/roles/openshift_storage_nfs_lvm/README.md @@ -0,0 +1,108 @@ +# openshift_storage_nfs_lvm + +This role is useful to create and export nfs disks for openshift persistent volumes. +It does so by creating lvm partitions on an already setup pv/vg, creating xfs +filesystem on each partition, mounting the partitions, exporting the mounts via NFS +and creating a json file for each mount that an openshift master can use to +create persistent volumes. + +## Requirements + +* NFS server with NFS, iptables, and everything setup. + +* A lvm volume group created on the nfs server (default: openshiftvg) + +* The lvm volume needs to have as much free space as you are allocating + +## Role Variables + +``` +# Options of NFS exports. +osnl_nfs_export_options: "*(rw,sync,all_squash)" + +# Directory, where the created partitions should be mounted. They will be +# mounted as <osnl_mount_dir>/<lvm volume name> +osnl_mount_dir: /exports/openshift + +# Volume Group to use. +# This role always assumes that there is enough free space on the volume +# group for all the partitions you will be making +osnl_volume_group: openshiftvg + +# volume names +# volume names are {{osnl_volume_prefix}}{{osnl_volume_size}}g{{volume number}} +# example: stg5g0004 + +# osnl_volume_prefix +# Useful if you are using the nfs server for more than one cluster +osnl_volume_prefix: "stg" + +# osnl_volume_size +# Size of the volumes/partitions in Gigabytes. +osnl_volume_size: 5 + +# osnl_volume_num_start +# Where to start the volume number numbering. +osnl_volume_num_start: 3 + +# osnl_number_of_volumes +# How many volumes/partitions to build, with the size we stated. +osnl_number_of_volumes: 2 + +``` + +## Dependencies + +None + +## Example Playbook + +With this playbook, 2 5Gig lvm partitions are created, named stg5g0003 and stg5g0004 +Both of them are mounted into `/exports/openshift` directory. Both directories are +exported via NFS. json files are created in /root. + + - hosts: nfsservers + sudo: no + remote_user: root + gather_facts: no + roles: + - role: openshift_storage_nfs_lvm + osnl_mount_dir: /exports/openshift + osnl_volume_prefix: "stg" + osnl_volume_size: 5 + osnl_volume_num_start: 3 + osnl_number_of_volumes: 2 + + +## Full example + + +* Create an `inventory` file: + ``` + [nfsservers] + 10.0.0.1 + 10.0.0.2 + ``` + +* Create an ansible playbook, say `setupnfs.yaml`: + ``` + - hosts: nfsservers + sudo: no + remote_user: root + gather_facts: no + roles: + - role: openshift_storage_nfs_lvm + osnl_mount_dir: /exports/stg + osnl_volume_prefix: "stg" + osnl_volume_size: 5 + osnl_volume_num_start: 3 + osnl_number_of_volumes: 2 + +* Run the playbook: + ``` + ansible-playbook -i inventory setupnfs.yml + ``` + +## License + +Apache 2.0 |