Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: merging the QEMU branch to masterrrr #238

Closed
wants to merge 11 commits into from
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

VAGRANT?="vagrant"
PROVIDER?="qemu"

.SILENT: clean

Expand Down Expand Up @@ -44,10 +45,10 @@ all: 0-fetch-k8s 1-build-binaries 2-vagrant-up 3-smoke-test 4-e2e-test
@echo "Retry vagrant up if the first time the windows node failed"
@echo "Starting the control plane"
@echo "######################################"
@$(VAGRANT) up controlplane
@$(VAGRANT) up --provider=$(PROVIDER) controlplane

@echo "*********** vagrant up first run done ~~~~ ENTERING WINDOWS BRINGUP LOOP ***"
@until `$(VAGRANT) status | grep winw1 | grep -q "running"` ; do $(VAGRANT) up winw1 || echo failed_win_up ; done
@until `$(VAGRANT) status | grep winw1 | grep -q "running"` ; do $(VAGRANT) up winw1 --provider=$(PROVIDER) || echo failed_win_up ; done
@until `$(VAGRANT) ssh controlplane -c "kubectl get nodes" | grep -q winw1` ; do $(VAGRANT) provision winw1 || echo failed_win_join; done
@touch .lock/joined
@$(VAGRANT) provision winw1
Expand Down
48 changes: 37 additions & 11 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,24 @@ Vagrant.configure(2) do |config|
controlplane.vm.box = "roboxes/ubuntu2004"

controlplane.vm.network :private_network, ip:"#{k8s_linux_kubelet_nodeip}"
controlplane.vm.provider :virtualbox do |vb|
controlplane.vm.synced_folder "./sync/shared", "/var/sync/shared"
controlplane.vm.synced_folder "./forked", "/var/sync/forked"
controlplane.vm.synced_folder "./sync/linux", "/var/sync/linux"
vb.memory = linux_ram
vb.cpus = linux_cpus

controlplane.vm.synced_folder ".", "/vagrant", disabled: true
controlplane.vm.synced_folder "./sync/shared", "/var/sync/shared", type: "rsync"
controlplane.vm.synced_folder "./forked", "/var/sync/forked", type: "rsync"
controlplane.vm.synced_folder "./sync/linux", "/var/sync/linux", type: "rsync"
controlplane.vm.network "private_network", ip: "10.20.30.10"

controlplane.vm.provider "qemu" do |qe|
qe.memory = linux_ram
qe.arch = "x86_64"

# need for x86_64
qe.machine = "q35"
qe.cpu = "qemu64"
qe.net_device = "virtio-net-pci"
qe.extra_netdev_args = "net=10.20.30.0/24,dhcpstart=10.20.30.10"

print "qemu loop"
end

### This allows the node to default to the right IP i think....
Expand All @@ -61,11 +73,25 @@ Vagrant.configure(2) do |config|
winw1.vm.host_name = "winw1"
winw1.vm.box = "sig-windows-dev-tools/windows-2019"
winw1.vm.box_version = "1.0"

winw1.vm.provider :virtualbox do |vb|
vb.memory = windows_ram
vb.cpus = windows_cpus
vb.gui = false
winw1.vm.network :private_network, ip:"#{windows_node_ip}"
winw1.vm.provider "qemu" do |qe, override|
qe.vm.network "private_network", type: "dhcp", ip: "10.20.30.20"
qe.arch = "x86_64"
qe.memory = windows_ram
# need for x86_64
qe.machine = "q35"
qe.cpu = "qemu64"

# devices compatible with this box
qe.net_device = "e1000"
qe.drive_interface = "ide"
qe.ssh_port = 50023

qe.extra_netdev_args = "net=10.20.30.0/24,dhcpstart=10.20.30.20"

# use password (use winrm?)
override.ssh.username = "vagrant"
override.ssh.password = "vagrant"
end

winw1.vm.network :private_network, ip:"#{windows_node_ip}"
Expand Down
3 changes: 3 additions & 0 deletions sync/linux/controlplane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ nodeRegistration:
kubeletExtraArgs:
node-ip: $k8s_kubelet_node_ip
cgroup-driver: cgroupfs
apiServer:
timeoutForControlPlane: 8m0s
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
kubernetesVersion: $k8s_linux_apiserver
networking:
podSubnet: "${pod_cidr}"

EOF

# Ignore kubelet mismatch in the copy process
Expand Down
2 changes: 1 addition & 1 deletion variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ calico_version: "3.25.0"
## Linux settings
k8s_linux_kubelet_nodeip: "10.20.30.10"
windows_node_ip: "10.20.30.11"
windows_ram: 6048
windows_ram: 4096
linux_ram: 4096
linux_cpus: 2
windows_cpus: 4
Expand Down