Skip to content

Commit bf712b6

Browse files
committed
minor modifications , use ubunutu 18 cuz its compatible w vsphere in case we want to use that instead for hypervisor
1 parent 03253ce commit bf712b6

File tree

7 files changed

+38
-42
lines changed

7 files changed

+38
-42
lines changed

README_VMWARE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Instructions to use vmware fusion
2+
3+
# Install the vagrant plugin
4+
5+
```
6+
vagrant plugin install vagrant-vmware-desktop
7+
```
8+
9+
# Install system package for vmware utils
10+
11+
```
12+
https://www.vagrantup.com/docs/providers/vmware/vagrant-vmware-utility
13+
```
14+
15+
# Run with vsphere:
16+
17+
```
18+
vagrant up --provider=
19+
20+
```

Vagrantfile

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
3-
4-
=begin
5-
Copyright 2021 The Kubernetes Authors.
6-
7-
Licensed under the Apache License, Version 2.0 (the "License");
8-
you may not use this file except in compliance with the License.
9-
You may obtain a copy of the License at
10-
11-
http://www.apache.org/licenses/LICENSE-2.0
12-
13-
Unless required by applicable law or agreed to in writing, software
14-
distributed under the License is distributed on an "AS IS" BASIS,
15-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-
See the License for the specific language governing permissions and
17-
limitations under the License.
18-
=end
19-
203
require 'yaml'
214
settings = YAML.load_file 'sync/shared/variables.yaml'
225
kubernetes_version_linux = settings['kubernetes_version_linux']
@@ -29,7 +12,10 @@ Vagrant.configure(2) do |config|
2912
# LINUX Control Plane
3013
config.vm.define :controlplane do |controlplane|
3114
controlplane.vm.host_name = "controlplane"
32-
controlplane.vm.box = "ubuntu/focal64"
15+
# controlplane.vm.box = "ubuntu/focal64"
16+
# better because its available on vmware and virtualbox
17+
controlplane.vm.box = "bento/ubuntu-18.04"
18+
3319
controlplane.vm.network :private_network, ip:"10.20.30.10"
3420
controlplane.vm.provider :virtualbox do |vb|
3521
controlplane.vm.synced_folder "./sync/shared", "/var/sync/shared"

build.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,29 @@ limitations under the License.
1717
set -e
1818

1919
build_binaries () {
20-
echo "building kube from $1"
20+
echo "building kube locally inside `pwd` from $1"
2121
startDir=`pwd`
22+
echo "changing into directory $1 to start the build"
2223
pushd $1
2324
if [[ -d ./_output/dockerized/bin/windows/amd64/ ]]; then
2425
echo "skipping compilation of windows bits... _output is present"
2526
else
27+
echo "running docker build ~ checking memory, make sure its > 4G!!!"
28+
if [[ `docker system info | grep Memory | cut -d' ' -f 4 |cut -d'.' -f 1` -gt 4 ]]; then
29+
echo "Proceeding with build, docker daemon memory is ok"
30+
else
31+
echo "Insufficient LOCAL memory to build k8s before the vagrant builder starts"
32+
exit 1
33+
fi
34+
# use the kubernetes/build/run script to build specific targets...
2635
./build/run.sh make kubelet KUBE_BUILD_PLATFORMS=windows/amd64
2736
./build/run.sh make kube-proxy KUBE_BUILD_PLATFORMS=windows/amd64
2837

2938
./build/run.sh make kubelet KUBE_BUILD_PLATFORMS=linux/amd64
3039
./build/run.sh make kubectl KUBE_BUILD_PLATFORMS=linux/amd64
3140
./build/run.sh make kubeadm KUBE_BUILD_PLATFORMS=linux/amd64
3241
fi
33-
# TODO maybe build a function ...
42+
# TODO replace with https://github.com/kubernetes-sigs/sig-windows-tools/issues/152 at some point
3443
echo "Copying files to sync"
3544
#win
3645
mkdir -p $startDir/sync/windows/bin

sync/linux/controlplane.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ sudo apt-get update
3030

3131

3232
#disable swap
33-
swapoff -a
33+
sudo swapoff -a
3434
sudo sed -i '/swap/d' /etc/fstab
3535

3636
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
@@ -116,6 +116,7 @@ rm -f /var/sync/shared/config
116116
cp $HOME/.kube/config /var/sync/shared/config
117117

118118
# CNI: Not 100% tested, just a prototype...
119+
# Not used at all... probably should delete
119120
function cni_flannel {
120121
wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml -P /tmp -q
121122
## this is important for windows:

sync/shared/config

Lines changed: 0 additions & 19 deletions
This file was deleted.

sync/shared/kubejoin.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
$env:path += ";C:\Program Files\containerd"
22
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
3-
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token ariivt.cftklu90vqp5mqau --discovery-token-ca-cert-hash sha256:ccf13900552a0c15b566e61ee13b8a820270e761ba4c2657798cfba4a7e7dd50
3+
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token yy81yy.c5vf340s6eas9l41 --discovery-token-ca-cert-hash sha256:d69069be33f871a85090ce02698677bb5075fad431041f1d2343a16222feabc5

sync/shared/variables.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
kubelet_path: "./sync/windows/bin/kubelet.exe"
32
kubeproxy_path: "./sync/windows/bin/kube-proxy.exe"
43
kubernetes_version_linux: "1.21.0"

0 commit comments

Comments
 (0)