NFS PVC Volume support

This commit is contained in:
Pete Birley 2017-04-03 09:06:20 -05:00
parent 9c9eea4bd3
commit eff2eb8b59
2 changed files with 21 additions and 1 deletions

21
dev/Vagrantfile vendored
View File

@ -50,12 +50,19 @@ Vagrant.configure("2") do |config|
# Customize the number of vCPUs in the VM: # Customize the number of vCPUs in the VM:
vb.cpus = $vcpu_cores vb.cpus = $vcpu_cores
# Set the size of the VM's root disk: # Set the size of the VM's docker disk:
unless File.exist?('.vagrant/machines/default/openstack-helm-storage.vdi') unless File.exist?('.vagrant/machines/default/openstack-helm-storage.vdi')
vb.customize ['createhd', '--filename', '.vagrant/machines/default/openstack-helm-storage', '--size', $docker_disk] vb.customize ['createhd', '--filename', '.vagrant/machines/default/openstack-helm-storage', '--size', $docker_disk]
end end
vb.customize ['storageattach', :id, '--storagectl', 'SCSI', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', '.vagrant/machines/default/openstack-helm-storage.vdi'] vb.customize ['storageattach', :id, '--storagectl', 'SCSI', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', '.vagrant/machines/default/openstack-helm-storage.vdi']
# Set the size of the VM's PVC disk:
unless File.exist?('.vagrant/machines/default/openstack-helm-storage-kube-pvc.vdi')
vb.customize ['createhd', '--filename', '.vagrant/machines/default/openstack-helm-storage-kube-pvc', '--size', $pvc_disk]
end
vb.customize ['storageattach', :id, '--storagectl', 'SCSI', '--port', 3, '--device', 0, '--type', 'hdd', '--medium', '.vagrant/machines/default/openstack-helm-storage-kube-pvc.vdi']
end end
# Enable provisioning with a shell script. # Enable provisioning with a shell script.
@ -64,15 +71,27 @@ Vagrant.configure("2") do |config|
mkfs.xfs /dev/disk/by-path/pci-0000\:00\:14.0-scsi-0\:0\:2\:0 -f -L docker-srg mkfs.xfs /dev/disk/by-path/pci-0000\:00\:14.0-scsi-0\:0\:2\:0 -f -L docker-srg
mkdir -p /var/lib/docker mkdir -p /var/lib/docker
echo "LABEL=docker-srg /var/lib/docker xfs defaults 0 0" >> /etc/fstab echo "LABEL=docker-srg /var/lib/docker xfs defaults 0 0" >> /etc/fstab
# Setup kubelet pvc storage
mkfs.xfs /dev/disk/by-path/pci-0000\:00\:14.0-scsi-0\:0\:3\:0 -f -L kube-srg
mkdir -p /var/lib/nfs-provisioner
echo "LABEL=kube-srg /var/lib/nfs-provisioner xfs defaults 0 0" >> /etc/fstab
# Mount Storage
mount -a mount -a
# Install requirements
apt-get update apt-get update
apt-get install -y \ apt-get install -y \
docker.io \ docker.io \
nfs-common nfs-common
# Setup kubelet lib as shared mount
mkdir -p /var/lib/kublet mkdir -p /var/lib/kublet
mount --bind /var/lib/kublet /var/lib/kublet mount --bind /var/lib/kublet /var/lib/kublet
mount --make-shared /var/lib/kublet mount --make-shared /var/lib/kublet
# Run AIO container
docker run \ docker run \
-dt \ -dt \
--name=kubeadm-aio \ --name=kubeadm-aio \

View File

@ -1,5 +1,6 @@
# VM Specs # VM Specs
$vm_image = "ubuntu/xenial64" $vm_image = "ubuntu/xenial64"
$docker_disk = 20480 $docker_disk = 20480
$pvc_disk = 10240
$vcpu_cores = 4 $vcpu_cores = 4
$ram = 8192 $ram = 8192