From bf712b63474f4a6e2b8beb5b46ebba940881f234 Mon Sep 17 00:00:00 2001 From: jay vyas Date: Tue, 22 Jun 2021 20:27:35 -0400 Subject: [PATCH] minor modifications , use ubunutu 18 cuz its compatible w vsphere in case we want to use that instead for hypervisor --- README_VMWARE.md | 20 ++++++++++++++++++++ Vagrantfile | 22 ++++------------------ build.sh | 13 +++++++++++-- sync/linux/controlplane.sh | 3 ++- sync/shared/config | 19 ------------------- sync/shared/kubejoin.ps1 | 2 +- sync/shared/variables.yaml | 1 - 7 files changed, 38 insertions(+), 42 deletions(-) create mode 100644 README_VMWARE.md delete mode 100644 sync/shared/config diff --git a/README_VMWARE.md b/README_VMWARE.md new file mode 100644 index 0000000..1cd19b3 --- /dev/null +++ b/README_VMWARE.md @@ -0,0 +1,20 @@ +Instructions to use vmware fusion + +# Install the vagrant plugin + +``` + vagrant plugin install vagrant-vmware-desktop +``` + +# Install system package for vmware utils + +``` +https://www.vagrantup.com/docs/providers/vmware/vagrant-vmware-utility +``` + +# Run with vsphere: + +``` +vagrant up --provider= + +``` diff --git a/Vagrantfile b/Vagrantfile index ee8314c..4586d12 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,22 +1,5 @@ # -*- mode: ruby -*- # vi: set ft=ruby : - -=begin -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -=end - require 'yaml' settings = YAML.load_file 'sync/shared/variables.yaml' kubernetes_version_linux = settings['kubernetes_version_linux'] @@ -29,7 +12,10 @@ Vagrant.configure(2) do |config| # LINUX Control Plane config.vm.define :controlplane do |controlplane| controlplane.vm.host_name = "controlplane" - controlplane.vm.box = "ubuntu/focal64" + # controlplane.vm.box = "ubuntu/focal64" + # better because its available on vmware and virtualbox + controlplane.vm.box = "bento/ubuntu-18.04" + controlplane.vm.network :private_network, ip:"10.20.30.10" controlplane.vm.provider :virtualbox do |vb| controlplane.vm.synced_folder "./sync/shared", "/var/sync/shared" diff --git a/build.sh b/build.sh index 6b1e9f5..968429b 100755 --- a/build.sh +++ b/build.sh @@ -17,12 +17,21 @@ limitations under the License. set -e build_binaries () { - echo "building kube from $1" + echo "building kube locally inside `pwd` from $1" startDir=`pwd` + echo "changing into directory $1 to start the build" pushd $1 if [[ -d ./_output/dockerized/bin/windows/amd64/ ]]; then echo "skipping compilation of windows bits... _output is present" else + echo "running docker build ~ checking memory, make sure its > 4G!!!" + if [[ `docker system info | grep Memory | cut -d' ' -f 4 |cut -d'.' -f 1` -gt 4 ]]; then + echo "Proceeding with build, docker daemon memory is ok" + else + echo "Insufficient LOCAL memory to build k8s before the vagrant builder starts" + exit 1 + fi + # use the kubernetes/build/run script to build specific targets... ./build/run.sh make kubelet KUBE_BUILD_PLATFORMS=windows/amd64 ./build/run.sh make kube-proxy KUBE_BUILD_PLATFORMS=windows/amd64 @@ -30,7 +39,7 @@ build_binaries () { ./build/run.sh make kubectl KUBE_BUILD_PLATFORMS=linux/amd64 ./build/run.sh make kubeadm KUBE_BUILD_PLATFORMS=linux/amd64 fi - # TODO maybe build a function ... + # TODO replace with https://github.com/kubernetes-sigs/sig-windows-tools/issues/152 at some point echo "Copying files to sync" #win mkdir -p $startDir/sync/windows/bin diff --git a/sync/linux/controlplane.sh b/sync/linux/controlplane.sh index 61568ab..0df4a2e 100644 --- a/sync/linux/controlplane.sh +++ b/sync/linux/controlplane.sh @@ -30,7 +30,7 @@ sudo apt-get update #disable swap -swapoff -a +sudo swapoff -a sudo sed -i '/swap/d' /etc/fstab cat <