Skip to content

Commit

Permalink
minor modifications , use ubunutu 18 cuz its compatible w vsphere in …
Browse files Browse the repository at this point in the history
…case we want to use that instead for hypervisor
  • Loading branch information
jayunit100 committed Jun 23, 2021
1 parent 03253ce commit bf712b6
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 42 deletions.
20 changes: 20 additions & 0 deletions README_VMWARE.md
Original file line number Diff line number Diff line change
@@ -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=
```
22 changes: 4 additions & 18 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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"
Expand Down
13 changes: 11 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,29 @@ 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

./build/run.sh make kubelet KUBE_BUILD_PLATFORMS=linux/amd64
./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
Expand Down
3 changes: 2 additions & 1 deletion sync/linux/controlplane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sudo apt-get update


#disable swap
swapoff -a
sudo swapoff -a
sudo sed -i '/swap/d' /etc/fstab

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

# CNI: Not 100% tested, just a prototype...
# Not used at all... probably should delete
function cni_flannel {
wget https://github.com/raw/coreos/flannel/master/Documentation/kube-flannel.yml -P /tmp -q
## this is important for windows:
Expand Down
19 changes: 0 additions & 19 deletions sync/shared/config

This file was deleted.

2 changes: 1 addition & 1 deletion sync/shared/kubejoin.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$env:path += ";C:\Program Files\containerd"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token ariivt.cftklu90vqp5mqau --discovery-token-ca-cert-hash sha256:ccf13900552a0c15b566e61ee13b8a820270e761ba4c2657798cfba4a7e7dd50
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token yy81yy.c5vf340s6eas9l41 --discovery-token-ca-cert-hash sha256:d69069be33f871a85090ce02698677bb5075fad431041f1d2343a16222feabc5
1 change: 0 additions & 1 deletion sync/shared/variables.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
kubelet_path: "./sync/windows/bin/kubelet.exe"
kubeproxy_path: "./sync/windows/bin/kube-proxy.exe"
kubernetes_version_linux: "1.21.0"
Expand Down

0 comments on commit bf712b6

Please sign in to comment.