NFS PVC Volume support
This commit is contained in:
parent
9c9eea4bd3
commit
eff2eb8b59
21
dev/Vagrantfile
vendored
21
dev/Vagrantfile
vendored
@ -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 \
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user